|
1 | 1 | --- |
2 | 2 | title: AI Agent Sandbox Blueprint |
3 | | -description: First-party Tangle blueprint for managed AI agent sandboxes. |
| 3 | +description: First-party Tangle blueprint for isolated AI agent sandboxes. |
4 | 4 | --- |
5 | 5 |
|
6 | 6 | # AI Agent Sandbox Blueprint |
7 | 7 |
|
8 | | -The AI Agent Sandbox blueprint defines the template for isolated agent sandbox service instances on Tangle. Operators run the sandbox runtime and sidecar containers. Users create sandboxes, trigger workflows, attach terminals, inject secrets, and inspect execution through the hosted app. |
| 8 | +AI Agent Sandbox lets a user create an isolated agent workspace through Tangle. |
| 9 | + |
| 10 | +The blueprint defines the jobs, metadata, contracts, and runtime rules. Operators run the actual sandboxes: Docker containers, Firecracker microVMs, or TEE-backed instances. The hosted app gives users terminals, workflows, files, port proxies, secrets, snapshots, and prompt/task execution. |
9 | 11 |
|
10 | 12 | Source repo: https://github.com/tangle-network/ai-agent-sandbox-blueprint |
11 | 13 |
|
12 | | -## Product Shape |
| 14 | +## What happens when a user creates a sandbox |
| 15 | + |
| 16 | +1. The user chooses a sandbox mode and requests a service instance. |
| 17 | +2. The selected operator approves the request. |
| 18 | +3. The operator starts the runtime and reports provisioning state. |
| 19 | +4. The app authenticates to the operator API with EIP-191 challenge signing and a PASETO session token. |
| 20 | +5. The user works through the hosted app: terminal, files, workflows, prompts, tasks, ports, SSH, secrets, and snapshots. |
| 21 | + |
| 22 | +The on-chain path records lifecycle and workflow commands. The operator API handles live I/O. That split is intentional: terminal output and file lists should not be blockchain jobs. |
| 23 | + |
| 24 | +## Modes |
| 25 | + |
| 26 | +| Mode | Blueprint ID in current metadata | Service shape | |
| 27 | +| ------------------ | -------------------------------- | ----------------------------------------------------------------------------- | |
| 28 | +| Cloud | `10` | A fleet-style sandbox service. Users create and delete sandboxes on demand. | |
| 29 | +| Dedicated instance | `11` | One sandbox per service instance. The operator auto-provisions it on startup. | |
| 30 | +| TEE instance | `12` | Dedicated instance with TEE attestation and sealed-secret support. | |
| 31 | + |
| 32 | +Mode IDs come from the repo metadata. Treat them as network-specific config, not hard-coded truth for every chain. |
| 33 | + |
| 34 | +## Jobs |
| 35 | + |
| 36 | +| Job | Mode | Purpose | |
| 37 | +| ------------------ | ------------------ | ---------------------------------------------------- | |
| 38 | +| `SANDBOX_CREATE` | Cloud | Create a sandbox container or runtime instance. | |
| 39 | +| `SANDBOX_DELETE` | Cloud | Delete the sandbox and clean up runtime attachments. | |
| 40 | +| `WORKFLOW_CREATE` | Cloud and instance | Register a workflow template. | |
| 41 | +| `WORKFLOW_TRIGGER` | Cloud and instance | Trigger a workflow against the service instance. | |
| 42 | +| `WORKFLOW_CANCEL` | Cloud and instance | Cancel an active workflow. | |
| 43 | + |
| 44 | +The internal workflow tick is scheduler-driven and should not be treated as a public on-chain job. |
13 | 45 |
|
14 | | -| Area | Source-backed behavior | |
15 | | -| ----------------- | --------------------------------------------------------------------------------------------------------- | |
16 | | -| Cloud mode | Multi-tenant fleet; callers create and delete sandboxes on demand through on-chain jobs. | |
17 | | -| Instance mode | One sandbox per service instance; the operator auto-provisions on startup and reports lifecycle directly. | |
18 | | -| TEE instance mode | Dedicated instance with TEE attestation and sealed secrets. | |
19 | | -| Hosted app | `https://agent-sandbox.blueprint.tangle.tools/` | |
20 | | -| Metadata identity | `publisher.namespace = "tangle"`, `requestedSlug = "ai-agent-sandbox"` | |
| 46 | +## Read and control surface |
21 | 47 |
|
22 | | -## On-Chain Jobs |
| 48 | +The operator API owns the live product state: |
23 | 49 |
|
24 | | -| ID | Job | Mode | What it does | |
25 | | -| --- | ------------------ | ------------------ | ------------------------------------------------------------ | |
26 | | -| `0` | `SANDBOX_CREATE` | Cloud | Creates a sandbox container, microVM, or TEE-backed sandbox. | |
27 | | -| `1` | `SANDBOX_DELETE` | Cloud | Deletes the sandbox and releases runtime resources. | |
28 | | -| `2` | `WORKFLOW_CREATE` | Cloud and instance | Registers a workflow template. | |
29 | | -| `3` | `WORKFLOW_TRIGGER` | Cloud and instance | Starts a registered workflow. | |
30 | | -| `4` | `WORKFLOW_CANCEL` | Cloud and instance | Cancels active workflow execution. | |
| 50 | +| API area | Examples | |
| 51 | +| ------------------ | --------------------------------------------------- | |
| 52 | +| Auth | challenge, session, revoke | |
| 53 | +| Sandbox operations | list, exec, prompt, task, stop, resume, snapshot | |
| 54 | +| Access | SSH key provision/revoke, port proxy | |
| 55 | +| Secrets | inject and wipe sandbox-scoped secrets | |
| 56 | +| Health | `/health`, `/readyz`, `/metrics` | |
| 57 | +| Capabilities | `/api/capabilities` for runtime and harness support | |
31 | 58 |
|
32 | | -`JOB_WORKFLOW_TICK` is internal cron-driven workflow progress. It is not a public on-chain job. |
| 59 | +Every data endpoint requires a signed wallet session. Production operators must set `SESSION_AUTH_SECRET`; otherwise sessions and encrypted secrets re-key on restart. |
33 | 60 |
|
34 | | -## Read Next |
| 61 | +## What to read next |
35 | 62 |
|
36 | | -| Page | Use it for | |
37 | | -| --------------------------------------------------------------------------- | ----------------------------------------------------------------------- | |
38 | | -| [Operator Requirements](/blueprints/ai-agent-sandbox/operator-requirements) | Host sizing, env vars, Docker, Firecracker, TEE, ports. | |
39 | | -| [Runtime and Harnesses](/blueprints/ai-agent-sandbox/runtime-and-harnesses) | Sidecar capabilities, harness discovery, secrets, auth, runtime safety. | |
40 | | -| [Dapp and Indexer](/blueprints/ai-agent-sandbox/dapp-and-indexer) | Metadata, iframe policy, indexed events, service state. | |
| 63 | +| Page | Use it for | |
| 64 | +| --------------------------------------------------------------------------- | ------------------------------------------------------------------- | |
| 65 | +| [Operator Requirements](/blueprints/ai-agent-sandbox/operator-requirements) | Host setup, ports, Docker, Firecracker, TEE, state, and secrets. | |
| 66 | +| [Runtime and Harnesses](/blueprints/ai-agent-sandbox/runtime-and-harnesses) | Runtime backends, capability discovery, harnesses, and AI keys. | |
| 67 | +| [Dapp and Indexer](/blueprints/ai-agent-sandbox/dapp-and-indexer) | Metadata, iframe policy, indexed state, and live health boundaries. | |
41 | 68 |
|
42 | | -## Source Material |
| 69 | +## Sources used |
43 | 70 |
|
44 | | -This page is based on the blueprint repo's `README.md`, `docs/runbook.md`, `metadata/blueprint-metadata.json`, `ai-agent-sandbox-blueprint-lib/src/lib.rs`, `sandbox-runtime/src/operator_api.rs`, and `TEE-GUIDE.md`. |
| 71 | +This page is grounded in the repo `README.md`, `docs/runbook.md`, `TEE-GUIDE.md`, `metadata/blueprint-metadata.json`, `sandbox-runtime/src/operator_api.rs`, and the sidecar image docs. |
0 commit comments