key_locker
Save, list, and forget terminal credentials for SSH, sudo, and login prompts; autofill stored secrets from a secure dialog without exposing them to the assistant.
Instructions
Purpose: Manage credentials the terminal autofills for you (SSH key passphrases, sudo / login passwords). Secrets are entered once into the locker's own secure dialog and stored encrypted on this machine (Windows DPAPI, current user); these stored secrets are NEVER shown to the assistant or sent to this tool — this covers what the locker holds, not every password on the machine.
Details: action='save' pre-seeds a credential for a binding URI (ssh://user@host:22, sudo://host/root, https-cred://host:443, sshkey:SHA256:…): it opens the locker's secure entry dialog and stores the secret; the first save also shows a one-time enable confirmation. action='list' shows saved bindings (metadata only, never secrets). action='forget' deletes a binding and its secret. action='set_policy' toggles per-binding autofill confirmation. action='status' reports whether the locker is enabled (consent) and how many bindings exist. action='launch_console' opens (or reuses) an autofill-capable anchored pane and returns {paneId, windowTitle} — by default a new tab in the user's current Windows Terminal window (host:'classic' opens a dedicated classic console window instead). action='fill_once' asks the user to type a secret into the locker's dialog and types it once into the password prompt (or ssh's 'Enter passphrase for key' prompt) currently shown in a launch_console pane, then forgets it.
Prefer: Autofill is AUTOMATIC when a bound command triggers a credential prompt in the terminal — you never fill a SAVED secret by hand. For a prompt autofill does not handle (an ssh inside another ssh session, or a login the user does not want saved), send the command, then call fill_once on that pane. Autofill and fill_once ONLY work in a pane opened by launch_console (a pre-existing terminal is never autofilled): to autofill, first launch_console, then run the ssh / sudo command with terminal({action:'run'|'send', paneId}) — pass the paneId field, not the windowTitle. Keep the returned paneId; there is no pane-listing action, but launch_console with fresh:false reuses the most-recent pane and returns its paneId again. Use save to enroll, list/status to inspect.
Caveats: Windows-only. The anchored pane defaults to a Windows Terminal tab (autofill and terminal reads operate while that tab is the ACTIVE tab — switching away pauses them safely); host:'classic' opens a dedicated classic console window instead, and is the retry when Windows Terminal is not installed (KeyLockerWtUnavailable). The human can also see and type into the pane. Enabling the locker (first save or launch_console) grants BOTH credential autofill AND the ability for the assistant to launch a locker-owned pane. Disable the whole feature with DESKTOP_TOUCH_DISABLE_KEY_LOCKER=1. An ssh save needs the host key already in known_hosts (connect once first). API-token / env-var credentials are not supported yet.
Examples:
key_locker({action:'status'}) → {consentAccepted:false, disabled:false, bindingCount:0}
key_locker({action:'save', uri:'sudo://buildbox/root'}) → opens the secure dialog → {captured:true}
key_locker({action:'list'}) → {bindings:[{displayUri:'sudo://buildbox/root', scheme:'sudo', …}]}
key_locker({action:'launch_console'}) → {paneId:'wt:31264:13322426700123', windowTitle:'dtm-locker-console-…'} → then terminal({action:'send', paneId:'wt:31264:13322426700123', input:'ssh user@host'})
key_locker({action:'launch_console', host:'classic'}) → {paneId:'12345678', windowTitle:'dtm-locker-console-…'} (dedicated classic console window)
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| uri | No | A binding URI identifying the credential target — e.g. `ssh://user@host:22`, `sudo://host/root`, `https-cred://github.com:443`, `sshkey:SHA256:…` (no `//`). Parsed per the L1 grammar; malformed input is rejected. | |
| host | No | 'windows-terminal' (default) = open a new tab in the user's current Windows Terminal window. 'classic' = open a dedicated classic console window instead (the fallback when Windows Terminal is not installed — a KeyLockerWtUnavailable error tells you to retry with this). A Windows Terminal pane autofills/reads only while its tab is the ACTIVE tab; a classic console has its own window. | |
| fresh | No | false (default) = reuse the most-recent still-open anchored pane of the requested host; true = open a NEW one (bounded). | |
| action | Yes | Action selector — one of: list, save, forget, set_policy, status, launch_console, fill_once. Per-action required fields are enforced at call time (see the tool description); this flat schema lists every action's fields as optional. | |
| paneId | No | The paneId returned by launch_console (only those panes can be filled). | |
| reason | No | One short sentence the dialog shows the user as YOUR reason (e.g. 'log in to 192.168.1.20 via the jump host'). Shown as the assistant's words; never put a secret here. | |
| submit | No | true (default) = press Enter after typing the secret; false = type only. | |
| include | No | Optional response-shape opt-in. `['envelope']` returns the self-documenting envelope (`_version` / `data` / `as_of` / `confidence`). `['raw']` forces raw shape (overrides DESKTOP_TOUCH_ENVELOPE=1 server default). Default behaviour is raw shape (compat with existing clients). | |
| confirmEveryInjection | No | true (default) = confirm every autofill for this binding; false = opt out (autofill without asking). |