Agents in your product
A platform makes a machine for each of your users, then puts an agent or harness inside it. The agent writes files, runs commands, and opens ports. Your product shows the result: a preview URL, a terminal, or a screenshot.
One machine per user
One sandbox or computer per end user, never shared across customers.
Each machine has its own filesystem, network, and process tree. Pick sandboxes for code and previews, and computers when an agent needs a desktop or browser: Agent device selection.
A code agent gets a sandbox, and a browsing agent gets a computer. Both get their own filesystem and network.
Show the result to your user
The browser only ever sees preview URLs and scoped, expiring tokens. Mint short-lived browser tokens for previews and terminals.
To show a preview inside your product, mint a share token on the server and send only the URL to the browser:
// GET /embed-url on your backend
const share = await sandbox.previews.share(preview.id, { expiresInSec: 3600 })
return { embedUrl: share.share_url } The token is bound to that one preview and expires.
Never put an msk_* key in a browser.
Treat it like a Stripe secret key: server-only, rotated on a schedule, audited.
Always display the returned public_url instead of building hostnames yourself.