Skip to content

DocsGuides

Sessions

A Computer is a persistent cloud workstation, and the work on it happens in sessions. Each session has:

  • Its own browser window on the Computer's desktop.
  • Its own shell, which keeps its current directory and exported variables from one command to the next.
  • Its own working directory for files, inputs and outputs.
  • Its own agent, which remembers earlier turns in the session.

Sessions share the Computer's identity. Every session uses the same browser profile, so a site you sign in to in one session is signed in for the others too. They also share the skills the Computer has learned.

A Computer runs several sessions at once, so separate workflows can use one identity without signing in again. Sessions don't see each other's tabs or files. When you stop the Computer, its sessions end with it. A persistent Computer keeps its saved browser state and learned skills, so after it starts again you create new sessions on the same identity.

Names and labels

Every session has a name, the handle you use to find and address it. You don't need to choose one: leave it out and the Computer picks a friendly name such as brave-otter-9f3a1c, unique on that Computer. To choose your own, use up to 64 letters, digits, hyphens and underscores. A name already in use is rejected, so two sessions never collide.

Save a session's name when you create it, with its token if another request or process will run shell commands or drive its browser: only create_session returns the token. What your application saves lists the record and when it stops being valid.

A session can also carry a label, free text for the people who operate it (checkout-flow, nightly-scrape). A label is a description, not an address: it doesn't have to be unique, and the API never finds a session by it.

People and passwords

Pine's agent or your code drives a session's window. A person can watch it on the desktop, and your backend can give them control (Human in the loop). While a person holds control, the agent can't drive the session, so that is how someone types a password or an MFA code only they know. A password your application already has goes in the task's secrets: instead (Agent): the agent uses it as $NAME, and the value stays out of the model's input.

Artifact access

A session's agent uses the Computer's artifacts only if you allow it when you create the session. artifact_access is none by default; read_only lets it list and read the files, and read_write also lets it save, remove and share files.

Where to go next

  • Agent: give Pine's agent a goal, follow its events, steer it or answer its questions.
  • Skills: turn a finished workflow into a reviewed skill that later runs follow.
  • Files and shell: the working directory, files you give the agent, the files it returns, browser downloads and the shell.
  • Web SDK: show the desktop in your app and let a person take control.
  • Persistence: what survives a stop and start.
  • Tokens and scopes: the pk_, ct_, ps_ and dt_ tokens and who holds each.

The routes behind all of this are in the Computer API.

By approval Approved developers get the integration guides, the API reference and the SDKs.