Question 1 · choose 1
A software company offers a coding agent to its customers. During a conversation the agent writes files, runs commands and holds OAuth tokens for the customer's repositories, and a conversation can last up to three hours with gaps of a few minutes between messages. Security requires that no customer's files, memory or credentials can ever be reached from another customer's conversation, and the team does not want to manage servers. Which hosting approach meets these requirements?
- ACreate an Amazon EKS namespace for each customer and schedule the agent pods with network policies between namespaces
- BHost the agent on Amazon Bedrock AgentCore Runtime and give each customer conversation its own runtimeSessionId
- CRun the agent as an Amazon ECS service on AWS Fargate and keep each conversation's state in the memory of the running tasks
- DRun the agent as one AWS Lambda function and keep each conversation's files in the shared /tmp directory between invocations
Show the answer and why
ACreate an Amazon EKS namespace for each customer and schedule the agent pods with network policies between namespaces
Incorrect
Namespaces with network policies can separate tenants, but the team would operate the cluster, and isolation is per customer rather than per conversation.
BHost the agent on Amazon Bedrock AgentCore Runtime and give each customer conversation its own runtimeSessionId
Correct
Each AgentCore Runtime session runs in a dedicated microVM with isolated CPU, memory and filesystem, keeps context across invocations for up to 8 hours, and is sanitized when it ends. It is serverless.
CRun the agent as an Amazon ECS service on AWS Fargate and keep each conversation's state in the memory of the running tasks
Incorrect
Tasks in one service serve many customers at once, so in-memory state and files from different conversations share the same task, which breaks the isolation requirement.
DRun the agent as one AWS Lambda function and keep each conversation's files in the shared /tmp directory between invocations
Incorrect
Lambda is serverless, but an execution environment can be reused by different callers, so shared /tmp storage gives no per-customer isolation, and an invocation is limited to 15 minutes.
Agents differ from stateless functions: they keep state for a long time and perform privileged actions with user credentials. AgentCore Runtime gives every session its own microVM and terminates and sanitizes it at the end, which is the isolation boundary this scenario needs. The application must still map users to session IDs, because AgentCore does not enforce that mapping.
AWS documentation
- Use isolated sessions for agents (opens in a new tab)
- How AgentCore Runtime works with microVMs (opens in a new tab)
- Configure Lambda function timeout (opens in a new tab)
- Understanding the Lambda execution environment lifecycle (opens in a new tab)
- What is Amazon Bedrock AgentCore? (opens in a new tab)