Skip to content

feat(self_hosted_sandboxes): add AgentCore Runtime variant#689

Open
didhd wants to merge 1 commit into
anthropics:mainfrom
didhd:sanghwa/agentcore-self-hosted-sandbox-ga
Open

feat(self_hosted_sandboxes): add AgentCore Runtime variant#689
didhd wants to merge 1 commit into
anthropics:mainfrom
didhd:sanghwa/agentcore-self-hosted-sandbox-ga

Conversation

@didhd

@didhd didhd commented Jun 6, 2026

Copy link
Copy Markdown

Summary

Adds agentcore/, an AWS Bedrock AgentCore Runtime variant of the self-hosted sandbox demo. Same ant beta:worker run entrypoint as the existing docker/ variant; each per-session container is replaced by an AgentCore Runtime microVM addressed by session affinity (runtimeSessionId == ANTHROPIC_SESSION_ID).

The host runs ant beta:worker poll and forwards each work item to AgentCore via boto3.invoke_agent_runtime. Inside the microVM, server.py (@app.entrypoint) spawns ant beta:worker run to attach to that one session's SSE and run bash/read/write/edit/glob/grep tools in /workspace. No org API key reaches the runner — only the environment key is passed in the invoke payload.

Operator TUI — GA Interactive Shells

Unlike the other compute variants, this one offers an operator surface into the live per-session microVM:

  • tui_exec.py — one-shot InvokeAgentRuntimeCommand (HTTP stream).
  • tui_shell.py — interactive PTY via the GA InvokeAgentRuntimeCommandShell API (launched 2026-06-05), using the official bedrock-agentcore SDK AgentCoreRuntimeClient.open_shell(). Supports --shell-id reconnect (server replays up to 256 KB) and SIGWINCH resize.

Interactive shells require a runtime created/updated on or after 2026-06-05; older runtimes must be redeployed. Documented in the variant README.

Testing

End-to-end verified on us-west-2 with claude-haiku-4-5:
poll → claim → invoke_agent_runtime → agent writes /workspace/hello/ → operator attaches via open_shell() and sees the live files. Reconnect preserves shell state (env vars/cwd). ruff check + ruff format --check pass.

Adds agentcore/, an AWS Bedrock AgentCore Runtime variant of the self-hosted sandbox demo. Same `ant beta:worker run` entrypoint as docker/; the per-session container is replaced by an AgentCore microVM addressed by runtimeSessionId == ANTHROPIC_SESSION_ID.

Operator TUI uses the GA Interactive Shells API (2026-06-05): tui_shell.py speaks InvokeAgentRuntimeCommandShell via the bedrock-agentcore SDK open_shell(); tui_exec.py uses InvokeAgentRuntimeCommand for one-shot.

End-to-end verified on us-west-2 with claude-haiku-4-5: poll -> invoke_agent_runtime -> agent writes /workspace -> operator attaches via open_shell() and sees live files; reconnect preserves shell state.
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.

1 participant