3.2.11

Question Answer & Explanation
### Question 1 - AgentCore Memory: Long-term vs Short-term

A retail company uses an AI agent to handle customer support. The agent successfully maintains context during a single multi-turn conversation, but returning customers have to repeat their order history and preferences on every new visit. The engineering team needs to implement a solution that persists context across sessions without mixing data between different users, adhering to strict privacy requirements.

Which solution meets these requirements with the least operational overhead? (Select ONE)

- A) Increase the session timeout for the Bedrock Agent to 24 hours.
- B) Configure Amazon Bedrock AgentCore Memory to use long-term memory scoped to an actor namespace.
- C) Store the full transcript of every session in an Amazon S3 bucket and prepend it to the prompt for future sessions.
- D) Deploy a separate Bedrock Agent instance for every user to maintain state.
Correct Answer: B

Correct Answer Analysis:
- B is Correct: Amazon Bedrock AgentCore Memory supports long-term memory (LTM), which automatically extracts and consolidates persistent insights (like user preferences) scoped to a user/actor namespace. This allows context to persist securely across distinct sessions without manual intervention or custom data pipelines.

Distractor Analysis:
- A is Incorrect: Increasing the session timeout only extends the duration of short-term memory for a single active session; it does not persist context after the session expires.
- C is Incorrect: Storing transcripts in S3 and manually prepending them introduces massive operational overhead, increases token costs, and risks data leakage between users.
- D is Incorrect: Deploying a separate agent instance per user is highly inefficient, unscalable, and violates the least operational overhead constraint.

> Key Takeaway: Use short-term memory for single-session context and AgentCore Long-term Memory (scoped by actorId) for cross-session context.
### Question 2 - Exposing APIs to Agents as Tools

An enterprise has existing microservices running on Amazon ECS that manage inventory and process payments. The AI team is building a Bedrock Agent that needs to invoke these services securely. The existing microservices use internal REST APIs and require specific authentication. The team needs to expose these services to the agent without rewriting the backend code or compromising security.

Which approach satisfies these requirements with the least operational overhead? (Select ONE)

- A) Rewrite the existing microservices as AWS Lambda functions and attach them as agent action groups.
- B) Use Amazon Bedrock AgentCore Gateway to expose the existing APIs to the agent.
- C) Deploy the agent inside the same VPC as the ECS services and grant it direct network access using broad security group rules.
- D) Create a custom Lambda function that acts as a proxy to the ECS services and configure it as an action group.
Correct Answer: B

Correct Answer Analysis:
- B is Correct: Amazon Bedrock AgentCore Gateway is designed to expose existing services and APIs to agents in a protocol the agent speaks, without requiring backend code rewrites or managing custom proxy infrastructure.

Distractor Analysis:
- A is Incorrect: Rewriting existing microservices as Lambda functions requires significant development effort and violates the "no backend code changes" constraint.
- C is Incorrect: Broadening security group rules to grant direct network access violates the principle of least privilege and does not provide the necessary API protocol translation for the agent.
- D is Incorrect: Writing and managing a custom Lambda proxy introduces unnecessary operational overhead and maintenance compared to a native gateway service.

> Key Takeaway: Use Amazon Bedrock AgentCore Gateway to securely expose existing enterprise APIs to agents as tools without rewriting backend code.
### Question 3 - Agent Runtime Session Isolation and Observability

A financial services company is deploying an agentic workflow to process loan applications. Multiple users will interact with the agent simultaneously. Compliance regulations mandate that no user's working state or temporary variables can be visible to another user's session. The architecture must also provide native observability to trace exactly which tool calls executed and failed during an invocation.

Which solution meets these compliance and observability constraints? (Select ONE)

- A) Use Bedrock AgentCore to provide a runtime with session isolation and built-in observability for tool calls.
- B) Deploy the agent on a single large EC2 instance and use thread locks in the code to separate user state.
- C) Use a shared DynamoDB table to store session state and rely on IAM policies for row-level isolation.
- D) Deploy the agent using AWS Step Functions, manually passing the execution ARN to isolate states.
Correct Answer: A

Correct Answer Analysis:
- A is Correct: Amazon Bedrock AgentCore supplies a runtime that inherently isolates separate sessions into separate execution environments, ensuring one conversation cannot read another's working state. It also provides built-in observability to record traces of every step and tool call.

Distractor Analysis:
- B is Incorrect: Managing thread locks on a custom EC2 instance is highly error-prone, lacks native observability, and introduces massive operational overhead.
- C is Incorrect: While DynamoDB can store state, relying on manual IAM row-level isolation for active session memory does not provide native runtime isolation or automatic tool call tracing.
- D is Incorrect: Step Functions is an orchestration service, not an agent runtime. It does not natively provide the specialized agent session isolation and tool-call tracing required by AgentCore.

> Key Takeaway: AgentCore provides native session isolation and observability, preventing state leakage between users and recording tool call traces.
### Question 4 - Agentic Infrastructure as Code (IaC)

An AI engineering team needs to provision the infrastructure for an agentic workflow. The infrastructure includes an Amazon Bedrock Agent, an AgentCore memory store, a Knowledge Base, and the necessary IAM roles. The team wants to ensure the environment is strictly reproducible and can be deployed across multiple development accounts with minimal manual intervention.

Which deployment method satisfies these reproducibility and automation constraints? (Select ONE)

- A) Use the AWS Management Console to manually create the resources in each account.
- B) Use AWS CloudFormation or AWS CDK to define the Agent, memory store, and IAM roles as code.
- C) Write a bash script using the AWS CLI that sequentially creates the resources via API calls.
- D) Use AWS Elastic Beanstalk to deploy the agent and its dependencies.
Correct Answer: B

Correct Answer Analysis:
- B is Correct: AWS CloudFormation and AWS CDK are Infrastructure as Code (IaC) services designed to declare and provision AWS resources reproducibly across multiple accounts, ensuring environment parity and minimal manual overhead.

Distractor Analysis:
- A is Incorrect: Manual creation via the Management Console leads to configuration drift and does not meet the automation constraint.
- C is Incorrect: Custom bash scripts with sequential AWS CLI calls are brittle, hard to maintain, and lack the state management and rollback capabilities of IaC tools.
- D is Incorrect: AWS Elastic Beanstalk is designed for web application hosting (EC2/ECS), not for provisioning managed AI services like Bedrock Agents and Knowledge Bases.

> Key Takeaway: Always use IaC (CloudFormation/CDK) to provision agentic workflow infrastructure to ensure reproducibility and prevent configuration drift.
### Question 5 - Private Networking for Agent Infrastructure

An enterprise requires their Bedrock Agent to interact with an internal database hosted on Amazon RDS to retrieve sensitive user information. The company has strict compliance policies that mandate no traffic between the agent's underlying compute and the database can traverse the public internet.

Which configuration satisfies this zero internet traversal constraint? (Select ONE)

- A) Deploy the agent in a public subnet and use a NAT Gateway to route traffic to the RDS instance.
- B) Configure VPC endpoints and ensure the agent's runtime and the RDS instance are in private subnets with appropriate security groups.
- C) Use AWS VPN to establish a secure connection from the agent's public endpoint to the RDS instance.
- D) Store the RDS data in an Amazon S3 bucket and use a Bedrock Knowledge Base to access it via the public internet.
Correct Answer: B

Correct Answer Analysis:
- B is Correct: Placing resources in private subnets removes internet routes. Configuring VPC Endpoints (or ensuring VPC peering/internal routing) allows private communication between the agent runtime and RDS securely within the AWS network backbone.

Distractor Analysis:
- A is Incorrect: A NAT Gateway routes traffic from private subnets to the internet. Even if the RDS is public, using a NAT Gateway violates the "no traffic traversing the public internet" constraint.
- C is Incorrect: A VPN tunnel is unnecessary and overly complex for resources already residing within the same AWS infrastructure.
- D is Incorrect: Moving data to S3 to avoid networking configuration changes the architectural pattern completely and risks exposing data if not properly secured.

> Key Takeaway: To keep agentic traffic private, place runtimes and downstream services in private subnets and use VPC endpoints or internal routing.
### Question 6 - Observability and Tracing for Agentic Workflows

A machine learning team deployed a Bedrock Agent that uses multiple tools to fetch data from internal APIs. Recently, the agent has been returning incorrect answers, and the team suspects one of the tool calls is returning unexpected payloads. The team needs to identify which tool call is causing the issue without adding custom logging code to the agent's application layer.

Which approach provides the native observability needed with the least operational overhead? (Select ONE)

- A) Enable Amazon Bedrock AgentCore observability to trace and record each step and tool call the agent takes.
- B) Manually invoke each tool using the AWS CLI and inspect the output for each.
- C) Add print statements to the agent's prompt template to output the intermediate steps.
- D) Create a custom CloudWatch Logs metric to monitor the latency of the agent's responses.
Correct Answer: A

Correct Answer Analysis:
- A is Correct: Amazon Bedrock AgentCore provides built-in observability that automatically records a trace of the agent's steps, including the inputs and outputs of tool calls, allowing engineers to pinpoint failure points without custom code.

Distractor Analysis:
- B is Incorrect: Manually invoking tools outside the context of the agent's execution might not reproduce the exact conditions or payloads causing the error.
- C is Incorrect: Prompt templates are for instructions, not code execution. You cannot add print statements to a prompt template for operational logging.
- D is Incorrect: CloudWatch latency metrics tell you how long a call took, but not what the payload contained or if the payload was malformed, which is required for debugging incorrect answers.

> Key Takeaway: AgentCore observability automatically records execution traces, making it the primary tool for debugging agent tool call failures.
### Question 7 - Agentic State Management Configuration

A developer is configuring an Amazon Bedrock Agent and needs to understand the distinction between the agent's session state and its long-term memory. The agent needs to remember a user's name and address across all future interactions, but it also needs to keep track of the current step in a multi-step booking process that should reset when the session closes.

Which configuration correctly separates these memory requirements? (Select ONE)

- A) Use long-term memory for the booking process steps and session state for the user's name and address.
- B) Use short-term memory for the booking process steps and long-term memory for the user's name and address.
- C) Store both in long-term memory and manually clear the booking steps at the end of the session.
- D) Store both in session state and manually copy the name and address to an S3 bucket at the end of the session.
Correct Answer: B

Correct Answer Analysis:
- B is Correct: Short-term (session) memory holds the active multi-turn conversation and working state (booking steps) which resets when the session ends. Long-term memory persists facts (name and address) across distinct future sessions.

Distractor Analysis:
- A is Incorrect: This reverses the definitions. Long-term memory would persist the booking steps forever, and session state would forget the user's name when the session closes.
- C is Incorrect: Manually clearing booking steps from long-term memory at session end introduces operational overhead and is prone to errors if the session disconnects unexpectedly.
- D is Incorrect: Manually copying state to S3 is a custom, high-overhead workaround when native memory services exist for this exact purpose.

> Key Takeaway: Session state (short-term) handles active multi-turn steps; AgentCore Memory (long-term) handles persistent user facts.
### Question 8 - Secure Tool Authentication in Agentic Workflows

A company's existing enterprise APIs are protected by an API Gateway and require a specific API key for access. The AI team is configuring an Amazon Bedrock AgentCore Gateway to expose these APIs to a new agent. The team needs to ensure the agent can authenticate to the existing APIs without exposing the API keys in the agent's prompt definition or source code.

Which configuration meets these security constraints? (Select ONE)

- A) Hardcode the API key in the agent's prompt instructions.
- B) Pass the API key as a variable in the user's input prompt for each session.
- C) Use AWS Secrets Manager to store the API key and configure the AgentCore Gateway to retrieve it securely.
- D) Disable authentication on the existing APIs to allow the agent to access them without keys.
Correct Answer: C

Correct Answer Analysis:
- C is Correct: Storing secrets in AWS Secrets Manager and allowing the AgentCore Gateway to retrieve them at runtime keeps the keys out of the codebase and prompt definitions, adhering to security best practices.

Distractor Analysis:
- A is Incorrect: Hardcoding API keys in prompt instructions is a severe security vulnerability as prompts can be logged or intercepted.
- B is Incorrect: Passing the API key in the user prompt requires the end-user to know the secret, which violates security boundaries.
- D is Incorrect: Disabling authentication on production APIs exposes them to unauthorized access and creates a massive security risk.

> Key Takeaway: Use AWS Secrets Manager to securely inject API keys into agent workflows, never in prompts or hardcoded definitions.
### Question 9 - Scaling Agentic Workflows with High-Resolution Metrics

An agentic workflow built on Amazon Bedrock is experiencing rapid, unpredictable spikes in concurrent requests during marketing events. The standard 1-minute CloudWatch metrics are too slow to trigger the auto-scaling of the underlying inference endpoints, leading to high latency and timeouts. The team needs a scaling solution that reacts in seconds.

Which scaling configuration satisfies this rapid scale-out constraint? (Select ONE)

- A) Use target tracking on a high-resolution concurrency metric.
- B) Increase the target value on the existing 1-minute invocation metric.
- C) Implement a scheduled scaling action for the duration of the marketing event.
- D) Manually pre-provision maximum capacity and leave it running.
Correct Answer: A

Correct Answer Analysis:
- A is Correct: High-resolution concurrency metrics (e.g., ConcurrentRequestsPerModel) emit at sub-minute intervals (e.g., 10 seconds). Target tracking on this metric allows Application Auto Scaling to detect in-flight request surges almost instantaneously and trigger scale-out events in seconds.

Distractor Analysis:
- B is Incorrect: Increasing the target value on a 1-minute metric forces each instance to handle more traffic before scaling, delaying the reaction and worsening latency.
- C is Incorrect: Scheduled scaling is for predictable traffic patterns. Unpredictable spikes cannot be accurately addressed by a static schedule.
- D is Incorrect: Manually pre-provisioning maximum capacity is not cost-effective and violates the dynamic scaling requirement.

> Key Takeaway: For rapid, unpredictable traffic spikes in agentic workloads, use high-resolution concurrency metrics for faster auto-scaling reactions.
### Question 10 - Orchestrating Complex Agentic Workflows

An AI engineering team is building a complex agentic workflow that requires orchestrating multiple AWS Lambda functions, an Amazon Bedrock Agent invocation, and a human approval step before sending a final summary email. The workflow must have defined failure handling, automatic retry logic, and state management. The team needs to deploy this workflow programmatically to ensure consistency.

Which AWS services should be combined to meet these orchestration and deployment constraints? (Select TWO)

- A) Use AWS Step Functions to orchestrate the workflow components.
- B) Use AWS CDK to define and deploy the Step Functions state machine and associated resources.
- C) Write a Python script using Boto3 to chain the Lambda functions and agent invocation sequentially.
- D) Use Amazon EventBridge to trigger the Lambda functions and agent invocation based on a cron schedule.
- E) Configure the Bedrock Agent to natively handle the human approval step and email notifications.
Correct Answers: A and B

Correct Answer Analysis:
- A is Correct: AWS Step Functions provides the native orchestration required to sequence Lambda, Bedrock Agents, and human approval steps, complete with built-in retry logic and state management.
- B is Correct: AWS CDK allows the team to define this complex, multi-resource infrastructure programmatically, ensuring consistent, reproducible deployments across environments.

Distractor Analysis:
- C is Incorrect: Custom Python scripts chaining Boto3 calls lack built-in state management, automatic retries, and visual orchestration, making them brittle and operationally heavy.
- D is Incorrect: Amazon EventBridge is an event router/scheduler, not an orchestrator. It cannot handle complex state transitions, human approval steps, or conditional retry logic.
- E is Incorrect: Bedrock Agents natively do not handle out-of-band human approval workflows or email notifications; they rely on external orchestration for these steps.

> Key Takeaway: Use AWS Step Functions for complex agent orchestration with human-in-the-loop steps, and deploy it using AWS CDK for reproducibility.