1.9 KiB
Agent Computer
Source:
docs/deploy/agentcomputer.mdxCanonical URL: https://sandboxagent.dev/docs/deploy/agentcomputer Description: Run Sandbox Agent on Agent Computer managed workers.
Prerequisites
COMPUTER_API_KEYorAGENTCOMPUTER_API_KEY- An Agent Computer managed-worker image, or default machine source, that already has your coding agent authenticated
The platform image already includes Sandbox Agent, Claude Code, and Codex. Agent credentials still live inside the machine, so make sure your image or workspace bootstrap has already handled agent login.
TypeScript example
npm install sandbox-agent@0.4.x
import { SandboxAgent } from "sandbox-agent";
import { agentcomputer } from "sandbox-agent/agentcomputer";
const sdk = await SandboxAgent.start({
sandbox: agentcomputer(),
});
try {
const health = await sdk.getHealth();
console.log(health.status);
console.log(sdk.inspectorUrl);
const agents = await sdk.listAgents();
console.log(agents.agents.map((agent) => agent.id));
} finally {
await sdk.destroySandbox();
}
The agentcomputer provider creates a managed-worker computer, waits until browser access is ready, and routes SDK requests through the machine's authenticated web host. sdk.inspectorUrl is already a browser-ready URL, so it opens the built-in Inspector directly.
By default, the provider creates:
runtimeFamily: "managed-worker"usePlatformDefault: true
Pass create when you want to override the handle, workspace name, or other machine-create settings:
const sdk = await SandboxAgent.start({
sandbox: agentcomputer({
create: {
handle: "sandbox-agent-demo",
workspaceName: "sandbox-agent-demo",
usePlatformDefault: false,
},
}),
});
Set apiUrl when you are targeting a self-hosted or local Agent Computer API instead of https://api.computer.agentcomputer.ai.