Controlling Access to Models, Agents and Tools
This lesson explains how IAM, SCPs and endpoint policies control access to Bedrock resources, and how AgentCore Identity authenticates callers and gives agents credentials for tools.
Learning outcomes
After completing this lesson, you will be able to:
- Identify the controls that restrict which principals can use which models and resources.
- Distinguish inbound and outbound authentication in AgentCore Identity.
- Choose between two-legged and three-legged OAuth for an agent's tool access.
Controlling access to models and resources
Bedrock actions are authorised by IAM like any other AWS API. Roles are scoped to specific model, inference profile, knowledge base, guardrail and agent ARNs; SCPs deny unapproved models or Regions across the organisation; interface VPC endpoints with endpoint policies limit which principals and resources can be reached through the network path; and condition keys such as aws:PrincipalOrgID keep access inside the organisation. Knowledge base data sources and vector stores are protected separately with their own IAM, KMS and network controls, because retrieval returns their content to the model.
Identity for agents with AgentCore Identity
Inbound authentication decides who may invoke an agent: IAM SigV4 for callers inside AWS, or OAuth 2.0 JWTs from an identity provider such as Amazon Cognito, Okta or Microsoft Entra ID, with allowed audiences and client IDs. Outbound authentication lets the agent call tools: two-legged OAuth (client credentials) for machine-to-machine access, three-legged OAuth when the agent acts on behalf of a user who has consented, and API keys for services that use them.
Credentials are configured as credential providers and the resulting tokens are kept in a token vault, encrypted with KMS and bound to a specific agent and user, so agents never hold long-lived secrets in code, images or environment variables. AgentCore Gateway uses the same providers when it calls tool targets.
Which outbound credential?
Limiting what agents can do
Least privilege applies to each tool, not only to the agent as a whole: a reporting tool gets read-only access, and a refund tool gets only the permissions it needs. Deterministic AgentCore Policy rules check tool parameters against the caller's identity and business limits. Human approval covers actions whose impact is too high for automation, and session isolation in AgentCore Runtime keeps one user's data out of another user's session.
A calendar assistant
An internal assistant must read employees' calendars and documents in a SaaS suite and create meetings, acting only with each employee's own permissions, and only employees signed in through the corporate identity provider may use it.
The agent runtime uses inbound JWT authentication configured with the identity provider's discovery URL and the assistant's client ID.
For the SaaS suite, the team configures a three-legged OAuth credential provider: the first time an employee asks for calendar access, the agent returns an authorisation link, the employee consents, and the token is stored in the token vault for that agent and employee. The SaaS suite then enforces the employee's own permissions on every call.
When should an agent use three-legged OAuth rather than the client credentials grant?
Show answer
When it acts on behalf of a specific user and must use that user's permissions after the user consents. Client credentials suit machine-to-machine access where the agent acts as itself.
Exam Tips
Remember for the exam
- Agent acts with a user's permissions in a SaaS tool: AgentCore Identity three-legged OAuth.
- Only corporate users may invoke an agent: inbound JWT authorisation with the corporate IdP.
- No tokens or secrets in agent code: credential providers and the token vault.
- Restrict models through the network path: interface endpoint policy for bedrock-runtime.