Overview
As AI agents become integral to workflows—coding assistants, autonomous workflows, MCP servers, and more—organizations need robust governance. Bedrock treats agents as first-class subjects, enabling you to apply the same authorization model to agents that you use for humans.Why Agent Governance Matters
Principle of Least Privilege
Agents should only access what they need for their specific task
Context-Aware Access
Different scopes may require different agent capabilities
Auditability
Track what agents access and do across your organization
Revocability
Quickly revoke agent access when needed
Agent Subject Types
Bedrock supports multiple subject types for different use cases:| Type | Use Case | Example |
|---|---|---|
agent | AI assistants and autonomous agents | Claude, GPT-4, custom LLM agents |
service | Backend services and microservices | Payment processor, notification service |
api_key | API integrations | Third-party integrations, webhooks |
Example: Coding Assistant Agent
Let’s set up a coding assistant with appropriate permissions for a development team.1. Register the Agent
2. Create Agent-Specific Roles
Define roles tailored for agent capabilities:3. Define Agent Permissions
Create granular permissions for agent actions:4. Add Agent to Scope with Restricted Role
You can create the agent with inline membership and role assignment:Inline Memberships: The
memberships array creates the membership and role assignments automatically when the subject is created.Advanced Patterns
Pattern 1: Scope-Specific Agent Permissions
Different teams may want different agent capabilities:Pattern 2: Override Agent Permissions at Child Scopes
Restrict agent capabilities in sensitive areas:Pattern 3: Role-Permission Overrides for Agents
Fine-tune what specific roles can do at specific scopes:Pattern 4: Multiple Agents with Different Access
MCP Server Integration
When using Model Context Protocol (MCP) servers, Bedrock can govern which tools and resources agents can access:Checking Agent Permissions
Use theBedrockEngine to evaluate permissions at runtime:
Delegated Permissions (Agent Acting on Behalf of User)
When an agent acts on behalf of a user, both must have permission:List All Effective Permissions
Best Practices
Start with minimal permissions
Start with minimal permissions
Give agents the least privilege needed. It’s easier to grant more access than to revoke it after a problem.
Use descriptive metadata
Use descriptive metadata
Include model version, capabilities, and purpose in agent metadata for easier auditing.
Separate agents by function
Separate agents by function
Create different agent subjects for different purposes rather than one super-agent.
Restrict production access
Restrict production access
Use scope overrides to limit agent capabilities in production environments.
Audit agent actions
Audit agent actions
Log all permission checks and actions for compliance and debugging.
Version your agents
Version your agents
Use external IDs like
coding-assistant-v1 to track agent versions.Comparison: User vs Agent Governance
| Aspect | Users | Agents |
|---|---|---|
| Subject type | user | agent, service, api_key |
| Authentication | OAuth, SSO, passwords | API keys, tokens |
| Typical roles | Admin, Editor, Viewer | Reader, Writer, Autonomous |
| Permission scope | Often broad | Usually narrow and specific |
| Override usage | Occasional | Frequent (restrict in sensitive areas) |
| Metadata | Name, email | Model, version, capabilities |