Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions .changeset/export-import-and-remove-checks.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
"turno-browser": patch
---

Session export and import: import refuses a file whose IV is not 12 bytes or whose tag is not 16 bytes as damaged, before it derives a key, and opens the file with a 16-byte tag only, so a tag cut short no longer passes on Node 22 to 25. Any other problem while decrypting gives the one "wrong passphrase, or the file was changed" error. One `import` run derives the key once instead of twice. `export --force` writes a new file with mode 600 in place of the old one, so a replaced export no longer keeps the old file's mode, and a failed write leaves no temporary file. When the record of exports cannot be read, export keeps it as it is and says the new file is not in it (init does the same for its record of registrations). Import's help states the header check.

`remove`: more of what it cannot check is listed under `left` with `"unchecked": true` instead of being passed over: a registrations record (`agents.json`) or an exports record that cannot be read or parsed (each kept, with the state folder that holds it), a half-written copy of the vault index or a recorded export that cannot be read (kept), an identities folder that cannot be listed (a secret another identity may use is then kept), a Codex config.toml that names the server in a form it does not read, and a registration recorded in a file the agent's own command does not change. Codex servers written with dotted keys or as inline tables are now found and removed, and one whose command or args cannot be read (an array over several lines) is listed as unchecked. When a process does not stop, the final check still runs. Under `--json`, and in the lines for people, the home folder is written as `~` in `command`, `reason` and `error` too. The help states the exit codes as they are (2 also for `--json` without `--yes`; 1 also for a no and an identity that does not exist) and that on Windows a turno-browser-mcp for the id other than the background server and the one that holds the identity is listed, not stopped.

Flow recording: a named recording now reads the vault's values when it starts, as 0.14.3 said; the identity's own recording (`record.flows`) reads them before its first typed step is kept. A read of the secret store that fails (a locked store, a cancelled prompt) is no longer kept as "no values" until the recording ends: while it stands, no typed value keeps its default, and the store is asked again at the first step 30 seconds later, so a vault value typed by hand is known once the store answers. A machine without a secret store is not asked again. The docs and the `--record-screenshots` help now say what the code does: no screenshot is taken of a page a vault sign-in or a secret went into, until that page navigates away.
2 changes: 1 addition & 1 deletion SECURITY.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ is what it stores, what it trusts, and what it does not protect against.
| Master gateway token | `~/.local/state/turno/mcpd.token` | file mode 600; used by turno only, for mcpd's own endpoints; never written into an agent config |
| Per-profile gateway tokens | nowhere for Claude Code and Codex (their configs run `turno mcp headers`, which derives the token when the agent connects); `~/.local/state/turno/mcpd-tokens/<profile>.token` for Copilot CLI and Cursor CLI profiles and for agents set up by hand from `turno mcp config` | file mode 600; each one holds that profile's own token, derived from the master token |
| Browser identities | `~/.local/share/turno/browser/<identity>` | live cookies of the sites you signed into: treat as credentials. By default Chrome encrypts them with a fixed public key (`--use-mock-keychain`), so anyone who can read the folder can read them; `"keychain": "system"` in identity.json uses the OS keychain's key instead, so a copy of the folder (a backup, a synced disk) does not hand over the sessions; changing it signs the identity out, so export first and import after |
| Session exports (`turno browser export`) | the file you name, mode 600 | cookies, localStorage and IndexedDB of an identity, encrypted with your passphrase (scrypt, AES-256-GCM) and refused on import after their expiry (default 7 days); never the vault |
| Session exports (`turno-browser export`, or `turno browser export`) | the file you name, mode 600 (a file replaced with `--force` too) | cookies, localStorage and IndexedDB of an identity, and its settings (identity.json, which names secret store items but never holds them), encrypted with your passphrase (scrypt, AES-256-GCM); import refuses one past its expiry (default 7 days) and, before it derives a key, one whose header asks for other key derivation settings, IV or tag length than export writes; never the vault |
| Browser vault credentials (username, password, TOTP secret per site) | the same secret store (on Windows, DPAPI-encrypted files in `%LOCALAPPDATA%\turno\secrets`), items `turno-browser/vault/<identity>/<site>` | never in a file, a log, a tool result or a snapshot; the index `<identity>.vault.json` (mode 600) holds only site names, origins and the submit policy |
| Chrome profiles for `turno open` | `~/.local/share/turno/chrome/<profile>` | the claude.ai session of each profile |
| Installed MCP servers | `~/.local/share/turno/servers/<name>/` | folders mode 700; exact versions, no install scripts unless `--allow-scripts` |
Expand Down
2 changes: 1 addition & 1 deletion apps/docs/components/browser-page/copy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -423,7 +423,7 @@ const en: BrowserCopy = {
id: "record",
state: "default",
title: "Recordings",
text: "Every session's actions saved as a flow, and a screenshot after each action, under a 200MB cap and never of a page that shows a vault value. Playwright traces are opt in: while tracing, Chrome loads no image or frame of another site.",
text: "Every session's actions saved as a flow, and a screenshot after each action, under a 200MB cap and none of a page a vault sign-in or a secret went into, until it navigates. Playwright traces are opt in: while tracing, Chrome loads no image or frame of another site.",
run: CMD.record,
more: { text: "Recordings and traces", href: `${DOCS}/flows#recordings-and-traces` },
},
Expand Down
9 changes: 6 additions & 3 deletions apps/docs/content/docs/browser/flows.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,12 @@ A refusal costs the agent one look at the page; a wrong element costs a wrong ac
Text typed into a field becomes a parameter, with what was typed as its default. A sensitive one
keeps no value: a password field, a one-time code or card field, a field named like `password`,
`otp`, `pin`, `token` or `cardnumber`, a vault value typed by hand, or any parameter the agent
lists in `sensitive` when it stops. The vault's values are read before the first typed step is
kept and held in memory only; a vault user name counts as the whole typed value (case aside), a
vault password also inside other text when it has at least 4 characters. A vault user name typed
lists in `sensitive` when it stops. The vault's values are read when a named recording starts
(the identity's own recording reads them before its first typed step is kept) and held in
memory only. When the secret store cannot be read, no typed value keeps its default, and the
store is asked again 30 seconds later, at the next step. A vault user name counts as the whole
typed value (case aside), a vault password also inside other text when it has at least 4
characters. A vault user name typed
outside a sign-in only loses its default. A vault sign-in is a `browser_login` step with the site
name only. A `browser_navigate` step keeps its address without query string or fragment (they
can carry tokens).
Expand Down
2 changes: 1 addition & 1 deletion apps/docs/content/docs/browser/identities.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ Every feature has a default that turno works out when Chrome starts, from what i
| [Live view](/docs/browser/live-view) | on | every server with an identity; it opens only when you ask |
| [Side panel](/docs/browser/live-view#the-side-panel-in-the-agents-window) | on | a Chrome with a window that turno starts, with the live view on; not headless, in attach mode or with another engine |
| [Flows](/docs/browser/flows) | recorded | always |
| [Screenshots](/docs/browser/flows#recordings-and-traces) | after each action, under a disk cap | never of a page that shows a vault value; not in attach or read mode |
| [Screenshots](/docs/browser/flows#recordings-and-traces) | after each action, under a disk cap | none of a page a vault sign-in or a secret went into, until it navigates away; not in attach or read mode |
| [Traces](/docs/browser/flows#recordings-and-traces) | off (not yet available: while tracing, Chrome loads no image or frame of another site) | `--record-traces true` turns them on |
| `vision`, `pdf`, `devtools`, `network` tools | listed | `devtools` not in attach mode or with `record.traces: true`; `network` not in attach mode or when the policy turns it off |
| [`storage` tools](/docs/browser/vault#cookies-and-stored-tokens) | listed, session values masked | not in attach mode or when the policy turns it off |
Expand Down
2 changes: 1 addition & 1 deletion apps/docs/content/docs/browser/moving-a-session.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ turno-browser export school --out school.session --expires 2d
turno-browser import school.session --as school-laptop
```

The export holds the identity's cookies, localStorage and IndexedDB, and its settings (identity.json), encrypted with a passphrase of 12 characters or more that you type (asked twice, and asked again when it is too short or the two differ), or the first line of stdin. It is refused after its expiry (7 days by default, at most 90). It never holds vault credentials. Importing into an identity that exists replaces its session and settings, so turno asks first (or needs `--yes`). The file's key derivation settings are part of what is checked: import takes the scrypt parameters export writes (`r` 8, `p` 1, `N` at most 2^17, about 128 MiB of memory) and refuses a file that asks for more before it derives a key.
The export holds the identity's cookies, localStorage and IndexedDB, and its settings (identity.json), encrypted with a passphrase of 12 characters or more that you type (asked twice, and asked again when it is too short or the two differ), or the first line of stdin. It is refused after its expiry (7 days by default, at most 90). It never holds vault credentials. Importing into an identity that exists replaces its session and settings, so turno asks first (or needs `--yes`). The file's header is part of what is checked: import takes the scrypt parameters `r` 8 and `p` 1 as export writes them, `N` a power of 2 up to export's 2^17 (about 128 MiB of memory), a 12-byte IV and a 16-byte tag, and refuses any other header before it derives a key.

Import restores the settings (locale, languages, region, time zone, humanize level, resources, sharing and the rest) and keeps the importing identity's own creation date. Before anything changes, it lists each setting it changes with the old and the new value, and what it leaves out and why; `--dry-run` shows the same list. It leaves out what belongs to the machine and keeps this identity's value of each: `browser` (a path, or a browser installed on the other machine), `attach` (a Chrome running there), `keychain` (each machine's secret store), and an `engine` other than `chrome` (the session is a Chrome profile). It also leaves out a setting that uses secret store items (`keychain:<item>` references, such as a proxy password or a model key), since the export never holds them: store them on the new machine, then set it again. A value this release does not accept is left out alone. The identity keeps its own `policy` unless you pass `--take-policy`, and an export without a policy never removes it. A change to `lastClick`, `proxy`, `act`, `live`, `record`, `policy` or `sharing`, or `sidePanel` or `notify` set to `false` or `cursor` to `"off"`, sends data elsewhere, lets the agent do more or shows you less of what it does, so turno shows those values whole, with the same warnings as `set`, and asks first (or needs `--yes`) even for a new identity. An export made by an older release holds no settings; it still imports, and the identity keeps its own. The settings apply from the next start of the identity's server.

Expand Down
5 changes: 4 additions & 1 deletion apps/docs/content/docs/browser/policy.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,9 @@ A `browser_batch` is checked as a whole before any of its steps runs, and before

## What a policy does not cover

- **An agent that can write files, with a shell or a file-editing tool,** can change `identity.json` (by hand, or with `turno-browser set` from a shell) like any program of yours. The policy binds the MCP server; give such an agent no shell and no write access to turno's config folder, or run it as another user.
- **An agent that can write files, with a shell or a file-editing tool,** can change `identity.json` (by hand, or with `turno-browser set` from a shell) like any program of yours. The policy binds the MCP server. Give such an agent no shell and no write access to what decides how the server starts, or run it as another user:
- turno's data folder, which holds `identity.json` (`~/.local/share/turno/browser/identities/<id>.json`, on Windows `%LOCALAPPDATA%\turno\data\browser\identities\<id>.json`);
- turno's config folder, whose `mcp.toml` starts the server when turno runs it (`~/.config/turno/`, on Windows `%APPDATA%\turno\`);
- the agent's own MCP config, whose entry starts the server and can set `TURNO_DATA_DIR` to another data folder.
- **Signing in by hand** (`turno-browser login`) opens the profile for you, without the policy.
- **An older turno-browser** refuses an `identity.json` with a policy (format 13) instead of ignoring it.
32 changes: 22 additions & 10 deletions apps/docs/content/docs/browser/reference/cli.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -270,8 +270,9 @@ What turno-browser records for this identity (turno-browser record):
--record-traces <bool> a Playwright trace of each browser session (turno-browser traces);
off by default: while tracing, Chrome loads no image or
frame of another site
--record-screenshots <bool> a screenshot after each action (on by default, never of a
page that shows a vault value; not with attach or Lightpanda)
--record-screenshots <bool> a screenshot after each action (on by default; none of a page
a vault sign-in or a secret went into, until it navigates; not
with attach or Lightpanda)
--record-max-size <size> cap of the traces and screenshots, "10MB" to "10GB" (default 200MB)
Vault sign-ins and passwords never reach a flow, a trace or a screenshot.

Expand Down Expand Up @@ -370,23 +371,30 @@ Usage:

Deletes everything turno-browser keeps for the identity, after it shows the list and asks:
- it stops the identity's background server, a Chrome on its profile and the
turno-browser-mcp processes started for it (nothing is deleted while one still runs)
turno-browser-mcp processes started for it (nothing is deleted while one still runs); on
Windows, where it cannot read a process's environment, a turno-browser-mcp for the id other
than the background server and the one that holds the identity is listed, not stopped
- it takes the identity's MCP server out of each agent that has it, with the agent's own
command (claude mcp remove --scope user browser-<id>, codex mcp remove ...)
- it deletes the vault's credentials and the keychain: items identity.json references from
the secret store, unless another identity or turno's mcp.toml uses them too
- it deletes the profile, identity.json, the vault index, the state folder, saved flows and
the session exports it wrote

--yes deletes without asking; without a terminal it is required. --dry-run shows the list.
Afterwards it checks that nothing is left. Exit codes: 0 all gone, 1 something is left (--json
lists it under left, with the step that removes it), 2 no terminal and no --yes.
--yes deletes without asking; it is required without a terminal and with --json. --dry-run
shows the list. Afterwards it checks that nothing is left. Exit codes: 0 all gone; 1 something
is left (--json lists it under left, with the step that removes it), the answer was no, or the
identity does not exist; 2 no --yes without a terminal or with --json.

What it cannot check counts as left, with "unchecked": true under --json: an agent config file
it cannot read or parse, a registration in a file the agent's command does not change, an
unreadable identity.json or vault index (kept, as they name the secret store items), a secret
another identity's identity.json or turno's mcp.toml may use when that file cannot be read
(kept), and a turno-browser-mcp for the id whose environment cannot be read. Its limits: vault credentials are
it cannot read or parse, or a Codex config.toml that names the server in a form it does not
read; a registration in a file the agent's command does not change; a file that names what
else to remove and cannot be read (identity.json, the vault index or a half-written copy of it,
and the records of agent registrations and session exports, kept with the state folder); an
identities folder it cannot list; a recorded session export it cannot read (kept); a secret
another identity or turno's mcp.toml may use when its file cannot be read or the identities
folder cannot be listed (kept); and a turno-browser-mcp for the id whose environment cannot be
read. Its limits: vault credentials are
found by the sites the vault index names (the secret store has no listing by prefix), and
session exports by the record kept since 0.9.0 (one made before, or moved since, is not found).

Expand Down Expand Up @@ -596,6 +604,10 @@ lets the agent do more or shows you less of it (lastClick, proxy, act, live, rec
sharing, and sidePanel or notify false, cursor off), even for a new identity; those values are
shown whole.

Before it derives the key from the passphrase it checks the file's header: scrypt r 8 and p 1,
as export writes them, N a power of 2 up to export's 2^17, a 12-byte IV and a 16-byte tag. A
file that asks for anything else is refused as damaged.

Examples:
$ turno-browser import school.session --as school-laptop
```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ Cookies and stored tokens the agent reads through the storage tools never leave:

## What never leaves

- **Recordings**: flows, traces and screenshots stay in the identity's state folder. Flows and screenshots are on by default, under a disk cap, never of a page that shows a vault value; traces are off unless identity.json turns them on.
- **Recordings**: flows, traces and screenshots stay in the identity's state folder. Flows and screenshots are on by default, under a disk cap, and no screenshot is taken of a page a vault sign-in or a secret went into, until it navigates away; traces are off unless identity.json turns them on.
- **The reputation log**: challenges and captcha attempts are written locally, with the host name, never a token or a key.
- **Session exports**: `turno-browser export` writes an encrypted file on your disk; it goes wherever you copy it, and never holds vault credentials.
- **The live view**, on by default for a server with an identity, is served on `127.0.0.1` only, on a random port, to a browser that holds a random per-process cookie. The background server listens on a Unix socket in a folder only your user can enter, or on `127.0.0.1` with a per-server token. See [Security and privacy](/docs/security#the-browser-package).
Expand Down
Loading
Loading