kosa8 / Integrations / Claude Code
Integration · Claude Code · Last checked: November 2026
Run Claude Code in a microVM sandbox
kosa8 agent run claude starts Claude Code in a microVM of its own on your computer. The VM sees one folder, mounted at /work; its network is closed except for the hosts the claude kit lists; and your Anthropic API key or Claude subscription token stays on your machine, in a broker that adds it to requests to api.anthropic.com. kosa8 checks each tool call Claude Code makes before it runs. kosa8 prompt runs the same kit headless for one task.
01How it works
The claude kit is built into kosa8. It boots node:22-slim with 4 vCPUs and 4096 MB, installs @anthropic-ai/claude-code 2.1.296 after checking the download against a pinned digest, and mounts the current directory at /work. The sandbox gets ANTHROPIC_BASE_URL pointing at a broker on your side and a placeholder where the key would be. The broker adds the real credential only on requests to api.anthropic.com, and refuses and logs any host the kit does not list.
Inside, a kosa8 hook checks every tool call against kosa8's rules before it runs: a download piped into a shell is refused, and a force push or a package publish waits for a person. The sandbox is removed when Claude Code exits; your folder keeps its changes.
02Steps
Install kosa8 and start its daemon. Sandboxes run on an Apple silicon Mac, an x86-64 Linux machine with KVM, or Windows 11 through WSL2 (preview).
kosa8 doctorreports anything missing.Set your credential on your computer. Use an API key, or a Claude Pro or Max subscription token from
claude setup-token. The kit usesCLAUDE_CODE_OAUTH_TOKENfirst, elseANTHROPIC_API_KEY; either way the sandbox gets a placeholder.Preview the plan.
--dry-runprints what the sandbox will see, reach and use, and starts nothing.Run Claude Code in its microVM. Options for kosa8 go before the kit name; anything after it is passed to Claude Code.
Or give it one task, headless. This runs
claude -pin a fresh sandbox, prints the output as it goes and removes the sandbox when it finishes.Approve held calls and read the log. A held call waits in a queue for you. Every brokered request, allowed or refused, and every tool call is in a hash-chained audit log.
Stop everything at once. Every running sandbox freezes with its memory and files intact.
03Settings
| Setting | In the claude kit | Change it with |
|---|---|---|
| Folder | the current directory, at /work | -w DIR |
| Network | registry.npmjs.org, statsig.anthropic.com; api.anthropic.com through the broker | --no-network denies all network access; egress_allow in your own kit |
| Credential | CLAUDE_CODE_OAUTH_TOKEN, else ANTHROPIC_API_KEY, brokered | the variable on your computer |
| Claude Code | @anthropic-ai/claude-code 2.1.296, digest-checked | your own kit |
| Image and size | node:22-slim, 4 vCPUs, 4096 MB | image, cpus, mem_mb in your own kit |
| Headless command | claude -p TASK --permission-mode bypassPermissions, with IS_SANDBOX=1 | kosa8 prompt |
| Tool-call checks | kosa8's hook on every tool call | kosa8 mcp asks, kosa8 mcp approve |
| Skills | ~/.claude/skills in the sandbox | --skill NAME (after kosa8 skill add) |
| After it exits | the sandbox is removed | --keep |
kosa8 agent init claude writes the built-in kit to ~/.kosa8/kits/claude.yaml; a kit there overrides the built-in of the same name.
04What this protects against, and what it does not
What it protects against
- Claude Code reading or changing files outside the folder you share, such as
~/.ssh,~/.awsor other projects: they are not in the VM. - Your key being read or sent elsewhere: the sandbox holds a placeholder that is worth something only at the broker.
- Requests to hosts the kit does not list: refused before they leave your computer, and logged.
- Risky tool calls such as a force push, a package publish or a
terraform destroy: held until you approve them. - A bug Claude Code triggers in the kernel: the VM has its own Linux kernel.
What it does not
- Anything in the shared folder, including
.gitand any.envfile. Commit or checkpoint first. - What Claude Code sends to the hosts it can reach, including your code sent to the model.
- Spending your key: anything in the sandbox can use the placeholder for requests the broker allows. Set a spending limit at your provider.
kosa8 limits what a hijacked agent can reach; it does not detect or prevent prompt injection. SOC 2 Type II is in progress; there is no SOC 2 report and no external penetration test yet.
05Questions
Is bypassPermissions safe inside a kosa8 microVM?
It is what the headless kit uses: kosa8 prompt runs claude -p with --permission-mode bypassPermissions, because no one is there to answer prompts. The microVM, the kit's network list and kosa8's tool-call hook are the boundary instead. The shared folder can still be changed, so commit first.
Does Claude Code get my API key?
No. The sandbox holds a placeholder, and ANTHROPIC_BASE_URL points at a broker on your computer, which adds the real key or subscription token only to requests to api.anthropic.com.
Can I use my Claude Pro or Max subscription?
Yes. Set CLAUDE_CODE_OAUTH_TOKEN on your computer, from claude setup-token. The claude kit uses it first and falls back to ANTHROPIC_API_KEY; both are brokered the same way.
Which computers can run it?
An Apple silicon Mac, an x86-64 Linux machine with KVM, or Windows 11 through WSL2 (preview). On an Intel Mac kosa8 installs as the command-line tool only and connects to a machine that runs the sandboxes.
How is this different from Claude Code's /sandbox?
/sandbox limits the Bash commands Claude Code runs, using the operating system's sandbox on your own kernel. In a kosa8 microVM, Claude Code itself, its file tools, its hooks and any MCP server it starts are all on the far side of a hypervisor, with a Linux kernel of their own.
06Get started
The reference for this page, with every option, is in the kosa8 docs: Claude Code in a microVM.
To try a kosa8 sandbox without installing anything or making an account, kosa8.com/try runs code in a fresh sandbox with no outbound network: 15 minutes of run time free per 24 hours, each run up to 60 s.
Try free with no account. Starter is free with no card; plans from $29 a month.
Last checked: November 2026 · Updated 2026-11-29