Login with 1Password: connect a vault, agents fetch items when needed - #708
Open
time-attack wants to merge 2 commits into
Open
Login with 1Password: connect a vault, agents fetch items when needed#708time-attack wants to merge 2 commits into
time-attack wants to merge 2 commits into
Conversation
… needed A 1Password card on the keychain page mints the existing one-time secret-drop page for a vault-scoped service-account token (1Password's sanctioned path for agent access; no consumer OAuth exists). The token lands as a normal keychain credential, so every existing consent surface — grants, asks, standing vs once, audit, revocation — gates it unchanged. Once it is in the agent's shell, the agent fetches exactly the item a task needs at the moment of use with the op CLI; vault contents are never copied into the platform's store. The keychain manifest teaches the op-read flow whenever a 1password credential is visible, and a seeded skill carries the full guidance (install, find, read one field, hygiene). defaultEnvKey now prefixes an underscore for services whose name starts with a digit, which previously produced an invalid env-var name and made saving such a credential without an explicit envKey fail.
… is optional The one-time drop page set autocomplete=off on every field, which told the user's password manager to stand down at exactly the moment they are asked to produce a secret. Secret fields now advertise current-password and carry a field name, so a manager (1Password, browser built-ins) offers to fill. The 1Password card's copy now leads with the fact that connecting a vault is optional — the agent already asks for a credential just in time and the user pastes it once — so the card reads as the stop-asking-me upgrade, not a setup requirement.
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.
Login with 1Password
Users can now connect their 1Password from the keychain page, and agents fetch credentials out of the shared vault at the moment a task needs them — vault contents are never copied into qm's store.
1Password has no consumer OAuth for third-party sign-in; its sanctioned path for agent access is a service account scoped to a vault (their agentic-AI guidance). This PR rides that path with the machinery the keychain already has:
service: 1password,envKey: OP_SERVICE_ACCOUNT_TOKEN, with a link to 1Password's service-account setup. The token lands encrypted as a normal keychain credential; Disconnect deletes it (revoking its grants, via the existing confirm flow).OP_SERVICE_ACCOUNT_TOKENis in the agent's shell, the agent reads exactly one field at the moment of use (op read "op://vault/item/field").1passwordcredential is visible) explaining the token is vault-scoped and how to read single fields; a seeded1passwordskill carries the full guidance (installopinto$HOME, find the item, read one field, hygiene).defaultEnvKey("1password")produced1PASSWORD_TOKEN, an invalid env-var name that made saving any digit-leading service without an explicit envKey fail; it now prefixes an underscore.No new dependency, route, or storage. The vault key never enters qm's database beyond the encrypted service-account token itself, and per-item values exist only in the using shell.
Deliberately not built (upgrade path if token-level granularity proves too coarse): per-item reference credentials resolved core-side via
@1password/sdk, so the manifest could list individual vault items and the token would never reach a sandbox.Demo
Connect (drop page is the existing secret-drop form, prefilled):
Connected:
QA
test/keychain.test.ts(44 pass — manifest hint presence/absence, digit-leading envKey),plugins/web-ui/test/keychain-flow.test.ts(11 pass), root typecheck + lint, web-ui typecheck.--no-slack): drove the full flow in a browser — card → Connect → one-time page → submit token → connected card + stored1passwordcredential withOP_SERVICE_ACCOUNT_TOKEN; no console errors. (Local note: my dev instance had a stale ngrokPUBLIC_WEB_URL, so the drop link's host was rewritten to the local portal for QA; the path+token are host-independent.)Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.