Fill a preview input from a `secretRef` (agent logins without the secret in model context) #25403
Agents in T3 sign in to websites for us (dashboards, invoice portals). The password must not enter the model's context, so today we copy it to the clipboard with a password-manager helper and let the agent press Meta+V in its preview tab. That paste lands nothing when the tab isn't the one the human is viewing: GuestInput drops copy/cut/paste for an unfocused tab on purpose (apps/desktop/src/preview/GuestInput.ts, editing commands allowlist). Good for clipboard safety, but it leaves agents no secret-safe way to fill a field in a background tab.
request_secret already keeps a value app-side and returns a one-use, project-bound secretRef (#15907, apps/server/src/secrets/SecretRequests.ts), and #15907 describes the intent that "tools that need a secret take a secretRef". Only schedule_task (signature.secretRef) accepts one today.
Proposal
preview_typeacceptssecretRefas an alternative totext(exactly one of the two). Inapps/server/src/mcp/toolkits/preview/handlers.ts(type handler), consume it likeScheduledTaskServicedoes (SecretRequests.consume({ref, projectId})) and pass the value down the existinginsertText/locator.fillpath. Background tabs already work throughwebContents.insertText, so the desktop side needs no change. Keep the value out of spans, logs, tool results and recordings (RecordingInput.tsalready masks password fields).- A way for a trusted local process to mint a
secretRefwithout a human typing it, e.g.t3 secret put --thread <id> --stdin(authenticated like othert3CLI calls) returning{secretRef}. A password-manager CLI (Bitwarden, 1Password) can then hand the value to T3 after its own approval (Touch ID), and the agent only ever sees the ref.
With 1 alone, request_secret + preview_type {secretRef} already covers "human types it once". With 1 + 2, agent logins through a password manager need no clipboard and no tab focus.
Out of scope: cross-origin iframe password fields in an unfocused tab still fail as today (GuestInput.ts focus check).
Happy to send a PR for 1 if the shape is right.
Sign in to join this conversation.