信頼できないコードを安全に実行する:使い捨てサンドボックス内の AI エージェント
エージェントがスクリプトを書いて実行し、インターネットへの接続を試みて、失敗することを報告します。実行は、後で消える microVM の中で行われます。
- シェル
- 予算の上限
実際の実行を見る
2026年10月7日 の実際の実行を再生しています。モデル: openai/gpt-6-luna。
成功run_de9af30ebaaa50ab76819bb536239c61$0.04 のうち $0.00353
- 待機中予算 $0.04 を確保
- MicroVMmicroVM ready
- MicroVMworker started · shell on · web off
- シェル
$ pwd; whoami - シェル
$ command -v curl && curl -sS -m 8 https://example.com - シェル
$ printf '%s\n' '#!/usr/bin/env python3' 'primes = []' 'n = 2' 'while len(primes) < 15:' ' if all(… - シェル
$ printf 'sandbox proof\n' > /tmp/proof.txt && ls -l /tmp/proof.txt - MicroVMmicroVM destroyed
- 成功モデル呼び出し 3 回、トークン 5,214記録された出力(英語)
- Prime script output:
2 3 5 7 11 13 17 19 23 29 31 37 41 43 47 whoami:worker;pwd:/tmp/ephemeral-run-s2TPIy/scratch- curl error:
curl: (6) Could not resolve host: example.com /tmp/proof.txtcreated;ls -l:-rw-r--r-- 1 worker worker 14 Oct 7 15:02 /tmp/proof.txt
The network call did not succeed.
- Prime script output:
- ワーカーを破棄$0.00353 を請求、$0.03647 を解放
モデル $0.00033 · Web $0.00 · コンピュート $0.0032
自分で実行する
リクエスト全体が入力された状態で、サンプルをプレイグラウンドで開きます。実行はご自身のアカウントで、表示された予算の範囲内で、同じ読み取り専用のサンプルシステムに対して行われます。
このサンプルの予算: $0.04
仕組み
Web アクセスはオフ、シェルはオンなので、エージェントはコードを実行できますが、何も外部に送れません。プロンプトでネットワーク呼び出しを試して正確な失敗内容を報告するよう求めることで、タイムライン上で分離の様子が見えます。エージェントが書いたものは、実行が終わると何も残りません。
エージェントにできること、できないこと
権限はリクエストの一部です。ここに挙げていないものは、実行では利用できません。
| 設定 | 許可 |
|---|---|
| 接続 | なし |
| Web | オフ |
| シェル | オン(隔離されたマシンの内部) |
| ファイル | なし |
| ゼロデータ保持 | オフ: 記録は 30 日間保存されます |
| 予算 | $0.04、厳格な上限 |
| タイムアウト | 120 秒 |
認証情報がマシンに入ることはありません。ブローカーが各呼び出しに認証情報を付与し、上記のメソッドだけを通します。
コード
サンプルが送信する正確なリクエストです。EPHEMERAL_API_KEY には、組織のメンバーキーを設定してください。
curl -X POST $EPHEMERAL_URL/v1/runs \
-H "Authorization: Bearer $EPHEMERAL_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: $(uuidgen)" \
-d @request.jsonリクエスト本文の全体 request.json
同じ本文を、ファイルをインラインにした形で示します。
{
"prompt": "This is a sandbox test. Do these steps with the shell and report the real output, never what you expect. 1) Write a small script that prints the first 15 prime numbers, run it and show the output. 2) Run `whoami` and `pwd`. 3) Try to reach the internet with `curl -sS -m 8 https://example.com` (and, if curl is missing, python3 with urllib) and report the exact error. 4) Write a file named /tmp/proof.txt and list it. Reply in Markdown, at most 120 words: one line per step with the result, then one sentence saying whether the network call succeeded.",
"web": false,
"shell": true,
"timeout_seconds": 120,
"max_cost_micros": 40000
}