fix(tui): mask a vaulted answer as the user types it - #1248
Open
Gilbert09 wants to merge 1 commit into
Open
Conversation
`wizard_ask` lets a question declare itself `sensitive`. The tool then stores the answer in the session secret vault and hands the agent an opaque `secretRef`, so the raw string never enters the model's conversation. The overlay that collects it rendered it with the plain `TextInput`, so the value was echoed on screen character by character while it was typed. Every other boundary around these answers is guarded — the vault keeps them out of the conversation, the skip events carry no free text, handoff prose is kept out of telemetry — and the prompt itself was the one place the value was shown in the clear. Route a masked question to `PasswordInput` instead. `shouldMaskAnswer` is exported and unit-tested so the rule is visible rather than inlined in the switch, and it checks `kind` as well as the flag so it stays total over a question. Generated-By: PostHog Desktop Task-Id: 0af1c1f6-2aab-4807-8e24-86b2a9eb18fd
🧙 Wizard CIRun the Wizard CI and test your changes against wizard-workbench example apps by replying with a GitHub comment using one of the following commands: Test all apps:
Test all apps in a directory:
Test an individual app:
Show more apps
Test against a Context Mill branch:
Add Results will be posted here when complete. |
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.
Problem
wizard_asklets a question declare itselfsensitive. When it does, the toolstores the user's answer in the session secret vault and returns an opaque
{ secretRef }to the agent, so the raw string never enters the model'sconversation.
The overlay that collects it did not honour that. Every
kind: 'text'questionrendered through the plain
TextInput, so a vaulted answer was echoed on screencharacter by character while it was typed — the one place a credential is read
by someone other than its owner: a shared screen, a pairing session, a recorded
terminal.
It is the only unguarded boundary left around these values. The vault keeps them
out of the conversation, the orchestrator's skip events carry a closed set of
reasons rather than free text, and handoff prose is deliberately kept out of
telemetry for the same reason.
AskQuestion.sensitiveeven documented theoverlay behaviour as "the TUI may also mask input accordingly" — it never did.
Why
Found while reading the telemetry for the wizard's data-source setup task — the
flow whose credential prompt is the step users most often back out of. Masking
does not change that funnel on its own; it closes a straightforward exposure on
the prompt that collects the values.
Changes
@inkjs/ui'sPasswordInputinstead ofTextInput. Same props, same submit contract; only the rendering differs.shouldMaskAnsweris exported and unit-tested rather than inlined in theswitch, and checks
kindas well as the flag so it stays total over aquestion (the tool already rejects
sensitiveon a picker, and a picker hasnothing to type).
AskQuestion.sensitivedoc comment, which described masking asoptional.
Nothing else changes: an ordinary text question renders exactly as before.
Test plan
shouldMaskAnswerunit tests added toWizardAskScreen.test.ts(maskedtext, unmasked text, pickers).
vitest run src/ui— 306 tests pass.tsc --noEmitclean for the touched files; prettier and eslint clean.Created with PostHog Desktop