Add claude-agent-sdk example - #21
Draft
opencolin wants to merge 2 commits into
Draft
Conversation
Anthropic's Claude Agent SDK with a Tenki microVM as its execution backend: `tools: []` disables every built-in tool, and bash/write_file/read_file are re-implemented against sandbox.exec, sandbox.writeFile, and sandbox.readFile, registered through an in-process MCP server. verify.mjs drives the tool handlers directly with no LLM and asserts a real computed value (the 30th Fibonacci number, from Python run inside the sandbox). Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Uz85xGA4zWSge1BtiDNnSN
agent.mjs printed only the final answer, which proved nothing about where the work ran. It now logs each tool_use as it happens and ends by listing fib.py inside the sandbox — the file exists in the microVM and nowhere on the host. The bash tool discarded the exit status, so a command that failed after writing to stderr read as success to the model; non-zero exits are now prefixed with `exit N`. Also documented, from a live run: a tool handler that throws is delivered to the agent as an is_error result and it recovers on its own. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Uz85xGA4zWSge1BtiDNnSN
opencolin
force-pushed
the
examples/claude-agent-sdk
branch
from
August 17, 2026 05:17
701cf1f to
e61a958
Compare
This was referenced Aug 17, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Anthropic's own agent SDK was the one missing from the Agent frameworks table, beside Vercel AI SDK / LangChain / CrewAI / OpenAI Agents / LlamaIndex / smolagents. This adds it with Tenki as the execution backend.
The integration is
tools: []plus an in-process MCP server. Disabling every built-in tool is the point: left on, the SDK's Bash/Read/Write/Edit run on the machine that calledquery(), and the sandbox tools would be one option among several. With them off,bash,write_file, andread_fileroute tosandbox.exec,sandbox.writeFile, andsandbox.readFile, and the agent's entire execution surface is a microVM.API checked against the installed
@anthropic-ai/claude-agent-sdk@0.3.233typings rather than guessed —tool(name, description, rawZodShape, handler)takes a bare shape (notz.object({...})),createSdkMcpServer({ name, version, tools })returns an in-process server, and its tools are still namespacedmcp__tenki__*forallowedTools.Verification
Ran
node verify.mjslocally against the live API:Exit code 0. It builds the real SDK tool definitions against a live sandbox and calls their handlers directly, no LLM:
write_filereturnswrote fib.py,bashrunspython3 fib.pyin the VM and returns exactly832040,read_fileround-trips the script. Real computed values, no truthiness checks.agent.mjsalso ran end to end on Node 24, with a live model turn:The agent reached the answer only through the Tenki-backed tools — it had no local ones — and the final
lsisagent.mjsproving the artifact exists in the microVM and nowhere on the host.Behaviours measured live, not assumed
is_errortool result. Drove an agent at a missing path: it saw[not_found] read file failed: ... no such file or directory, reported it, and recovered — soread_fileneeds no try/catch.bashnow prefixesexit Non non-zero.Sequencing
Based on
examples/claude-code-sandbox(#20) rather thanmain, since both PRs add a row to the root README table. Rebased on it again after that PR's latest commit; GitHub will retarget this tomainwhen #20 merges. Review the two commits as one stack, or #20 first.Adds one row to Agent frameworks; touches nothing else outside
examples/claude-agent-sdk/.