Agent-driven build
This track treats the sandbox as an agent’s tool environment. You can supply the intelligence from your own backend, or use the Agent Runs API when you want MIOSA to dispatch OSA, Claude Code, Codex, or another harness against a sandbox or computer target.
For the managed runner path, see Agent Runs and Agent Run Groups. To try a harness from the terminal first, follow Quickstart, step 3.
Pick a harness
A harness is the coding agent that MIOSA runs inside the sandbox.
You pick it with the runner field.
The agent uses your own model account, never MIOSA credits.
| Agent | runner | Connect your account |
|---|---|---|
| OSA | osa | Connect your model key in the console, under Agents. |
| Claude Code | claude-code | miosa connections add models claude (your plan) or anthropic (your key). |
| Codex | codex | miosa connections add models chatgpt (your plan) or openai (your key). |
| OpenCode | opencode | Console, under Agents. |
| Kimi Code | kimi | Console, under Agents. |
| Pi | pi | Console, under Agents. |
| Mistral | mistral | Console, under Agents. |
| Hermes | custom | Not built in. You install it and pass your own command. |
Run one from your backend:
If the account for that harness is not connected, MIOSA refuses the run and says what to connect.
Step 1 - Create a sandbox with external attribution.
If you’re embedding MIOSA in your own product, pass your user/project IDs so you can filter resources later.
Step 2 - Give your agent an exec tool.
The pattern below shows the structure. Substitute callYourLLM with your actual model call.
Step 3 - Let the agent write files directly.
Step 4 - Start the dev server, create a preview, stream it to your user.
The share_url is safe to put in an <iframe> in your end user’s browser. It expires after the configured TTL. Your msk_* key never leaves your server.
Step 5 - Take a screenshot of a Computer (optional).
If your agent needs to verify GUI output or run browser-based tasks, use a Computer instead of (or alongside) a Sandbox.
Step 6 - Publish what the agent built.
Step 7 - Filter all sandboxes for this customer.
Step 8 - Clean up.
What you just did
| Step | What happened |
|---|---|
| External attribution | Tagged every resource with your customer’s IDs - no MIOSA accounts needed for your end users |
| Exec as agent tool | Ran arbitrary shell commands inside an isolated VM from your agent loop |
files.write | Agent wrote generated code directly to the sandbox file system |
| Share token | Minted a browser-safe URL for preview embedding - workspace key stays server-side |
| Computer screenshot | Optionally gave the agent a real desktop with a vision-accessible screen |
sandbox.deploy | Shipped the agent’s output to a permanent immutable URL |
sandboxes.list with attribution | Queried only resources belonging to one customer - cross-tenant leakage impossible |