kosa8 docs Dashboard
esc
↑ ↓ move↵ openRuns in your browser; nothing you type is sent anywhere.

Guides / Agent frameworks / Claude Code

Claude Code

kosa8 agent run claude starts Claude Code in a microVM of its own on your computer, from the built-in claude kit. It sees one folder at /work, reaches only the hosts the kit lists, and holds a placeholder instead of your Anthropic credential. kosa8 prompt runs the same kit headless for one task.

How this page was checked

Against the built-in kit in kosa8's source (pkg/kit/kit.go) and the kosa8 agent run and kosa8 prompt commands, November 2026.

Run it#

$ curl -fsSL https://kosa8.com/install | sh
$ kosa8 daemon start
$ export ANTHROPIC_API_KEY=sk-ant-…          # or CLAUDE_CODE_OAUTH_TOKEN from `claude setup-token`
$ kosa8 agent run --dry-run claude          # print the plan, start nothing
$ cd ~/code/api && kosa8 agent run claude

Options for kosa8 go before the kit's name; anything after it is passed to Claude Code. The sandbox is removed when Claude Code exits, and your folder keeps what it changed.

One task, headless#

$ kosa8 prompt "add a test for parseConfig and make it pass"
$ git diff | kosa8 prompt --no-network -a claude -
$ kosa8 prompt --dry-run "upgrade the lodash dependency"

claude is the default agent (or $KOSA8_AGENT). The task is the rest of the command line, or standard input when it is -. The exit status is Claude Code's.

What the kit sets#

FieldValue
Imagenode:22-slim (Debian: Claude Code's Bash tool needs bash)
Package@anthropic-ai/claude-code 2.1.296, checked against a pinned digest
Workspacethe current directory, or -w DIR, at /work
Networkregistry.npmjs.org, statsig.anthropic.com; api.anthropic.com through the broker
CredentialsCLAUDE_CODE_OAUTH_TOKEN first, else ANTHROPIC_API_KEY; the sandbox gets ANTHROPIC_BASE_URL (the broker) and a placeholder
Headless commandclaude -p TASK --permission-mode bypassPermissions, with IS_SANDBOX=1
Hookkosa8's hook on every tool call, checked before it runs
Skills folder$HOME/.claude/skills
Size4 vCPUs, 4096 MB

Flags#

FlagWhat it does
-w, --workspace DIRThe host folder the agent may see (default: the current directory)
--no-networkDeny all network access, overriding the kit
--keepKeep the sandbox after the agent exits
--nameThe sandbox's name
--dry-runShow what would run without creating the sandbox
--skill NAMEGive the agent an imported skill (kosa8 skill add); repeatable

To change anything else, kosa8 agent init claude writes the kit to ~/.kosa8/kits/claude.yaml; a kit there overrides the built-in of the same name. See Writing a kit.

Held calls, the log, and stopping#

$ kosa8 mcp asks                # calls waiting for a person, e.g. a force push
$ kosa8 mcp approve ID
$ kosa8 audit ls
$ kosa8 audit verify
$ kosa8 sandbox pause --all     # freeze every running sandbox

See Run an AI assistant, Rules for tool calls and The audit log.

What it does not cover#

  • The shared folder: Claude Code can change anything in it, including .git and .env. Commit first.
  • What it sends to the hosts it can reach, including your code to the model.
  • The placeholder is a capability: anything in the sandbox can spend the key through the broker. Set a limit at your provider.
  • kosa8 does not detect or stop prompt injection; it limits what an injected instruction can reach.

To run Claude Code on kosa8 Cloud instead, see Claude Code in a kosa8 Cloud sandbox, or connect a local Claude Code to the cloud MCP server. The overview with FAQs is on kosa8.com: Run Claude Code in a microVM sandbox.

Something wrong or missing? Write to contact@kosa8.com.

The kosa8 newsletter

A short daily email with that day's article and one tip. Switch to weekly or unsubscribe in one click.

© 2026 kosa8 · kosa8.com · Zero Trust cybersecurity infrastructure for AI agents · Local models served by llamay · Agent gateway: MAQPNA