AWS shows how to run Claude Code as a remote agent on Bedrock AgentCore
AWS published a post describing how to run Claude Code as a remote agent on Amazon Bedrock AgentCore instead of only on a developer’s laptop. The accompanying sample, sample-remote-coding-agent, gives each task its own AgentCore runtime session inside the customer’s AWS account and delivers the result as a GitHub pull request for human review.
How the workflow runs
A task can be submitted from Claude Code through a plugin and a local MCP server, or from a web console. Before it is queued, a Lambda function screens the prompt with an Amazon Bedrock Guardrails guardrail. The task is then recorded in DynamoDB and placed on an SQS queue, and a dispatcher starts one session on the runtime assigned to the target repository.
Each session runs in its own microVM, with isolated CPU, memory and filesystem, inside a VPC that has private endpoints to Bedrock and other AWS services. The agent obtains a GitHub token from AgentCore Identity and clones the repository. It also searches AgentCore memory for lessons from earlier tasks on that repository. Claude Opus plans the change, Claude Sonnet writes it, and the repository’s own setup and test commands verify it. Opus then reviews the result and can send it back for another attempt, up to three in total.
Finally, the agent pushes a branch named agent/<taskId> and opens a pull request. The request notes which verification command ran, what exit code it returned and how many attempts were used. If verification did not pass, the pull request is opened as a draft. The agent never merges, and AWS advises turning on branch protection for the default branch.
Security controls described
- Model access: Claude Code uses Bedrock as its only model provider, through a private endpoint and the runtime’s IAM execution role. The container holds no other AWS credentials.
- GitHub access: A GitHub App is registered with AgentCore Identity. Containers receive a user-to-server token that expires after 8 hours and is refreshed automatically. Its reach is limited to repositories that have the app installed and that the authorizing user can also access.
- Prompt screening: The guardrail uses the Standard tier and is set at low strength to block jailbreak and prompt injection attempts, misconduct, and AWS access keys and other secrets. If the guardrail cannot respond, the task is refused.
- Network and IAM: Runtimes sit in private subnets. The only internet route is a NAT gateway, and the security group allows only outbound HTTPS. The runtime role can invoke only Anthropic models on Bedrock and is denied the AgentCore Identity control plane.
Stated limits
AWS is explicit about gaps. The guardrail screens what the user types, not what the agent reads during a run, so prompt injection arriving through repository files or command output is not caught. A DNS Firewall blocks the model vendor’s domains, api.anthropic.com among them, but because it works as a denylist, other HTTPS traffic still gets through. For production, AWS suggests considering an AWS Network Firewall domain allowlist.
The sample is also not suited to every job. AWS recommends it for narrowly scoped features, bug fixes and tests in a trusted repository, and says it is a poor fit for untrusted code or open-ended work. The post lists general trade-offs of remote agents: less steering during a run, some environment setup, and cost that is harder to predict.
Setup time is stated as 15–25 minutes for the deployment, with a further 8–12 minutes to register a repository. The stack bills while idle, and the default $200 monthly Bedrock budget sends an email but does not cap spending. The sample publishes no cost estimate.
Why it matters for agents
The design shows a pattern for delegating work to agents with narrow, expiring credentials and a human approval step. Here, the pull request is the control point, and the agent has no merge rights. The documented gaps are worth noting for anyone adopting something similar: input-only prompt screening leaves indirect injection through repository content unaddressed, and a denylist-based network control is weaker than an allowlist. Teams may also want to weigh the idle costs and the three-attempt cap against their own workloads, since the post gives no cost figures. How the approach performs on real codebases is not covered in the source.
Sources
- Extend Claude Code to remote sessions on Amazon Bedrock AgentCore with security controls — aws.amazon.com
This article was prepared with AI assistance and reviewed by an Emerge Times editor before publication. Licensed CC BY 4.0: credit “Emerge Times (emergetimes.com)”. Usage & License. Featured images are AI-generated illustrations; any logos shown are trademarks of their owners, and Emerge Times is not affiliated with them.
