CertBrain
CoursesBlog
Sign in
← Back to decks
Sign in to save your progress, vote, and build your own decks.Sign in

Securing AI Agents

An AI agent doesn't just answer questions: it calls tools, reads systems and takes actions, often for a specific user. That creates two security questions a chatbot never had to answer. How does the agent prove who it is, and get credentials to other services safely? And what stops it from taking…

7 cards
Study this deck

Securing AI Agents

An AI agent doesn't just answer questions: it calls tools, reads systems and takes actions, often for a specific user. That creates two security questions a chatbot never had to answer. How does the agent prove who it is, and get credentials to other services safely? And what stops it from taking an action it shouldn't, even if a prompt tricks the model? On AWS, Amazon Bedrock AgentCore Identity answers the first, and Policy in AgentCore answers the second.

Why Agents Need Their Own Controls

A language model decides what an agent does next, and a model can misread a business rule or be manipulated by a cleverly worded prompt. If the only thing standing between the agent and a costly action is an instruction in its prompt, the protection is only as strong as the model's judgment. Agents also need credentials: to read a user's calendar, update a ticket or query a database. Storing passwords or API keys inside agent code is risky, because anyone who reads the code or tricks the agent can get them.

AgentCore Identity

Amazon Bedrock AgentCore Identity manages identities and credentials for agents. Each agent gets its own workload identity, with a unique ARN, held in a central directory so administrators can govern agents the way they govern users.

Its token vault stores OAuth 2.0 tokens, OAuth client credentials and API keys, encrypted with AWS KMS keys. An agent can only retrieve a credential when it proves its identity, so secrets don't need to live in code or configuration files. AgentCore Identity supports both main OAuth 2.0 patterns:

  • Machine-to-machine access, where the agent authenticates as itself with no user involved.
  • User-delegated access, where a user explicitly consents and the agent then acts on that user's behalf, for example reading their files in a third-party service.

It includes ready-made credential providers for common services such as Google, GitHub, Slack and Salesforce, verifies every request independently, and logs operations for auditing.

Policy in AgentCore

Policy in AgentCore puts a rule-checking boundary around what an agent can do with its tools. Agent tool calls go through an AgentCore Gateway, and Policy intercepts each call and checks it against the rules in a policy engine before the tool runs. Rules can depend on who the user is and on the tool's input values, such as the amount of a refund.

Policies are written in Cedar, an open-source authorization language, or described in plain English and turned into Cedar for you. AWS validates natural-language policies with automated reasoning, flagging rules that are too permissive, too strict or impossible to satisfy. Because enforcement happens outside the agent's code and outside the model, the result is deterministic: a prompt can't talk its way past it. Every decision is logged to Amazon CloudWatch for audit.

Layers That Work Together

ControlQuestion it answers
AgentCore IdentityWho is this agent, and which credentials may it use?
Policy in AgentCoreIs this specific tool call allowed, with these inputs?
IAMWhich AWS resources can the agent's role reach?
Amazon Bedrock GuardrailsIs this prompt or response safe and on topic?

These controls don't replace each other. Guardrails check content; Policy checks actions. A refund request can be politely worded and pass every content filter, yet still break a spending rule.

On the Exam

If a scenario says an agent must act on a user's behalf in another service without storing secrets in code, choose AgentCore Identity. If it says an agent must never perform an action above a limit, "even if the model is tricked", choose Policy in AgentCore, because the rule is enforced outside the model. A tempting wrong answer is "add the rule to the system prompt": prompt instructions guide a model but can't guarantee its behavior.

Quiz me on this
A company is building an agent that reads each employee's calendar in a third-party scheduling service, with the employee's consent. The security team forbids storing API keys or passwords in the agent's code or configuration files. Which AWS capability fits BEST?
  1. Store the service's API key in the agent's environment variables
  2. ✓ AgentCore Identity with an OAuth credential provider
  3. Policy in AgentCore rules attached to the agent's gateway
  4. An Amazon Bedrock guardrail with sensitive information filters
An online retailer's support agent can issue refunds through a tool. The company requires that the agent never issues a refund over $500, even if a customer's message manipulates the model. Which control meets this requirement?
  1. A system prompt telling the agent never to refund more than $500
  2. A Bedrock guardrail denied topic covering large refunds
  3. ✓ A Policy in AgentCore rule on the refund tool
  4. An AgentCore Identity credential provider for the refund system
Which statement describes Policy in Amazon Bedrock AgentCore?
  1. It stores OAuth tokens and API keys for agents in an encrypted vault
  2. It filters harmful content out of model prompts and responses
  3. It encrypts an agent's memory with a customer managed key
  4. ✓ It checks each tool call against Cedar rules first
Amazon Bedrock AgentCore Identity
Manages agent identities and credentials, so agents can reach AWS and third-party services, including on a user's behalf, without secrets in code.
AgentCore Identity token vault
Encrypted storage for OAuth tokens, client credentials and API keys. An agent gets a credential only after proving its identity.
Policy in AgentCore
Checks every agent tool call through an AgentCore Gateway against deterministic rules before the tool runs, outside the agent's code and model.
Cedar
The open-source authorization language Policy in AgentCore uses for its rules. Rules can also be written in plain English and converted.