Amazon Bedrock + Lambda MicroVMs

Autonomous vulnerability discovery that never leaves your AWS account

Run Anthropic's Defending Code reference harness with Bedrock inference inside Firecracker-isolated Lambda MicroVMs. Enterprise-grade security scanning with zero data exfiltration risk.

Running entirely on AWS may help meet data residency requirements for compliance frameworks such as SOC 2, FedRAMP, HIPAA, and PCI-DSS.

GitHub β†’ Want a managed option? Claude for Enterprise on Marketplace β†’
Why this matters

Built for security-conscious AWS customers

Many enterprises cannot send source code to external APIs due to compliance requirements. This solution keeps everything inside your AWS account boundary.

πŸ”’

Data stays in your account

Source code never leaves your VPC. Claude runs via Bedrock's inference endpoints within your region. No data sent to external APIs.

πŸ”‘

IAM-native access control

Use existing IAM roles, SCPs, and permission boundaries. No long-lived API keys to rotate. Instance roles auto-manage credentials.

πŸ“‹

CloudTrail auditability

Every model invocation logged with caller identity, timestamp, and request metadata. Complete audit trail for compliance teams.

🌐

VPC/PrivateLink compatible

Pair with VPC endpoints for Bedrock to eliminate internet egress entirely. Zero-egress architecture for maximum data isolation.

πŸ’¨

Ephemeral compute

Each scan runs in a fresh Firecracker microVM destroyed after use. No state persists. No forensic artifacts. No cleanup required.

⚑

Zero infrastructure to manage

No Docker daemons, no gVisor runtime, no proxy configuration. Deploy with CloudFormation, scan in seconds.

Use Cases

Where this fits in your security program

Pre-commit scanning

Run vulnerability scans on every PR before merge. Claude autonomously reads code, identifies memory safety issues, and crafts proof-of-concept exploits to validate findings.

Acquisition due diligence

Scan acquired codebases for vulnerabilities without exposing source to external services. Results stay within your account for internal review only.

Regulated industry compliance

Healthcare, finance, and government teams can leverage AI-powered vulnerability discovery while meeting data residency and auditability requirements.

CI/CD integration

Trigger scans from CodePipeline, GitHub Actions, or Jenkins. Lambda MicroVMs auto-scale to handle parallel scans across your codebase.

Red team augmentation

Augment your security team's manual review with autonomous multi-turn analysis. Claude explores attack surfaces, chains vulnerabilities, and reports exploitable paths.

Third-party code auditing

Audit vendor libraries and open-source dependencies in isolation. Each scan runs in its own microVM with no access to your production environment.

Architecture

How it works

The orchestrator spawns ephemeral Lambda MicroVMs with zero outbound network, calls Bedrock for model inference, and routes tool execution (bash, file I/O) into each isolated sandbox via authenticated HTTPS.

ORCHESTRATOR vuln-pipeline CLI β€” runs on EC2, local machine, or CI/CD python3 -m harness.cli run <target> --sandbox microvm --model us.anthropic.claude-sonnet-4-6 HTTPS (HTTP_INGRESS) LAMBDA MICROVM (FIRECRACKER) ISOLATED Amazon Linux 2023 Container work_server.py Target Binary + ASAN Source Code gcc + gdb + tools Receive tool calls β†’ Execute bash/read/write β†’ Return results to orchestrator HTTPS (Orchestrator-proxied) AMAZON BEDROCK Claude inference via orchestrator β€” data stays within your AWS account and region
Pipeline

Six steps to a vulnerability report

Step 1
Build Image
Target + CLI β†’ snapshot
β†’
Step 2
Run MicroVM
Boot in <3 seconds
β†’
Step 3
Tool Proxy
HTTP tool execution (zero egress)
β†’
Step 4
Agent Scans
Claude finds vulns
β†’
Step 5
Validate
PoC triggers crash
β†’
Step 6
Terminate
VM destroyed
Validated

End-to-end in 29 seconds

Claude Sonnet 4.6 running via Bedrock inside a Lambda MicroVM, autonomously discovering and validating a heap-buffer-overflow.

T+0s
MicroVM boots from Firecracker snapshot
T+3s
Work server ready (HTTP_INGRESS only, zero outbound)
T+5s
Claude reads /work/entry.c β€” identifies 3 parsers dispatched by first byte
T+12s
Identifies heap-buffer-overflow: malloc(8) + unchecked memcpy from input
T+20s
Crafts minimal PoC (11 bytes) β€” overflow by 247 bytes
T+25s
Triggers ASAN crash β€” validated 3/3 reproductions
T+29s
Reports finding, MicroVM terminated βœ“
βœ“ Vulnerability confirmed
Crash type:  heap-buffer-overflow (WRITE)
Location:    entry.c:27 β€” memcpy(out, buf + 1, claimed);
Root cause:  malloc(8) allocates 8 bytes, but 'claimed' is taken
             directly from input byte[0] (0–255) with no bounds check.
             PoC sets claimed=0xFF β†’ 255 bytes into 8-byte buffer.
ASAN:        ==190==ERROR: AddressSanitizer: heap-buffer-overflow
             at 0x502000000018 β€” WRITE of size 255
Reproduced:  3/3 (exit code 1, SIGABRT)
Comparison

Lambda MicroVM vs Docker + gVisor

Dimension Docker + gVisor Lambda MicroVM
Isolation User-space kernel (gVisor) Hardware microVM (Firecracker) stronger
Setup Install runsc, configure Docker daemon, build proxy aws cloudformation deploy simpler
Boot time Container start (~seconds) Snapshot resume (<3s) faster
Scaling Manual (--parallel on one host) Lambda auto-scales automatic
Cost EC2 instance-hours (always on) Per-invocation only pay-per-use
State leakage Possible if container reused Impossible (ephemeral) zero risk
Kernel escape gVisor user-space boundary Firecracker hypervisor hardware
Platform Linux only (gVisor requirement) Any OS (orchestrator only) portable
Get Started

Three commands to your first scan

# 1. Deploy infrastructure (one-time)
aws cloudformation deploy --template-file infra/template.yaml \
  --stack-name vuln-pipeline-microvm --capabilities CAPABILITY_IAM

# 2. Build and register MicroVM image (~2.5 min)
./scripts/build_microvm_artifact.sh canary
aws s3 cp microvm-artifacts/canary.zip s3://<bucket>/canary.zip
aws lambda-microvms create-microvm-image --name vuln-pipeline-canary \
  --base-image-arn arn:aws:lambda:<region>:aws:microvm-image:al2023-1 \
  --build-role-arn arn:aws:iam::<acct>:role/MicroVMBuildRole \
  --code-artifact '{"uri":"s3://<bucket>/canary.zip"}'

# 3. Run the vulnerability scan
CLAUDE_CODE_USE_BEDROCK=1 AWS_REGION=us-west-2 \
  python3 -m harness.cli run canary \
  --model us.anthropic.claude-sonnet-4-6 \
  --sandbox microvm \
  --microvm-image arn:aws:lambda:<region>:<acct>:microvm-image:vuln-pipeline-canary \
  --microvm-execution-role arn:aws:iam::<acct>:role/MicroVMExecutionRole
Security Model

Why prompts are not security boundaries

From Anthropic's learnings partnering with security teams: models will use whatever capabilities they actually have access to, not just what you tell them. Constraints must be enforced in code, not in prompts.

"One team told their model it had no network access β€” the model found GitHub anyway. Another team's agent answered a GitHub issue mid-scan. Neither was malicious. Both demonstrated that prompt-level instructions are insufficient when agents have real capabilities."

β€” Anthropic, Using LLMs to Secure Source Code

What Lambda MicroVMs enforce

The infrastructure enforces five properties that no prompt can guarantee:

Property Enforcement mechanism
Hypervisor isolation Each agent runs in its own Firecracker VM with a dedicated kernel. Container escape β‰  host escape.
Network isolation MicroVM sits in a private subnet with no internet route. Only the Bedrock VPC endpoint is reachable.
IAM scoping Execution role grants only bedrock:InvokeModel*. No S3, no EC2, no other AWS access from inside.
Ephemeral MicroVM destroyed after each agent completes. No state persists β€” no forensic artifacts remain.
Time-bounded Auth tokens expire in 60 minutes max. MicroVM auto-terminates on idle timeout.

The two-container trust boundary

The pipeline separates finding and grading into different MicroVMs to defeat reward-hacking:

Find Agent (MicroVM 1)

Reads source, crafts inputs, runs binary, triggers crashes

β†’
PoC bytes only
Grade Agent (MicroVM 2)

Receives only PoC bytes + source. Reproduces crash independently.

The grade agent never sees the find agent's reasoning, intermediate files, or container state.

Pipeline

The 7-stage autonomous pipeline

The key difference from static analysis: this pipeline produces execution-verified crashes β€” a concrete input that triggers a memory error 3/3 times.

Stage What happens Isolation
Recon Agent partitions the attack surface into focus areas MicroVM
Find Parallel agents craft inputs and trigger ASAN crashes MicroVM per agent
Grade Separate MicroVM reproduces each crash with only the PoC bytes Separate MicroVM
Judge No-tools agent compares crashes semantically β€” NEW, DUP_BETTER, or DUP_SKIP No code execution
Report Agent writes exploitability analysis with severity rating MicroVM
Patch Agent generates fix; grader confirms PoC no longer crashes MicroVM
Verify Builds, runs PoC, runs test suite, re-attacks patched binary (T0–T3) MicroVM
Learn More

Further reading

Anthropic Blog Post

Best practices from real engagements with security teams. The learnings that informed this pipeline's design.

Claude Security

Anthropic's managed hosted product. Multi-stage verification, lifecycle management, rapid fix generation.

Claude on AWS Marketplace

Purchase Claude for Enterprise through your existing AWS billing. No additional procurement process.

SDK Cookbook

Lightweight walkthrough of the recon β†’ find β†’ triage β†’ report β†’ patch loop using the Agent SDK.

Sandbox Variants

Choose your isolation model

Three sandbox options depending on your security requirements, AWS account access, and operational preferences.

RECOMMENDED

Lambda MicroVM (Direct)

Claude Code runs inside the MicroVM and calls Bedrock directly via CLAUDE_CODE_USE_BEDROCK=1. Simplest setup β€” no orchestrator proxy, no work server.

Firecracker isolation β€’ Auto-scaling β€’ Pay-per-use

Documentation β†’
MAX SECURITY

Lambda MicroVM (Zero-Egress)

Maximum isolation β€” MicroVM has zero outbound network. Orchestrator proxies all Bedrock calls. Source code physically cannot leave the Firecracker boundary.

Zero egress β€’ Adversarial code β€’ Compliance-ready

Documentation β†’

EC2 Ephemeral Instances

Standard EC2 instances via SSM RunCommand. No Lambda MicroVM preview access needed. Unlimited scan duration, install custom tools at boot.

Any AWS account β€’ Unlimited duration β€’ Custom tooling

Documentation β†’