DocsStart
How a Computer works
Your application gets a real browser, a desktop, a shell and files under one Computer identity, and a person can take over when a task needs one. Your backend owns the Computer. A browser only ever gets a short-lived view of its desktop.
Terms
These are the words the guides, the SDKs and the API reference use.
| Term | What it is | How long it lasts |
|---|---|---|
| Computer | What you create and keep: its id, private keys and saved state (sign-ins, passkeys, learned skills and localStorage). It's stopped, running or paused. | Until you delete it |
| Credentials | The Computer's id and keys: all you need to start it again. | As long as the Computer |
| Start and Stop | Start runs the Computer from its saved state. Stop tries a final save of that state, then shuts the Computer down. | |
| Pause and Resume | Pause keeps the running Computer in memory, sessions included. Resume brings it back. | |
| Recover | Replaces a Computer that failed while running with a fresh start from its saved state. | |
| Computer sandbox, or Computer runtime | What a started Computer runs in, from Start until it stops. Pause keeps it; every Start or Recover gives the Computer a new one, with a new sandbox id, which the API and the SDKs call sandbox_id. |
One start |
| Binding | What your backend saves to reach the running Computer: its sandbox id, Computer token (ct_) and binding revision. |
Until the next Start or Recover |
| Session | A workspace on the Computer, with its own browser window, shell, files and Pine's agent. Its token is ps_. |
Until you close it, or the Computer stops or is recovered |
Desktop token (dt_) |
Lets a browser show a session's desktop. It's the only credential a browser ever gets. | The browser connects within 120 seconds |
Tokens and scopes covers the project key and every token.
The Computer is the identity, sessions are the work
A Computer lasts from one task to the next. Sessions let several workflows share its identity, while each keeps its own browser window, shell, files and agent. Add a session to keep work apart, and create another Computer when you need another identity.
From project key to a Computer you can come back to
- Your backend creates a Computer. The server SDK creates it with your project key. Your application stores the Computer's id and its private keys, and neither goes into browser code.
- The SDK starts it and attaches to it. Pine checks that the Computer belongs to your project, and the SDK completes the attach with short-lived credentials that work for that Computer sandbox only. Your application never builds this handshake itself.
- Sessions do the work. Create one or more named sessions on the Computer. Each has a browser window, a shell, its own files and its own agent, all under the same identity.
- Agents and people share one desktop. Your backend drives the browser and the shell through the API, while a person watches or takes control through the Web SDK. Both act on the same live session.
- Stop, save and come back. Pine saves the Computer's cookies, passkeys and learned skills as it runs, and its localStorage when you stop it. Start it again with the same identity and keys: it restores that state, and your application picks up from the progress it saved.
Credentials stay on your server
The server SDK holds them, and your frontend never receives them.
- Your server: the project key, each Computer's private keys, and the tokens for the Computer and its sessions.
- The browser: the Computer's host and a short-lived desktop token, which your
backend mints and hands to
@pinesandbox/computer-web. With them the browser can connect to that desktop. It can't create a Computer, run shell commands or get any other credential.
What you can build
- Work behind a sign-in. An agent that files expenses, updates records or downloads statements in portals that need a login. It uses the Computer's saved sign-ins and passkeys, and a person steps in for an MFA prompt or a captcha.
- Research and reports. An agent that gathers information across sites, downloads what it finds and returns a finished document, spreadsheet or deck.
- Forms and paperwork. Fill web and PDF forms from your data, and get the completed files back.
- Repeatable workflows. Do a task once, with the agent or by showing it, review the skill Pine drafts from it, and let later runs follow that skill.
- Assisted work in your product. Show the live desktop in your application so your users can watch the agent, answer its questions or take over.
The overview lists what a Computer can do, including what's coming soon.
Keep important work in the right place
Pine saves the browser state a Computer supports, so it comes back with its sign-ins and learned skills. Your application stays the home for task progress, important files and secrets: download outputs before you stop the Computer, and give each new session what it needs.
See Persistence, Sessions and the API reference.