iii-sandbox
できること
このスキルは、短命で隔離された仮想マシンでコードを実行します。そのため、出所不明のコードがメインのシステムに触れることはありません。自分で書いていないコードを実行する AI エージェントやツールを作る開発者向けです。
使う場面
- ✓エージェントが、完全には信頼していないコードを実行する必要があるとき。
- ✓破棄される清潔な環境で、スニペットをテストしたいとき。
- ✓一つの隔離されたサンドボックスの中で、複数のコマンドやファイルの編集が必要なとき。
スキルのリンク
https://github.com/iii-hq/iii/blob/main/crates/iii-worker/src/sandbox_daemon/skills/SKILL.mdコピーしてAI(Claude、ChatGPT、Cursor)に貼り付け、指示に従うよう頼んでください。
使い方
いちばん簡単な方法:メッセージをコピーしてAIに貼り付けるだけ。AIがスキルを読んで指示に従います。
貼り付け用メッセージ
Claude Code、Codex、Cursorの場合:プロジェクトのフォルダで実行するとスキルがインストールされます。
SKILL.mdをダウンロードして、エージェントのスキル用フォルダに入れてください。
AIへの頼み方の例
“この信頼できない Python のスニペットを隔離されたサンドボックスで実行し、出力を見せてください。”
毎週5つの新しいスキル。1分で読めます。
仕組み
スキルは、小さな仮想マシンを起動し、その中でコードまたはコマンドを実行して、出力を返します。複数のステップの作業では、サンドボックスは呼び出しの間ずっと起動したままになり、その後停止して、一時ファイルは破棄されます。
技術的な内容(元のSKILL.md)
作者による元のテキスト(英語)をGitHubからそのまま表示しています。
iii-sandbox
The iii-sandbox worker boots ephemeral libkrun microVMs and runs code inside them, isolated from the host. Each sandbox boots in a few hundred milliseconds, runs commands or file operations scoped to the engine it lives on, and is reaped when idle; the overlay filesystem is discarded on stop. Its sandbox::* functions are called like any other iii function.
There are two ways in. sandbox::run is the fast path: it boots a VM, runs a code snippet, captures stdout/stderr, and tears the VM down in a single call. For multi-step work — several commands, multiple files, or inspecting a VM between steps — use the sandbox::create → sandbox::exec / sandbox::fs::* → sandbox::stop lifecycle and carry the returned sandbox id across calls.
Prerequisites: enable iii-sandbox under engine.workers (or the five-worker allowlist of a
directly supervised engine), and provide hardware virtualization (Apple Silicon, or /dev/kvm on
Linux). Intel Macs and Windows cannot boot sandboxes.
Get the contract from the engine
This page tells you WHEN and HOW to use the sandbox; the engine is the source of truth for every function's exact arguments and responses. Before you call any sandbox::* function, fetch its contract and build your payload from that — do not guess field names, types, or formats from memory:
engine::functions::info { function_id: "sandbox::<fn>" }
(e.g. { function_id: "sandbox::fs::write" }). The returned schema is authoritative; this skill never restates it.
Running an iii worker inside a sandbox
To author an iii worker (read the iii skill first), you write the worker code into the sandbox, install its deps, and run it as a process there — but the worker must still join the HOST engine bus to be useful.
- Reaching the host engine: enable networking when you create the sandbox (the field is in the
sandbox::createcontract — fetch it), AND set the worker's engine-URL env (III_ENGINE_URL, e.g.ws://localhost:49134) IN THEsandbox::createenv— NOT later at exec/run time. The localhost→host rewrite happens ONLY for the create-timeenv: alocalhost/127.0.0.1engine URL set there is rewritten to the per-sandbox gateway so the worker reaches the host bus. The samelocalhostURL passed atsandbox::exectime is NOT rewritten — it points at the sandbox's own loopback, the worker silently fails to connect, and you will waste turns debugging TCP. So: put the engine URL in the createenv; the worker process inherits it already rewritten. - Run it backgrounded, never as a foreground
exec: starting the worker withsandbox::exec "node index.mjs"blocks and times out (S200 exec timed out), because the process never returns. Launch it detached (… &,nohup, orsandbox::runshell mode) so the exec call returns while the worker keeps running — see the serialized-exec boundary below. - Find the result: once the worker connects, its functions appear in
engine::functions::listand anyhttptrigger it binds is served by the Composehttpworker; verify endpoints withweb::fetch, notcurl. - EPHEMERAL by nature: a worker hosted in a sandbox dies when the sandbox is stopped or reaped (the overlay is discarded). That is fine for a demo, test, or one-off. Declare a long-lived worker as a Compose
containerinstead of hosting it in a sandbox.
When to Use
- Execute untrusted or LLM-generated code without exposing the host.
- One-shot "code in, stdout out" — reach for
sandbox::run. - Spin up an ephemeral build worker, integration-test fixture, or throwaway iii worker.
- Read, write, search, or edit files inside an isolated filesystem.
Boundaries
- A sandbox is for running code and build steps, NOT for hosting a long-lived server. To expose an HTTP API or any always-on endpoint, author an iii worker and register a trigger for it (an
httptrigger is served by the Composehttpworker) — do NOT start a server process (express,http.createServer, a frameworklisten()) inside the sandbox. A server you start here is not routed by iii, is unreachable as an iii endpoint, and as a foreground process hangs the exec slot until it times out. If the task is "build an iii worker," the deliverable is registered functions plus a trigger, not a running server. - Not for long-lived services or durable state — the overlay is wiped on stop. Use a regular worker for daemons and the Compose
stateworker for persistence. - Bootable images are catalog NA
よくある質問
どのコンピューターで動きますか?
Apple Silicon の Mac、またはハードウェア仮想化を備えた Linux マシンです。Intel の Mac と Windows では、これらのサンドボックスは起動できません。
後でファイルは残りますか?
いいえ。サンドボックスが停止すると、一時的なファイルシステムは破棄されます。
関数の詳細を知る必要がありますか?
いいえ。スキルは、呼び出す前に、エンジンから各関数の正確な引数を取得します。
詳細
作者による元の説明
Ephemeral microVM sandboxes for running untrusted or agent-generated code in isolation — a one-call run path, a create/exec/stop lifecycle, and a set of filesystem operations.
repo: iii-hq/iii
人気
- GitHubのスター
- 19k
- ランキング
- #10485
- ライセンス
- —
- 更新日
- 2026/11/2
コメント
- …
このリポジトリの他のスキル
configuration
19kスキーマで検証された、名前付きの設定値の共有レジストリを設定し、ワーカーが変更を読んで反応できるよう、エージェントを支援します。
iii
19kiii のワーカーの仕組みを教えます。エージェントは、まず既に存在するものを確認し、そのあとワーカーを作ることで、機能を追加できます。
iii-observability
19kOpenTelemetry を使って、何が起きているかを見られるよう、iii エンジンにトレース、構造化ログ、メトリクス、アラートを追加するよう、エージェントを支援します。
iii-stream
19kライブのデータフィード向けの iii-stream ワーカーを説明します。このワーカーは非推奨で、今後のリリースで削除されるため、移行を計画してください。
似ているスキル
diffs
394k編集内容の実際の共有可能な差分を、手書きの要約ではなく、ビューアーのリンクや画像ファイルとして作成するようエージェントを支援します。
coding-agent
394kCodex、Claude Code、OpenCodeに大きめのコーディング作業をバックグラウンドのワーカーとして渡し、その進捗を確認するようエージェントを支援します。
gh-issues
394kGitHubのイシューを探し、取り組むものを選び、修正を含むプルリクエストを開くようエージェントを支援します。レビューコメントへの対応も含みます。