Skip to content

Add sandbox_harbor example: evaluate Harbor benchmarks on AgentCore Runtime - #112

Merged
Teq2412 merged 3 commits into
awslabs:mainfrom
Teq2412:add-sandbox-harbor-example
Aug 25, 2026
Merged

Add sandbox_harbor example: evaluate Harbor benchmarks on AgentCore Runtime#112
Teq2412 merged 3 commits into
awslabs:mainfrom
Teq2412:add-sandbox-harbor-example

Conversation

@Teq2412

@Teq2412 Teq2412 commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

What

Adds examples/sandbox_harbor/ — one command to evaluate a whole Harbor benchmark on AgentCore Runtime:

uv run python bench.py --benchmark tmax/TMax-15K-Harbor --task-root ./tasks \
                       --agent claude-code --model us.anthropic.claude-sonnet-4-6

One rollout per task: each task gets a fresh sandbox, the agent does the work, and the task's own shipped verifier grades it. You get a solve rate and one result record per task.

Pieces

  • harbor_sandbox/ — turns each task into a runnable sandbox: build.py packages every task image and pushes it to ECR; HarborSandboxClient creates/removes a task's runtime on demand (naming single-source-of-truth in naming.py).
  • harness/ — two interchangeable agents: strands (framework agent, bash tool = sb.exec) and claude_code (Claude Code co-located in the task box). A harness deploys once as a long-lived runtime and is reused for every task.
  • bench.py — the entrypoint: hands each task to the harness, collects results, prints the solve rate.

Runs entirely on the serverless arm64 microVM substrate (PUBLIC network).

Also

  • SandboxClient gains read_timeout / connect_timeout (default 900s read) so long, silent commands (heavy verifiers, AgentCore runtime warm-up) aren't cut off by boto3's short default. The example relies on this to give each task's verifier its full declared budget.

Notes

  • Account-specific config lives in a git-ignored .env (template committed as .env.example); nothing account-specific is committed.
  • Known terminal-bench-2 limits are tracked in examples/sandbox_harbor/TODO.md.

🤖 Generated with Claude Code

…untime

Adds examples/sandbox_harbor/ — one command to evaluate a whole Harbor benchmark on AgentCore Runtime, with two interchangeable agent harnesses (strands and co-located claude_code), a benchmark-agnostic ECR image builder, and per-task sandbox lifecycle via HarborSandboxClient.

Also adds read_timeout/connect_timeout to SandboxClient (default 900s read) so long, silent commands (heavy verifiers, runtime warm-up) aren't cut off by boto3's short default; the example relies on this.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@Teq2412
Teq2412 force-pushed the add-sandbox-harbor-example branch from a9ee166 to e279deb Compare August 21, 2026 07:28
_SDK_KEYS = ("status_code", "input_id", "s3_bucket", "result_key", "payload")


def harness_arn(agent: str) -> str:

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I realized that this is a unstable way to locate harness runtime, we should have it to be provided as a mapping from {claude-code : claude-code-arn}, will fix in next revision

Teq2412 and others added 2 commits August 22, 2026 00:34
Two blockers for training against the tmax harness (see tmax15k_handoff.md):
- build the LLM from trainer-injected _rollout (OpenAIModel, api_key session
  contract) when base_url is present; Bedrock eval path unchanged otherwise
- return plural 'rewards' alongside 'reward' (training backends read plural)
- Dockerfile: strands-agents[openai] for the OpenAI provider

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Leasing the shared per-task runtime (name = hash of image URI) breaks under
concurrent same-task rollouts (GRPO groups): the first release() deletes the
runtime out from under the siblings (InvokeAgentRuntimeCommand -> DELETING).
lease now creates sb_<code>_<hash12>_<rand8> via create(unique=True); the
shared deterministic name remains for the pool / task_runtime_arn pattern.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@Teq2412
Teq2412 merged commit 478a950 into awslabs:main Aug 25, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants