BlogResearchturno-browser
Hiding typed passwords from the agent's results
The vault kept the passwords it filled out of every result, but a password the person typed showed up in the next page snapshot. Since turno-browser 0.8.0 fields the page marks as a password or one-time code read [sensitive field] in a snapshot, the typing tools refuse to type into one, and network results keep the names of the credentials they recognize without their values.
- Author
- William Monroy
Since turno-browser 0.3.0 the vault has kept the passwords it fills out of what the agent reads. browser_login fills a username, a password and a one-time code from the OS secret store, and every result and error of the server passes through a redactor that knows those values.
That covered the passwords turno-browser typed. It did not cover the ones a person typed. Someone signs in by hand, in the agent's Chrome window or through the live view, and the agent takes its next snapshot. Playwright's snapshot lists a filled textbox with its value, the vault had never seen that value, and nothing replaced it. The password went into the model's context.
turno-browser 0.8.0 addresses that from three sides: what a snapshot shows, what the agent may type, and what the network tools return.
The snapshot masks the field
turno-browser wraps the snapshot function of every page. Right after a snapshot it reads the filled inputs of each frame, open shadow roots included, up to a fixed number per frame, and replaces the value on the line of each password or one-time code field:
/**
* An aria snapshot (`mode: "ai"`) with the value of each element in `refs` replaced by
* `SENSITIVE_MARK`: `- textbox "Password" [ref=e6]: hunter2` reads
* `- textbox "Password" [ref=e6]: [sensitive field]`, whatever the length of the value.
*/
export function maskSnapshot(text: string, refs: ReadonlySet<string>): string {
if (!refs.size || !text) return text;
return text.replace(
/^(\s*- [^\n]*?\[ref=((?:f\d+)?e\d+)\](?: \[[^\]\n]*\])*):( .*)?$/gm,
(line, head: string, ref: string, value: string | undefined) =>
refs.has(ref) && value !== undefined ? `${head}: ${SENSITIVE_MARK}` : line,
);
}The values it read join the redactor, shown as [sensitive field]. From then on they are hidden from every result (a one-time code for 10 minutes), not only the snapshot: a script that reads the field back gets the placeholder, and so does the request body that sends it when the form is submitted. The snapshot files an action writes to the workspace are masked too. After a call that took no snapshot, the fields of the tab it ended on are read before the result goes back.
A field is sensitive by what the page says about it: an input of type password, an autocomplete of current-password, new-password or one-time-code, or a name or id that reads like one (password, passcode, otp, totp, 2fa, mfa, oneTimeCode).
The typing tools do not type one
Masking the output leaves the input. A password the agent types has already passed through the model, since it came from the conversation. So browser_type, browser_fill_form and key presses that put a character into a password or one-time code field are refused:
export function sensitiveRefusal(tool: string, kind: "password" | "one-time code"): string {
return `${tool} was refused: that field takes a ${kind}, and the agent never types one. Ask the person to type it (with browser_request_human, if this server offers it), or sign in with browser_login and a vault entry for this site; a flow replay can type one passed as keychain:<item>.`;
}A browser_fill_form call with a password among its fields is refused whole, so not even the username goes in. Tab still moves the focus, and every other field is typed as before.
The same release added browser_request_human, the tool the error points to. It hands the browser to the person with a banner and an instruction, and its result says how many times they clicked and how many fields they changed, never what they typed. A flow replay types a password only when its parameter comes from the secret store (keychain:<item>) or from the replay's hidden prompt.
Network results keep names, drop values
browser_network_requests and browser_network_request show traffic, and traffic carries credentials the vault never held, such as session cookies and bearer tokens. Their output now keeps each credential's name and shows [redacted] for its value. Authorization keeps its scheme (Bearer [redacted]), Cookie and Set-Cookie keep each cookie's name, and query, form and JSON fields named like a token, a code, a session, a key, a secret or a password lose their values. Names like token_endpoint and expires_in stay, and so does the rest of the request, so the agent can still debug the page. A file saved with filename is redacted the same way.
Where a secret could show up
| Place | What happens now | Since |
|---|---|---|
| Page snapshot and its workspace file | the field reads [sensitive field] | 0.8.0 |
| A later result: script, request body, console | the value is replaced as typed and URL, form, JSON and HTML encoded (a typed one-time code for 10 minutes) | 0.3.0 for vault values, 0.8.0 for typed ones |
| The agent's typing tools | refused | 0.8.0 |
| Network tools | names kept, values [redacted] | 0.8.0 |
| A recorded flow | passwords and one-time codes are never saved | 0.4.0 |
| Live view | a page browser_login filled, or where a password or one-time code went in during a person step, is not shown until it navigates | 0.4.0 (person steps 0.8.0) |
How other tools draw the line
The comparison page summarizes each project's own docs, checked on 2026-11-19. Playwright MCP replaces the values of a secrets file in tool responses, and its docs call that a convenience, not a security feature. browser-use has sensitive_data: the model types a secret by name and the value is redacted from its output, and its docs say this is not a sandbox, since the Python the model writes can read the value. In Stagehand your own code fills credentials, and observe() returns selectors, so the values never reach the model.
What is still not covered
Redaction matches text. A value a page or a script transforms some other way, base64 or a hash or a split, is not caught. SECURITY.md says it plainly: it is a guard against accidents and an honest model, not against a model or a page set on extracting a secret. That is why browser_evaluate and browser_run_code_unsafe are refused, until the page navigates, on a page browser_login filled or where the person typed a password or one-time code during a browser_request_human step. browser_run_code_unsafe, which runs code in the server process, is also refused for any identity that has vault credentials (since 0.3.0). Outside those cases a script can still read the field. An identity policy (since 0.9.0) whose disabled list holds evaluate turns browser_evaluate off for the identity, and any policy turns browser_run_code_unsafe off.
A value the person types and submits between two agent calls, on a page that clears the field, is not seen by turno-browser; a later network result hides it only if the field is named like a credential.
A very short value, such as one box of a code split into one-digit boxes, is not replaced by value in later results. The snapshot still masks each box by its ref.
A screenshot shows what the page shows. Pages mask their own password fields, but turno-browser does not edit the image.
A field is known only by its type, autocomplete, name and id. A plain text input with none of those signals is not treated as a password, whatever its visible label says.
Card numbers and fields named like a token or a secret are kept out of recorded flows and out of the natural language model, but the agent may fill them and a snapshot shows their values.
In network output, a credential in another shape, such as a path segment or a custom body format, is not recognized.
The change is pull request 134, released in turno-browser 0.8.0 with turno-cli 0.5.3. Its tests, trimmed in 0.9.0, run in a real Chrome: the agent's typing is refused, a page script fills the fields, standing in for a person, and the snapshot, the workspace file, a script reading the field and the submitted request body are each checked for the value.