Skip to content

fix(browser): check the sealed export header fully and list what remove could not check - #254

Open
william-monroy wants to merge 3 commits into
mainfrom
fix/browser-followups-2
Open

william-monroy wants to merge 3 commits into
mainfrom
fix/browser-followups-2

Conversation

@william-monroy

@william-monroy william-monroy commented Dec 3, 2026 •

Copy link
Copy Markdown
Collaborator

Session export and import

  • unseal derives the key, then creates the decipher, sets the AAD and tag and decrypts inside one try, so any decryption problem gives the one "wrong passphrase, or the file was changed" error.
  • parseEnvelope requires a 12-byte IV and a 16-byte tag, and the decipher is created with authTagLength: 16: a tag cut to 12, 8 or 4 bytes (accepted by Node 22 to 25) is refused as damaged before any key derivation.
  • One CLI import derives the key once: importSession takes the result of readSessionExport for the same text (opened, tracked in a WeakMap) and checks the expiry again; anything else is ignored and derives as before.
  • export --force writes a new mode 600 temporary file (a name of its own, removed if anything fails) and renames it over the old one, so a replaced export never keeps the old mode. "exists; pass --force" is said only without --force.
  • Export and init keep a record of exports or registrations they cannot read instead of rewriting it, and say so on stderr.
  • Import's help, the CLI references and the moving-a-session page state the header check. SECURITY.md lists the settings an export holds, the mode on --force, and the header check.

remove

  • A registration recorded in a file the agent's own command does not change is unchecked, as the help says.
  • An agents.json or exports.json that cannot be read or parsed, a half-written vault index copy or a recorded export that cannot be read, and an identities folder that cannot be listed are listed under left with unchecked. The files that name other items are kept (the records with the state folder that holds them). A secret another identity may use is kept when the identities folder cannot be listed.
  • Codex servers written with dotted keys or inline tables are found. A config.toml that names the server in a form that is not read, or whose command or args for it cannot be read (an array over several lines), is listed as unchecked.
  • When a process does not stop, the final check still runs.
  • --json and the lines for people show the home folder as ~ in command, reason and error too.
  • The help and references state the exit codes as they are (2 also for --json without --yes; 1 also for a no and an unknown identity) and that on Windows other turno-browser-mcp processes for the id are listed, not stopped. The comments at the top of destroy.ts and on RemovalPlan.left match the code.

Flow recording

  • A named recording reads the vault's values when it starts, as the 0.14.3 changelog says; the identity's own recording reads them before its first typed step is kept.
  • A failed secret store read is no longer cached as "no values" until the recording ends. It stands for 30 seconds, shared by the steps meanwhile (and the host's check in the same step), then the next step reads again. While it stands no typed value keeps its default. A machine without a secret store is not asked again.
  • The --record-screenshots help, the references, the README, the landing copy and the docs say what the code does: no screenshot of a page a vault sign-in or a secret went into, until it navigates away.

Docs

  • The policy page names the folders the policy depends on: turno's data folder (identity.json), its config folder (mcp.toml) and the agent's own MCP config.

Tests

sealed (cut tags, wrong IV lengths, no scrypt call before a refusal, a lower N with a valid tag opens), session-export (import reuses the opened export without decrypting again), cli/session (--force ends at mode 600, the export is read once), cli/remove (the new unchecked cases, Codex forms, the check after a process that does not stop), recorder (a failing store is read at most once per 30 seconds; typed values keep no default meanwhile), cli/session (stale temporary file, failed rename, unreadable record).

…ve could not check

Import refuses an IV other than 12 bytes or a tag other than 16 bytes before it derives a key,
opens the file with a 16-byte tag only, and gives one error for any other decryption problem.
One CLI import derives the key once. export --force writes a new mode 600 file in place of the
old one.

remove lists unreadable registration and export records, unreadable half-written vault copies
and recorded exports, an identities folder it cannot list and Codex servers in forms it does not
read as unchecked, and keeps what they name. It reads Codex servers written with dotted keys or
inline tables, runs the final check when a process does not stop, and shows the home folder as ~
in commands, reasons and errors. The help, the references, SECURITY.md and the policy page
state the behavior as it is.
…ing's start

A named recording reads the vault's values when it starts. A secret store read that fails is
no longer kept as no values: the step that waited on it reads again once, and so does the next
step. The docs and the --record-screenshots help say what the code does: no screenshot of a
page a vault sign-in or a secret went into, until it navigates away.
… keep unreadable records

A failed vault read stands for 30 seconds and is shared by the steps meanwhile, including the
host's check in the same step; while it stands no typed value keeps its default, and a machine
without a secret store is not asked again. A Codex server whose command or args cannot be read
is listed by remove as unchecked. export --force writes a temporary file of its own name inside
the cleanup, and reports an existing file only without --force. Export and init keep a record
they cannot read instead of rewriting it, and say so.
@william-monroy
william-monroy force-pushed the fix/browser-followups-2 branch from 62c68bb to 59cbae0 Compare December 4, 2026 01:22

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant