Repository navigation
fix(browser): keep no secret value as a default in taught and recorded flows - #251
Merged
Merged
Conversation
william-monroy
force-pushed
the
fix/teach-secrets
branch
2 times, most recently
from
December 3, 2026 19:49
bd1992c to
b2ab3d6
Compare
…d flows - A card number or expiry field named like one (cardnumber, card_number) counts as a card field, as one with a cc- autocomplete does. - Teach mode and flow recording read the identity's vault values when they start and hold them in memory, so a vault value typed by hand keeps no default before browser_login runs. A value under 4 characters counts only as the whole of what was typed. - A taught vault sign-in takes in the user name typed into the same form on the same page, even with other steps between or after the password. - The person's submit is dropped only when browser_login will submit: the identity policy's autoSubmit false keeps it as a step. - In the page, a text area or editable element named like a secret reports only its length, as an input does.
…at a submit - A taught vault sign-in starts only at a password or one-time code input. A vault user name typed elsewhere only loses its default. - The backward fold stops at a submit-like click or Enter in the same form, so a sign-in that asks the user name first replays as shown. - The person's submit ends the sign-in even when it stays a step, and later typing is taken in only into the fields the sign-in took in. - Locators, fingerprints and names drop vault values read at the start. - Vault user names match as the whole typed value, case aside; passwords of 4 or more characters also inside other text. - The in-page secret check reads names word by word, as the server does. - Vault values are dropped when teaching or a recording stops; the trace pause also knows them, and a recorded navigation keeps no query string.
… nothing - A button of type button or reset (a show-password toggle) is no submit: it ends no sign-in and stops no fold, and inside a sign-in that browser_login submits it is not a step. - Vault user names are kept out of locators, fingerprints and names in any case.
While a sign-in that browser_login submits is open, a click on a button that submits nothing waits. The person's own submit drops it if it is a show-password toggle and keeps it as a step after browser_login otherwise. When the sign-in ends another way (another step, a new document, the end of teach mode), the held clicks stay steps, so a page that signs in from script replays its button. Switches, boxes, tabs and cookie banner buttons are never held.
Only a new document, the end of teach mode, or a step on another page or outside the sign-in's form ends it. Steps in its form while it is open (a box checked, a choice, a key, a cookie banner's button) go before the browser_login step when it submits. Held clicks that were not the sign-in go there too; when the sign-in ends without the person's submit, only the last held click goes after browser_login. The consent pattern now needs cookie or consent wording, and a button about a forgotten or changed password is no show-password toggle.
…ithout a form Without a form, only keys and typing on the sign-in's fields, boxes checked, choices and cookie banner buttons leave it open; any other click or typing ends it, and a second button that submits nothing ends it rather than being held. A link and Escape end any sign-in, so they stay after browser_login. Enter ends a sign-in without a form only on its fields. The first user name field of the form typed after the password is taken in.
…keep it open at Escape on its fields The second-button rule now applies only to a sign-in without a form, so a plain button before a script sign-in button goes before browser_login and the last one after it. Escape on one of the sign-in's fields leaves it open; elsewhere it still ends it.
william-monroy
force-pushed
the
fix/teach-secrets
branch
from
December 3, 2026 21:11
ac24164 to
1d60270
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Teach mode and flow recording now keep no value for a few more kinds of secret input, and a taught vault sign-in replays as the person did it.
Changes
cardnumber,card_number,ccNum,card-expiry,credit_card_number) is acardfield insensitive.ts, as one with acc-autocomplete is. This covers teach mode,browser_record, the trace pause and natural language actions. The in-page check of teach mode now reads names word by word, as the server does.FlowRecorderread the identity's vault user names and passwords from the secret store before the first typed step is kept, and hold them in memory only (VaultValuesinvault.ts). They are dropped when teaching or a recording stops. A user name counts as the whole typed value, with case and spaces ignored. A password counts as the whole value, or inside other text when it has 4 or more characters. Locators, fingerprints and element names drop these values, and so does the trace pause. A recordedbrowser_navigatekeeps no query string or fragment.browser_loginwill submit (loginSubmits, where the policy's"autoSubmit": falsewins over the vault). Otherwise it stays a step.test/teach.test.tsis new and needs no browser. It covers card names, vault values, thecode-field rule, the start of a sign-in on the vault site's own origin, the fold and its stop at a submit, later typing, element names with a vault value, and the submit with and without the policy.recorder.test.tsadds the card name, vault values before login, the navigation address, and element names.sensitive.test.tsadds card names and near misses.Docs:
teach-mode.mdxandflows.mdxnow say what is kept and what is not.Checks
tsc --noEmit(browser),biome check,knip,scripts/no-em-dash.mjs,scripts/changeset-names.mjs, and the generated docs checkvitest run test/teach.test.ts test/recorder.test.ts test/sensitive.test.ts: 32 passed