Skip to content

Skill 3.1.6: Deploy and configure agents for specific tasks, integration with other services and tools, and agent communication protocols


Question 1 - Agent Tool Integration with MCP

A financial services company is building an AI assistant using Amazon Bedrock AgentCore to help portfolio managers query real-time market data, execute approved trades, and retrieve internal research reports. The company's existing microservices architecture exposes APIs through Amazon API Gateway, and the security team mandates that agents must not have broad IAM permissions. Instead, the agent should only access approved endpoints through a managed gateway that presents these APIs as tools using an open protocol standard.

Which architecture should the ML engineer implement to securely expose the existing APIs to the agent with the least operational overhead? (Select ONE)

  • A) Create individual Lambda functions for each microservice, attach IAM roles to each Lambda, and configure the Bedrock agent action group to invoke the Lambdas directly.
  • B) Deploy an MCP (Model Context Protocol) server in Amazon ECS that wraps the existing API Gateway endpoints, and connect it to Bedrock AgentCore through the MCP gateway.
  • C) Embed the API credentials directly in the agent's prompt template so the foundational model can call the endpoints using tool-use formatting.
  • D) Create a custom SageMaker endpoint that acts as a proxy between the agent and the API Gateway, with the agent routing all tool calls through this proxy.
Click to reveal Answer & Explanation

Correct Answer: B

Correct Option Analysis

  • B is Correct: Amazon Bedrock AgentCore includes a gateway that natively supports the Model Context Protocol (MCP). By wrapping existing API Gateway endpoints as MCP tools, the agent can invoke these services through a managed, protocol-standard interface without granting broad IAM permissions. This aligns with the security requirement while minimizing operational overhead since the gateway is serverless and managed by AWS.

Distractor Analysis

  • A is Incorrect: Creating individual Lambda functions for each microservice with attached IAM roles introduces unnecessary operational complexity (multiple functions to manage, deploy, and monitor). Additionally, this approach doesn't use the open protocol standard specified in the requirement.
  • C is Incorrect: Embedding API credentials in prompt templates is a severe security violation—credentials can leak through model responses, logs, or prompt injection attacks. This is never a valid security practice.
  • D is Incorrect: Building a custom SageMaker endpoint as a proxy requires substantial engineering effort, ongoing maintenance, and endpoint sizing. It adds a custom component rather than using the managed MCP gateway in Bedrock AgentCore.

Key Takeaway: Bedrock AgentCore's MCP gateway provides the managed, protocol-standard path for agents to call external APIs as tools without bespoke proxy infrastructure.


Question 2 - Agent Identity and Action Group Permissions

A healthcare technology company deploys a Bedrock Agent that helps medical staff retrieve patient records from an Amazon DynamoDB table and send notifications through Amazon SNS when critical lab results are flagged. The compliance team requires:

  1. The agent must use scoped permissions defined through IAM roles attached to its action groups.
  2. Lambda functions that back the action groups must be directly invokable only by the agent service principal (bedrock.amazonaws.com).
  3. No cross-service resource-based policies are permitted.

Which TWO configurations satisfy these requirements? (Select TWO)

  • A) Create separate action groups for DynamoDB retrieval and SNS notification, each with its own IAM role granting least-privilege access to the respective service.
  • B) Attach resource-based policies to the DynamoDB table and SNS topic granting direct access to the agent's action group ARN.
  • C) Configure the Lambda function's resource-based policy to allow bedrock.amazonaws.com as a trusted principal for the lambda:InvokeFunction action.
  • D) Store IAM user access keys in AWS Secrets Manager, and have the Lambda functions retrieve these keys to authenticate to DynamoDB and SNS.
  • E) Grant the agent's execution role full administrative access to call any AWS service on behalf of the agent, relying on Bedrock Guardrails for security enforcement.
Click to reveal Answer & Explanation

Correct Answers: A and C

Correct Options Analysis

  • A is Correct: Bedrock Agent action groups are backed by Lambda functions. By creating separate action groups per task (DynamoDB retrieval, SNS notification) and attaching distinct IAM roles to each Lambda, permissions remain scoped and least-privilege—exactly what compliance requires.
  • C is Correct: Lambda resource-based policies must explicitly allow the Bedrock agent service principal (bedrock.amazonaws.com) to invoke the function. This ensures only the agent (not arbitrary AWS services or users) can directly invoke the Lambda.

Distractor Analysis

  • B is Incorrect: The requirement explicitly prohibits cross-service resource-based policies. Attaching resource-based policies on DynamoDB and SNS granting direct agent access would violate this constraint.
  • D is Incorrect: Storing IAM user access keys (even in Secrets Manager) is an anti-pattern. Lambda functions should use execution roles with temporary credentials, not long-term access keys that introduce key rotation overhead and security risk.
  • E is Incorrect: Granting full administrative access violates the principle of least privilege. Bedrock Guardrails handle content safety and PII redaction—not IAM permission enforcement.

Key Takeaway: Bedrock agent action groups enforce least-privilege through Lambda execution roles, and the Lambda resource policy must trust the Bedrock service principal for direct invocation.


Question 3 - Agent Memory Configuration

A customer support company deploys a Bedrock Agent to handle tier-1 support tickets. The agent must retain conversation context across multiple sessions with the same customer (e.g., remembering the customer's product model and previous issue history), but compliance rules forbid storing any personally identifiable information (PII) in agent memory beyond a 30-day window. The agent handles approximately 500 concurrent conversations daily.

Which memory configuration should the engineer implement? (Select ONE)

  • A) Configure Bedrock Agent memory with a 30-day session retention duration and enable PII redaction on sensitive fields before memory is written.
  • B) Store full conversation transcripts in Amazon DynamoDB with TTL set to 30 days, and pass the entire history as context in every agent invocation prompt.
  • C) Disable agent memory entirely and require users to re-provide their issue history in every session to guarantee zero PII persistence.
  • D) Use an external vector database (Amazon OpenSearch Serverless) to store memory embeddings, bypassing Bedrock AgentMemory's native TTL controls.
Click to reveal Answer & Explanation

Correct Answer: A

Correct Option Analysis

  • A is Correct: Bedrock Agent native memory supports session retention with configurable duration. The engineer can set a 30-day retention window to comply with the PII policy, and the service handles memory management automatically without additional infrastructure. PII redaction integrated with Bedrock Guardrails further ensures sensitive fields aren't persisted.

Distractor Analysis

  • B is Incorrect: Storing full conversation transcripts in DynamoDB and passing entire histories in prompts increases token costs, risks exceeding context window limits, and moves memory management to a custom solution (operational overhead). It also requires manual PII filtering before storage.
  • C is Incorrect: Disabling memory entirely satisfies zero persistence but severely degrades user experience—customers must repeat information every session, increasing friction and potentially prolonging resolution time. The requirement only restricts PII retention beyond 30 days, not memory use itself.
  • D is Incorrect: Bypassing Bedrock AgentMemory's native controls by building custom memory with OpenSearch Serverless introduces significant operational complexity and requires manual TTL management of embeddings. Bedrock's native memory is the less complex path.

Key Takeaway: For agent memory with retention constraints, use Bedrock native memory's TTL-configured session retention rather than building custom storage layers.


Question 4 - Agent Protocol Selection for Cross-Platform Interoperability

A technology company builds an AI coding assistant using Bedrock AgentCore that must work seamlessly across multiple developer tools: Visual Studio Code, JetBrains IDEs, and a custom web-based CLI. The agent needs to receive context from these tools (file contents, cursor location) and respond with code completions and refactoring suggestions through a standardized protocol. The team wants to avoid building custom connectors for each tool.

Which protocol should the engineer standardize on for agent-tool communication? (Select ONE)

  • A) Amazon Q in Connect protocol for chat synchronization between Bedrock and the IDEs.
  • B) Model Context Protocol (MCP) exposed through the Bedrock AgentCore gateway.
  • C) An API Gateway WebSocket API with custom JSON payloads for each tool integration.
  • D) Amazon Bedrock Converse API with tool-use blocks encoded in the prompt template.
Click to reveal Answer & Explanation

Correct Answer: B

Correct Option Analysis

  • B is Correct: MCP (Model Context Protocol) is an open standard for agent-tool communication. Bedrock AgentCore natively supports MCP through its gateway, allowing multiple MCP-compatible clients (VS Code, JetBrains, custom CLIs) to connect without bespoke connectors. This satisfies the cross-platform interoperability requirement with minimal effort.

Distractor Analysis

  • A is Incorrect: "Amazon Q in Connect protocol" is a fabricated feature. Amazon Q is a service, not a communication protocol standard for agents and tools.
  • C is Incorrect: Building custom WebSocket integrations with unique JSON payloads for each tool reintroduces the "custom connector" problem the team explicitly wanted to avoid. It adds ongoing maintenance overhead as tools evolve.
  • D is Incorrect: The Converse API is the Bedrock invocation interface for foundation models, not a protocol for managing bidirectional context exchange between agents and multiple external tools. Embedding tool-use instructions in prompt templates is fragile and not a standardized agent protocol.

Key Takeaway: MCP is the open standard for agent-tool communication; Bedrock AgentCore's MCP gateway eliminates per-tool connector development.


Question 5 - Agent with Knowledge Base Retrieval Configuration

A legal technology firm deploys a Bedrock Agent with an attached Bedrock Knowledge Base to answer questions about case law and internal legal memos. Users report two issues:

  1. The agent sometimes cites outdated statutes that have been repealed.
  2. For queries like "what are the elements of negligence AND how do they apply to medical malpractice," the agent returns passages about negligence generally but misses the medical malpractice intersection.

The knowledge base uses OpenSearch Serverless with semantic search enabled. Which TWO configuration changes should address both issues? (Select TWO)

  • A) Add metadata filters on document jurisdiction and effective date to exclude repealed statutes before retrieval.
  • B) Enable hybrid search to add keyword matching on top of vector similarity for the compound query.
  • C) Enable query decomposition in Bedrock Knowledge Bases so the compound question breaks into sub-queries such as "elements of negligence" and "medical malpractice standard."
  • D) Increase the number of returned passages to 50 so more context is provided to the model.
  • E) Switch from OpenSearch Serverless to Amazon Kendra for retrieval to automatically handle query reformulation.
Click to reveal Answer & Explanation

Correct Answers: A and C

Correct Options Analysis

  • A is Correct: Metadata filters restrict the candidate set before semantic similarity is computed. Filtering on jurisdiction and effective date ensures repealed statutes are excluded from retrieval entirely, directly addressing the stale citation issue.
  • C is Correct: Query decomposition (supported in Bedrock Knowledge Bases) automatically breaks compound questions into sub-queries. Each sub-query retrieves against its own topic, improving recall for multi-part legal questions without manual query rewriting.

Distractor Analysis

  • B is Incorrect: Hybrid search adds keyword matching, which helps recover exact terms (e.g., statute numbers) but doesn't solve compound question retrieval. It also doesn't filter outdated documents—a keyword match on a repealed statute would still return it.
  • D is Incorrect: Increasing passage count from default to 50 provides more context to the model but doesn't remove stale content or improve retrieval precision. The correct passage might still appear at rank 40, and unrelated content would dominate the context window.
  • E is Incorrect: Switching to Amazon Kendra introduces a different retrieval engine, but doesn't automatically solve the specific problems of stale statutes (metadata filtering is still required) or compound questions (query decomposition configuration is still needed). It also adds unnecessary migration cost.

Key Takeaway: Use metadata filters to exclude stale/out-of-scope documents before retrieval, and use query decomposition for multi-part questions—these are independent levers that fix different retrieval failures.


Question 6 - Agent Runtime Scaling and Observability

An e-commerce company runs a Bedrock Agent that handles order status inquiries and product recommendations during Black Friday. The agent processes 10,000+ concurrent conversations at peak, calls multiple action groups (order API, product catalog API), and must maintain response latency under 3 seconds. The operations team needs centralized tracing to debug timeout failures across agent steps, tool calls, and model invocations.

Which TWO configurations address the scaling and observability requirements with the least operational overhead? (Select TWO)

  • A) Use Bedrock AgentCore's serverless runtime, which automatically scales to handle concurrent agent sessions without provisioning infrastructure.
  • B) Deploy the agent on a dedicated SageMaker real-time endpoint with auto scaling to ensure capacity during Black Friday peaks.
  • C) Enable AWS X-Ray tracing on the Bedrock agent to capture end-to-end traces across foundational model invocations, action group executions, and knowledge base queries.
  • D) Write custom CloudWatch Logs queries to correlate agent session IDs with Lambda function logs for debugging timeout issues.
  • E) Configure Provisioned Throughput for the foundational model used by the agent to guarantee model capacity during traffic spikes.
Click to reveal Answer & Explanation

Correct Answers: A and C

Correct Options Analysis

  • A is Correct: Bedrock AgentCore provides a serverless runtime that scales automatically to handle concurrent agent conversations. This eliminates capacity planning and infrastructure management during peak events, satisfying the scaling requirement with minimal overhead.
  • C is Correct: AWS X-Ray integrates natively with Bedrock Agents to provide end-to-end tracing across the entire agent execution flow—including model invocations, action group calls, and knowledge base retrievals. This gives the operations team centralized tracing for timeout debugging.

Distractor Analysis

  • B is Incorrect: Deploying the agent on a SageMaker endpoint contradicts the managed, serverless nature of Bedrock Agents. Bedrock agents aren't deployed as custom SageMaker endpoints—they run on the Bedrock service itself. This option reflects a misunderstanding of Bedrock Agent architecture.
  • D is Incorrect: Custom logging with CloudWatch Logs queries requires manual session ID correlation across multiple log groups (agent logs, Lambda logs), which is labor-intensive and error-prone. X-Ray provides automatic, centralized tracing with less operational effort.
  • E is Incorrect: Provisioned Throughput is for reserving dedicated model capacity in Bedrock. While it can help ensure consistent inference latency for the underlying foundational model, it doesn't scale the agent runtime itself or provide observability. It's also not the right lever for agent execution tracing.

Key Takeaway: Bedrock AgentCore is inherently serverless (no instance management), and X-Ray is the native tracing solution for agent execution flows.


Question 7 - Custom Model Import for Agent Backing Model

An organization builds a domain-specific agent for pharmaceutical research using a Bedrock Agent, but the agent must be powered by a customized open-weight model (Llama 3.1 70B) that was fine-tuned on proprietary clinical trial data in the company's own training environment. The model currently exists as a set of weight files in Amazon S3, in the Hugging Face safetensors format.

Which approach should the ML engineer use to make this custom model available as the agent's foundational model? (Select ONE)

  • A) Use Bedrock Custom Model Import to bring the fine-tuned model into Bedrock, then configure the agent to use the imported model ARN.
  • B) Deploy the fine-tuned model on a SageMaker endpoint with a custom container, then create a Bedrock Agent that calls the SageMaker endpoint via an action group.
  • C) Upload the model weights to Bedrock Knowledge Bases as a custom retrieval source, and configure the agent to use retrieval-augmented generation with the base Llama 3.1 model.
  • D) Convert the model weights to ONNX format, upload them to Amazon Bedrock as a "model artifact," and enable the agent's custom model invocation feature.
Click to reveal Answer & Explanation

Correct Answer: A

Correct Option Analysis

  • A is Correct: Bedrock Custom Model Import supports importing open-weight models (including Llama 3.1 architectures) from S3 in formats like Hugging Face safetensors. Once imported, the custom model becomes invocable via the standard Bedrock API and can be referenced as the agent's foundational model. This is the simplified, managed path that avoids endpoint self-management.

Distractor Analysis

  • B is Incorrect: While functionally possible, deploying a SageMaker endpoint introduces infrastructure management overhead (auto scaling, endpoint health, container maintenance). The agent would need to call the model through action groups, adding unnecessary complexity compared to Custom Model Import.
  • C is Incorrect: Bedrock Knowledge Bases store vectorized documents for retrieval—not model weights. This option conflates retrieval-augmented generation (RAG) with model deployment and would require re-training or re-hosting the model, not simply importing it.
  • D is Incorrect: There is no "model artifact" upload mechanism in Bedrock that accepts ONNX files. Additionally, "custom model invocation feature" is not a real Bedrock capability. Custom Model Import has specific format requirements; assuming arbitrary upload works reflects misunderstanding.

Key Takeaway: Bedrock Custom Model Import is the managed path to serve externally fine-tuned open-weight models through the standard Bedrock API—including as an agent's backing model.


Question 8 - Reranking for Agent Knowledge Base Precision

A financial advisory firm uses a Bedrock Agent with a Bedrock Knowledge Base to answer questions about investment products. The knowledge base contains 50,000+ documents including regulatory filings, product fact sheets, and market analysis. Users report that for queries like "what are the liquidity requirements for our money market fund during market stress," the vector search returns relevant-sounding passages about general liquidity but fails to surface the specific regulatory requirement document, even though the correct passage exists in the corpus.

The knowledge base currently returns top 10 passages using semantic search only. Which configuration change should improve retrieval precision? (Select ONE)

  • A) Enable a reranking model in Bedrock Knowledge Bases to re-score the retrieved candidates and elevate the regulatory requirement document.
  • B) Increase the number of returned passages to 50 and let the foundational model filter through the larger context window.
  • C) Switch from semantic search to hybrid search to add keyword matching for the term "liquidity requirements."
  • D) Re-embed all documents with a higher-dimensional embedding model to improve semantic discrimination.
Click to reveal Answer & Explanation

Correct Answer: A

Correct Option Analysis

  • A is Correct: Reranking is the direct fix for retrieval ordering issues. When the correct passage is retrieved (in the broader candidate set) but not ranked highly, a cross-encoder reranker re-scores each candidate against the query in a deeper semantic evaluation. Bedrock Knowledge Bases supports reranking models (e.g., Cohere Rerank, Amazon Rerank) that improve precision without changing the embedding strategy.

Distractor Analysis

  • B is Incorrect: Increasing passage count to 50 gives the model more candidates but doesn't improve ordering. The specific regulatory document might still rank at position 48 out of 50 if retrieval order is poor, and the model would struggle with a bloated context window.
  • C is Incorrect: Hybrid search helps recover exact terms (e.g., product codes, specific fund names) but the issue here is semantic relevance ordering, not keyword matching. The query "liquidity requirements during market stress" is semantically rich—hybrid search with keyword matching on "liquidity requirements" may return the same set of passages in similar order.
  • D is Incorrect: Re-embedding all 50,000 documents is costly and time-consuming (full re-indexing). While higher-dimensional embeddings can improve semantic discrimination, the root cause is most likely ranking, not embedding quality. Reranking addresses the ranking issue at a fraction of the cost.

Key Takeaway: Reranking fixes ordering of retrieved candidates; it doesn't improve recall. Do not re-embed when the issue is ranking within already-retrieved candidates.


Question 9 - Multi-Agent Orchestration with AgentCore

A logistics company wants to build an intelligent operations assistant that coordinates three distinct tasks:

  1. A routing agent that optimizes delivery routes based on real-time traffic data.
  2. A customer service agent that handles delivery status inquiries.
  3. A fleet maintenance agent that schedules vehicle servicing based on telemetry alerts.

Each agent has different tools and knowledge bases. The company wants a single orchestration layer where a supervisor agent decomposes complex requests (e.g., "why is my package delayed and when will maintenance occur on the vehicle assigned to my route?") and routes sub-tasks to the appropriate specialist agents. The solution must minimize custom orchestration code.

Which approach should the engineer implement? (Select ONE)

  • A) Use Bedrock AgentCore with multi-agent collaboration where a supervisor agent routes sub-tasks to specialist agents, each with its own action groups and knowledge bases.
  • B) Create a single monolithic agent with all tools and knowledge bases combined, relying on the foundational model to internally route queries.
  • C) Deploy three separate Bedrock Agents and build a custom Step Functions state machine to route user queries based on simple keyword matching.
  • D) Use Amazon Lex bots for intent classification and route to Lambda functions that invoke each specialist agent separately.
Click to reveal Answer & Explanation

Correct Answer: A

Correct Option Analysis

  • A is Correct: Bedrock AgentCore supports multi-agent collaboration with hierarchical orchestration. A supervisor agent can decompose complex requests and route sub-tasks to specialist agents (each with independent tools, memory, and knowledge bases) using native agent-to-agent communication. This minimizes custom code and is the managed, purpose-built solution for this pattern.

Distractor Analysis

  • B is Incorrect: A monolithic agent with all tools and knowledge bases creates a single, complex context with potential confusion over tool selection. It also doesn't isolate each domain's memory or permissions. For distinct domains with different data access needs, separation is preferable for security and clarity.
  • C is Incorrect: Building a custom Step Functions orchestration with keyword matching introduces fragile routing logic (no semantic understanding) and significant custom code. This defeats the purpose of using agent orchestration capabilities in AgentCore.
  • D is Incorrect: Amazon Lex is for conversational interfaces (chatbots), not for intelligent query decomposition and agent routing. This architecture adds unnecessary components (Lex, Lambda, Step Functions) when AgentCore's native multi-agent features handle orchestration.

Key Takeaway: Bedrock AgentCore supports native multi-agent collaboration with supervisor routing—no custom orchestration state machines needed for agent-to-agent task delegation.


Question 10 - Agent Action Group OpenAPI Schema and Validation

A retail company configures a Bedrock Agent action group for a product search tool backed by an AWS Lambda function. The Lambda expects parameters: product_category (string, enum: ["electronics","apparel","home"]), max_results (integer, 1-50), and sort_by (string, enum: ["relevance","price_low_to_high","newest"]). Users report that the agent sometimes passes invalid values like product_category: "furniture" and max_results: 100, causing the Lambda to return errors.

Which configuration change should eliminate these parameter validation errors? (Select ONE)

  • A) Define an OpenAPI schema for the action group with explicit enums, min/max constraints, and parameter descriptions so the foundational model receives accurate tool signatures.
  • B) Add error handling in the Lambda function that silently ignores invalid parameters and returns default results to avoid user-facing errors.
  • C) Include a detailed system prompt with instructions for validating parameter values before each tool call.
  • D) Wrap the Lambda with an API Gateway endpoint that includes request validation models, and route agent tool calls through the API Gateway.
Click to reveal Answer & Explanation

Correct Answer: A

Correct Option Analysis

  • A is Correct: Bedrock Agent action groups use OpenAPI schemas to define tool signatures. By specifying correct parameter types, enums, and constraints in the schema, the foundational model receives structured information about valid inputs and generates proper parameters. This is the primary method to improve tool-use accuracy in Bedrock Agents.

Distractor Analysis

  • B is Incorrect: Silently ignoring invalid parameters and returning defaults is a poor practice that masks errors and produces incorrect results (e.g., showing irrelevant products). It doesn't fix the root cause of the agent generating invalid parameters—it just hides the symptom.
  • C is Incorrect: While system prompts can improve instruction adherence, they are not reliable for enforcing structured parameter constraints. The OpenAPI schema is the correct mechanism for defining tool signatures—prompt-based instructions don't provide machine-readable validation rules.
  • D is Incorrect: Adding API Gateway with validation models introduces an unnecessary architectural layer (more cost, latency, and operational overhead). The OpenAPI schema directly configured in the Bedrock action group already serves this purpose without adding API Gateway between the agent and Lambda.

Key Takeaway: For Bedrock agent tool-use accuracy, invest in well-defined OpenAPI schemas with enums and constraints—this is the structured interface the model uses to generate correct parameter values.