Extend Claude Code to remote sessions on Amazon Bedrock AgentCore with security controls
The authors demonstrate how to run Claude Code as a remote, isolated agent within Amazon Bedrock AgentCore, ensuring each coding task executes in a sandboxed session inside the user’s AWS account. Every model invocation is routed through Bedrock’s managed endpoint, and the generated code is automatically packaged into a GitHub pull request for review and merge. This approach eliminates the need to host the Claude model locally while preserving strict security boundaries and providing a seamless CI/CD workflow. The key trade‑off is the added latency of remote Bedrock calls, but the isolation guarantees that code execution cannot escape the AWS VPC.
⚡ Key Takeaways
- Each coding task runs in its own isolated Bedrock AgentCore session, preventing cross‑task interference.
- Model calls are funneled through Amazon Bedrock, leveraging its managed scaling and compliance features.
- The output is delivered as a GitHub pull request, integrating directly with existing code review pipelines.
- Security controls are enforced via Bedrock’s IAM role policies, ensuring only authorized agents can invoke the Claude model.
- WhyItMatters: Engineers can now embed powerful code‑generation capabilities into production pipelines without exposing the model to local infrastructure, reducing attack surface while maintaining tight integration with GitHub workflows.
- TechnicalLevel: Advanced
- TargetAudience: ML Engineers, AI Ops
- PracticalSteps:
- Create an AgentCore skill that points to the Claude Code model via the Bedrock endpoint ARN.
- Configure the skill’s IAM role to include `bedrock:InvokeModel` and `codecommit:CreatePullRequest` permissions.
- Enable the GitHub integration in AgentCore, specifying the repository and branch for PR creation.
- ToolsMentioned: Claude Code, Amazon Bedrock AgentCore, GitHub
- Tags: AGENTS, DEPLOYMENT, LLM, AMAZON, BEDROCK, INFERENCE
🔧 Tools & Libraries
Engineers can now embed powerful code‑generation capabilities into production pipelines without exposing the model to local infrastructure, reducing attack surface while maintaining tight integration with GitHub workflows.
✅ Practical Steps
- Create an AgentCore skill that points to the Claude Code model via the Bedrock endpoint ARN.
- Configure the skill’s IAM role to include `bedrock:InvokeModel` and `codecommit:CreatePullRequest` permissions.
- Enable the GitHub integration in AgentCore, specifying the repository and branch for PR creation.
Want the full story? Read the original article.
Read on AWS ML Blog ↗