
Identity Federation and Fine-Grained Access Security for Foundation Models in Amazon Bedrock
Learn how to connect enterprise IdPs with AWS IAM Identity Center and Amazon Cognito, enforce ABAC and RBAC, mandate guardrails via IAM condition keys, propagate user identity in RAG workflows, and audit inference with AWS CloudTrail. Built for architects, engineers, and AWS Certified Generative AI Developer Professional candidates.
Series: AIP-C01 | Task 2.3: Design and implement enterprise integration architectures. (5 articles)
- …
- 3Identity Federation and Fine-Grained Access Security for Foundation Models in Amazon Bedrock This article
AWS Certified Generative AI Developer - Professional - Exam Guide (AIP-C01)
Content Domain 2: Implementation and Integration
Task 2.3: Design and implement enterprise integration architectures.
Skill 2.3.3: Create secure access frameworks to ensure appropriate security controls (for example, by using identity federation between FM services and enterprise systems, role-based access control for model and data access, least privilege API access to FMs).
Article Overview
What you will learn:
- How to architect an enterprise-grade federated authentication solution (SAML 2.0 and OIDC) integrating Microsoft Entra ID and Okta with AWS IAM Identity Center and Amazon Cognito.
- How to implement granular access control using Role-Based Access Control (RBAC) and Attribute-Based Access Control (ABAC).
- How to enforce the principle of least privilege using IAM condition keys and specific Foundation Model ARNs.
- How to propagate end-user identity across Retrieval-Augmented Generation (RAG) pipelines.
- How to audit every inference call made to Amazon Bedrock using AWS CloudTrail and immutable storage.
Introduction: The Challenge of Protecting Foundation Models and Sensitive Data
When scaling Generative AI solutions into enterprise production environments, the traditional security perimeter shifts dramatically. The challenge extends far beyond ensuring that the model provides accurate completions; engineering teams must safeguard Foundation Models (FMs) and vector databases against unauthorized API calls, unexpected inference expenses, and proprietary data exposure.

Conceptual overview of identity federation and access security for Amazon Bedrock Foundation Models.
In enterprise landscapes, dozens of business units often share common AWS workloads. Without a centralized governance tier, critical security risks arise:
- Unauthorized FM Invocations: Teams lacking technical or commercial clearance invoking high-cost, high-parameter models.
- Data Exposure via RAG: Knowledge Base queries returning confidential documents (such as executive payroll records or protected health information) to users without adequate clearance.
- Lack of Traceability: Inability to pinpoint which specific enterprise employee executed an anomalous, malicious, or non-compliant prompt.

Key enterprise challenges in securing Foundation Models and sensitive vector data.
Solving this operational challenge requires a solid design based on three foundational pillars: Federated Identity, Granular Authorization, and Immutable Auditability.
Enterprise Authentication: Connecting Identity Providers to AWS Services
Generating permanent AWS Identity and Access Management (IAM) user access keys for enterprise employees or client applications is an anti-pattern. AWS strongly recommends federating external Identity Providers (IdPs) directly into managed cloud identity services.

Connecting enterprise Identity Providers to AWS IAM Identity Center and Amazon Cognito.
Two standard integration pathways accommodate different user personas:
- AWS IAM Identity Center (Workforce Identities): Integrates directly with enterprise IdPs such as Microsoft Entra ID and Okta via SAML 2.0 or OIDC. Employees authenticate using their existing corporate Single Sign-On (SSO) credentials, eliminating the operational overhead of managing local IAM users in AWS accounts.
- Amazon Cognito (Customer-Facing Applications): Optimized for external end-users and consumer-facing applications. It supports corporate and social identity providers through Cognito User Pools and Federated Identity Pools.
Users authenticate through their corporate IdP via SAML 2.0 or OIDC. AWS IAM Identity Center or Amazon Cognito handles assertion validation and delegates credential requests to AWS STS. AWS STS issues short-lived temporary security tokens, ensuring static credentials never interact with Amazon Bedrock FMs.
💡 Exam Tip #1: When an exam scenario requires workforce authentication via corporate credentials (such as Microsoft Entra ID) to restrict access to specific generative models without maintaining manual access keys, choose SAML 2.0 federation backed by AWS IAM Identity Center. Pair this design with AWS PrivateLink VPC Endpoints to guarantee that all Bedrock API traffic stays within the private AWS network backbone.
Authorization: RBAC vs. ABAC in AI Workloads
Once identity is authenticated, authorization determines what that identity is permitted to do. AWS supports two primary authorization paradigms: Role-Based Access Control (RBAC) and Attribute-Based Access Control (ABAC).

Comparing Role-Based Access Control and Attribute-Based Access Control for AI workloads.
1. RBAC (Role-Based Access Control)
In RBAC, permissions are statically mapped to discrete IAM roles.
- How it works: A user assumes a specific IAM role (e.g.,
DataScientistRoleorFinancialAnalystRole) that contains statically attached policies defining permitted Bedrock actions and resources. - Limitation: In large enterprises with diverse cross-functional teams, RBAC leads to role explosion, requiring dozens or hundreds of dedicated IAM roles to handle every department and environment permutation.
2. ABAC (Attribute-Based Access Control)
In ABAC, access decisions are evaluated dynamically based on session tags passed from the federated IdP and resource tags configured on AWS resources.
- How it works: The IdP passes identity attributes as session tags during federation (e.g.,
Department = Finance). The attached IAM policy evaluates in real time whether the caller's session tag matches the target resource tag:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": "bedrock:Retrieve",
"Resource": "*",
"Condition": {
"StringEquals": {
"aws:ResourceTag/Department": "${aws:PrincipalTag/Department}"
}
}
}
]
}
- Advantages: Highly scalable. If a new engineer joins the engineering division, the administrator simply assigns the appropriate department attribute in the corporate IdP. The user dynamically inherits access to matching tagged Knowledge Bases without modifying a single IAM policy or provisioning new roles.
💡 Exam Tip #2: If an exam question asks how to restrict access to multiple Bedrock Knowledge Bases or vector stores across dozens of internal departments while minimizing IAM role proliferation and policy maintenance overhead, ABAC is the recommended answer. The policy evaluates
${aws:PrincipalTag/Department} against ${aws:ResourceTag/Department} dynamically.Least Privilege and Condition Keys in Amazon Bedrock
By default, Amazon Bedrock enforces an explicit Default Deny stance: no API invocation is permitted unless explicitly authorized by an identity-based or resource-based policy.

Granular API action boundaries in Amazon Bedrock.
In production systems, broad wildcards such as
bedrock:* must be strictly avoided. Grant only the precise API actions required for each application tier:bedrock:InvokeModel: Single-turn inference for non-streaming requests.bedrock:InvokeModelWithResponseStream: Real-time token streaming for conversational interfaces.bedrock:Retrieve: Semantic search and retrieval queries against Bedrock Knowledge Bases.bedrock:CreateModelCustomizationJob: Model fine-tuning and adaptation, restricted strictly to automated CI/CD pipelines or designated administrators.

Restricting access using model ARNs and Guardrail conditions.
ARN Scoping and Guardrail Condition Keys
Access control should not stop at action-level filtering; policies must scope permissions to specific model Amazon Resource Names (ARNs). Furthermore, IAM condition keys allow security teams to mandate that an invocation must include a corporate Bedrock Guardrail:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "AllowClaudeWithMandatoryGuardrail",
"Effect": "Allow",
"Action": "bedrock:InvokeModel",
"Resource": "arn:aws:bedrock:us-east-1::foundation-model/anthropic.claude-3-5-sonnet-20240620-v1:0",
"Condition": {
"StringEquals": {
"bedrock:GuardrailIdentifier": "arn:aws:bedrock:us-east-1:123456789012:guardrail/corp-safety-rules"
}
}
}
]
}
If a client application or developer attempts to call Claude 3.5 Sonnet without referencing the required
corp-safety-rules Guardrail ARN, IAM denies the request at the service boundary before model execution occurs.Temporary Credentials and Identity Propagation in RAG

Generating temporary credentials using AWS Security Token Service (STS).
Short-lived credentials generated by AWS Security Token Service (STS) serve as the backbone of AWS security architectures. Through the
AssumeRole and AssumeRoleWithWebIdentity API operations, applications receive short-lived credentials with configurable expiration windows (typically 15 minutes to a few hours), neutralizing the threat of long-term credential leakage.
End-to-end User Identity Propagation across Retrieval-Augmented Generation workflows.
In Retrieval-Augmented Generation (RAG) architectures, securing model invocation alone leaves a critical security gap. When an authenticated employee queries an enterprise financial assistant, their identity context must travel intact from the frontend through the application tier into the vector search engine (such as Amazon OpenSearch Serverless).
This architectural pattern—known as User Identity Propagation—ensures that the retrieval engine evaluates data access against the end user's individual entitlements. Without this, the query executes using the backend service role's broad permissions, enabling standard users to retrieve sensitive documents they are unauthorized to view.
Traceability and Auditing with AWS CloudTrail

Auditing Bedrock API calls and federated identities with AWS CloudTrail.
To satisfy regulatory compliance frameworks such as HIPAA, SOC 2, and GDPR, every interaction with Amazon Bedrock must be captured and audited in AWS CloudTrail. By enabling CloudTrail Data Events for Bedrock, organizations capture rich operational context:
- The identity metadata payload, identifying federated callers via
userIdentity.type = FederatedUser. - The originating enterprise Identity Provider assertion.
- The precise model ARN invoked, request parameters, and exact timestamps.
To prevent log tampering, export CloudTrail event streams into a centralized, dedicated Amazon S3 bucket protected by S3 Object Lock configured in Compliance mode (Write Once, Read Many - WORM). This guarantees forensic immutability even against privileged administrative accounts.
Master Architecture: End-to-End Enterprise Security Flow
Combining these components creates a cohesive, secure architecture that completely avoids public exposure of the Amazon Bedrock API endpoints:

Complete enterprise architectural pattern for secure Foundation Model consumption.
The enterprise user signs in via their corporate IdP and receives STS temporary credentials via IAM Identity Center. When calling Amazon API Gateway, AWS Lambda assumes an IAM role with resource-level scoping. Amazon Bedrock processes the inference request only after validating the required Guardrail condition key, while AWS CloudTrail records the corporate user identity in an immutable Amazon S3 bucket.
💡 Exam Tip #3: For maximum score on security questions, remember that application runtimes and containers must never embed static credentials in source code or configuration files. The architecturally sound approach is always AWS STS (AssumeRole) short-lived credentials combined with strict resource-level policies and AWS CloudTrail Data Events enabled for
InvokeModel.Comparative Overview: Authorization and Authentication Patterns
| Dimension / Criterion | Role-Based Access Control (RBAC) | Attribute-Based Access Control (ABAC) |
|---|---|---|
| Access Source | Static IAM roles predefined in the AWS account (IAM Roles). | Dynamic session and resource tags evaluated at runtime (${aws:PrincipalTag} vs ${aws:ResourceTag}). |
| Scalability | Low in complex, heterogeneous environments; requires new IAM roles for every departmental permutation. | High; scales seamlessly across teams and departments without policy updates. |
| Management Overhead | Simple for small teams, but leads to role explosion at enterprise scale. | Requires a strict, standardized enterprise tagging governance policy across IdPs and AWS resources. |
| Typical Use Cases | Monolithic applications, static single-purpose workloads, and fixed system-level pipelines. | Multi-tenant RAG systems, shared corporate AI platforms, and matrixed organizations. |
AIP-C01 Exam Practice Questions
Question 1
A financial enterprise uses Microsoft Entra ID as its centralized enterprise identity provider. The organization wants to grant hundreds of data scientists access to Amazon Bedrock Foundation Models, ensuring that no user possesses long-term AWS access keys and that access is dynamically provisioned according to each employee's departmental assignment.
Which architectural design fulfills these requirements with the lowest operational overhead?
- A) Configure SAML 2.0 federation between Microsoft Entra ID and AWS IAM Identity Center, applying ABAC policies that match department attributes passed in identity assertions to resource tags.
- B) Create local IAM users for each employee, issue static access keys, and automate key rotation every 30 days via AWS Secrets Manager.
- C) Deploy an intermediary proxy application on Amazon EC2 with a public IP address to intercept employee requests and authenticate them using HTTP Basic Auth.
- D) Create a single shared IAM role with administrative
bedrock:*permissions and distribute STS access across all development teams.
Question 2
A Generative AI Engineer must ensure that every API call invoking the Anthropic Claude 3.5 Sonnet foundation model in an AWS account strictly complies with a corporate Bedrock Guardrail. If a request does not specify the required Guardrail, the AWS authorization layer must automatically deny the call.
Which solution implements this security requirement using AWS best practices?
- A) Write custom application logic in an AWS Lambda function to inspect whether the Guardrail ARN exists before dispatching the Bedrock API call.
- B) Attach an IAM policy to the application execution role granting
bedrock:InvokeModelwith aConditionblock validating thebedrock:GuardrailIdentifiercontext key. - C) Terminate the managed Claude 3.5 Sonnet endpoint and deploy open-source LLMs on Amazon SageMaker hosting instances.
- D) Configure an Amazon CloudWatch alarm to notify security teams 5 minutes after a model is invoked without an attached Guardrail.
Question 3
During a penetration test on a multi-departmental RAG system deployed on Amazon Bedrock, a customer support representative submits a prompt that successfully extracts executive compensation data belonging to the HR department, even though the representative's corporate identity does not belong to HR.
What is the root cause of this architectural flaw, and how should it be remediated?
- A) Amazon Bedrock is a public multi-tenant service and does not offer access control controls over Knowledge Bases.
- B) The architecture failed to implement User Identity Propagation from the client tier to the vector search store, combined with ABAC policies to filter retrieved document chunks by user department.
- C) The model inference parameter
temperaturewas set above 0.8 during execution, causing excessive hallucinations. - D) The knowledge base source documents must be converted into local CSV files stored on persistent Amazon EC2 EBS volumes.
Question 4
To satisfy strict regulatory audit mandates, an organization must prove that all Amazon Bedrock API calls are encrypted in transit and log the exact federated corporate identity responsible for each model invocation. Furthermore, audit log files must be stored in an immutable storage repository protected against deletion or modification.
Which combination of AWS services satisfies these requirements?
- A) Enable CloudTrail Data Events for Amazon Bedrock inference APIs and route log files to an Amazon S3 bucket configured with S3 Object Lock in Compliance mode.
- B) Amazon CloudWatch Logs with log group retention configured to 7 days on ephemeral storage.
- C) Export manual execution logs from the Amazon Bedrock console playground directly into local spreadsheets on a weekly schedule.
- D) Implement AWS Step Functions workflows to append conversational session history into an Amazon ElastiCache Redis cluster.
Detailed Answer Explanations
Question 1 Answer Analysis
Correct Answer: A
Explanation: Federating Microsoft Entra ID with AWS IAM Identity Center via SAML 2.0 enables enterprise Single Sign-On (SSO) and dispenses with local IAM credentials. Combining federation with Attribute-Based Access Control (ABAC) allows the authorization engine to evaluate claims (such as
Department) passed inside the SAML assertion directly against resource tags on Bedrock models and Knowledge Bases, scaling dynamically without manual role management.Incorrect Options:
- B: Creating local IAM users and permanent access keys directly violates the AWS Well-Architected Framework and core security objectives of the AIP-C01 exam.
- C: Placing an EC2-based proxy with public IP access and Basic Auth introduces high operational overhead, single points of failure, and critical security vulnerabilities.
- D: Sharing a single
bedrock:*administrator role completely undermines the principle of least privilege and eliminates individual user accountability.
Question 2 Answer Analysis
Correct Answer: B
Explanation: AWS IAM natively supports the
bedrock:GuardrailIdentifier condition key for Bedrock operations. By using StringEquals in the IAM policy Condition block, the IAM authorization layer blocks any bedrock:InvokeModel request at the perimeter unless the request payload includes the mandated Guardrail ARN.Incorrect Options:
- A: Application-level validation can be bypassed by alternative clients, misconfigured code paths, or compromised application runtimes; authorization belongs in IAM.
- C: Self-hosting models on Amazon SageMaker incurs substantial operational maintenance and bypasses Amazon Bedrock's native Guardrail governance features.
- D: Reactive CloudWatch alerting after 5 minutes fails to prevent sensitive data leakage or non-compliant completions in real time.
Question 3 Answer Analysis
Correct Answer: B
Explanation: When applications query Knowledge Bases using a shared backend service role without User Identity Propagation, the vector database returns semantic matches across the entire corpus. Propagating the user's federated identity enables row-level and document-level attribute filtering (ABAC) in the vector store (e.g., OpenSearch Serverless), ensuring users only retrieve information matching their security attributes.
Incorrect Options:
- A: Amazon Bedrock integrates deeply with AWS IAM, VPC Endpoints, and fine-grained data access policies in Amazon OpenSearch Serverless.
- C: The
temperatureparameter governs stochasticity and sampling diversity; it plays no role in network authorization or data retrieval filtering. - D: Storing knowledge base contents as plain CSV files on EC2 instances is an anti-pattern that increases administrative overhead and does not provide semantic vector retrieval.
Question 4 Answer Analysis
Correct Answer: A
Explanation: Enabling AWS CloudTrail Data Events captures fine-grained API invocations (including
InvokeModel) alongside rich identity context (userIdentity.type = FederatedUser). Forwarding these logs to an Amazon S3 bucket with S3 Object Lock active in Compliance mode enforces Write Once, Read Many (WORM) storage, ensuring cryptographic immutability for compliance auditors.Incorrect Options:
- B: CloudWatch Logs with 7-day ephemeral retention does not meet compliance mandates for long-term immutable retention.
- C: Manual data exports from the Bedrock Playground lack cryptographic integrity, complete coverage, and automated provenance.
- D: Amazon ElastiCache is an in-memory caching engine designed for low-latency state retrieval, not persistent, immutable compliance recordkeeping.
Conclusion
Securing Foundation Models in Amazon Bedrock requires a deliberate, defense-in-depth architecture:
- Identity: Federate enterprise identity providers (Microsoft Entra ID, Okta) through SAML 2.0 or OIDC to AWS IAM Identity Center or Amazon Cognito, entirely eliminating static access keys.
- Authorization: Enforce least privilege using Attribute-Based Access Control (ABAC) to reduce administrative overhead. Scope access strictly to specific model ARNs and mandate compliance Guardrails using IAM condition keys.
- Retrieval Security: Propagate end-user identities into RAG pipelines so vector search engines enforce granular document-level access filtering.
- Auditability: Record every model invocation via AWS CloudTrail Data Events and preserve tamper-proof evidence inside immutable Amazon S3 buckets protected with S3 Object Lock.
Security in Generative AI is never an afterthought. For the AWS Certified Generative AI Developer Professional (AIP-C01) exam and production enterprise deployments, robust identity federation and rigorous access governance form the indispensable foundation of reliable, compliant, and cost-effective AI solutions.
Series: AIP-C01 | Task 2.3: Design and implement enterprise integration architectures. (5 articles)
- …
- 3Identity Federation and Fine-Grained Access Security for Foundation Models in Amazon Bedrock This article
Enjoyed reading this content? Let the author know!
Your likes, comments, shares, and saves help creators reach more builders.
Loading recommendations
Loading article