Black Friday sale: an extra 40% off every course until Monday, November 30.New Year sale: an extra 30% off every course until Friday, January 1.Memorial Day sale: an extra 25% off every course until Monday, May 31.SysAdmin Day sale: an extra 25% off every course until Sunday, August 1.Back to School sale: an extra 25% off every course until Sunday, August 22.Labor Day sale: an extra 25% off every course until Monday, September 6.Black Friday sale: an extra 40% off every course until Monday, November 29.New Year sale: an extra 30% off every course until Saturday, January 1.Choose your certification →

Copyright (c) 2026 MindMesh Academy. All rights reserved. This content is proprietary and may not be reproduced or distributed without permission.

3.6.5. Guardrails and Access Controls for Generative and Agentic AI

💡 First Principle: Content controls belong at a layer the application developer, and the prompt, cannot skip. Access controls for agents must separate the agent's own identity from the user it acts for, and must be enforced outside the model.

Scenario: A bank requires that every model call in every account blocks hate speech, prompt attacks and customer account numbers, that individual teams cannot weaken this, and that its HR agent can read a user's calendar only with that user's consent.

Amazon Bedrock Guardrails policies: content filters (hate, insults, sexual, violence, misconduct, and prompt attack for jailbreaks and prompt injection), denied topics, word filters, sensitive information filters (PII and custom regex, block or mask), contextual grounding checks (flag answers not supported by the retrieved source, for RAG), and automated reasoning checks (validate answers against rules you define). The ApplyGuardrail API evaluates any text without calling a model, so the same guardrail can protect models hosted on SageMaker AI or elsewhere, or screen user input before retrieval.

Enforcement levelMechanismStrength
RequestPass guardrailIdentifier and version in Converse/InvokeModelDepends on every developer remembering
IAMAllow/deny inference on the bedrock:GuardrailIdentifier condition keyCall fails without the approved guardrail; callers can still tag input to skip input checks (output is always checked)
AccountAccount-level enforced guardrail, configured per RegionApplies to every model invocation in the account
OrganizationAmazon Bedrock policies in AWS Organizations reference a numbered guardrail version in the management account (shared with a resource-based policy granting bedrock:ApplyGuardrail), attached to the root, OUs or accounts, optionally including or excluding modelsCentral, member accounts cannot remove it

When organization, account and request guardrails all apply, the union is enforced and the most restrictive control wins. Automated reasoning policies are not supported in enforced guardrails.

Access control for agents with AgentCore Identity.
  • Inbound: a JWT authorizer validates callers against your IdP (Amazon Cognito, Okta, Microsoft Entra ID, Auth0), or callers sign with IAM SigV4.
  • Outbound: credential providers store OAuth tokens, client secrets and API keys in a token vault encrypted with KMS and released only to a verified agent identity. The client credentials grant (2LO) lets the agent act as itself; the authorization code grant (3LO) gets the user's explicit consent so the agent acts on the user's behalf, scoped to that user's data.
  • Tool authorization: Policy in AgentCore evaluates every tool call at the Gateway, default-deny, with conditions on the user's claims and the tool's input (for example, refunds above $500 need a manager role).

⚠️ Exam Trap: A system prompt that says "never reveal account numbers" or "only managers may issue large refunds" is not a control, because a prompt injection can override it. Content rules belong in an enforced guardrail; authorization belongs in IAM, AgentCore Identity and Policy, outside the model.

See how it connects
Alvin Varughese
Written byAlvin Varughese
Founder•26 professional certifications earned