AgentCore Policy - Cedar policies, enforced outside agent code
// HR assistant can read employee records
permit(
principal is AgentCore::OAuthUser,
action == AgentCore::Action::"HRTools__get_employee_record",
resource == AgentCore::Gateway::"arn:aws:bedrock-agentcore:ap-southeast-2:123456789012:gateway/hr-assistant"
) when {
principal.hasTag("role") &&
(principal.getTag("role") == "hr-manager" || principal.getTag("role") == "hr-admin")
};
// Nobody can bulk-export salary data
forbid(
principal is AgentCore::OAuthUser,
action == AgentCore::Action::"HRTools__export_salary_report",
resource == AgentCore::Gateway::"arn:aws:bedrock-agentcore:ap-southeast-2:123456789012:gateway/hr-assistant"
);
The agent doesn't decide its own permissions. You do.