Skip to content

Connect a Bitwarden vault to a session - #168

Draft
giordano-lucas wants to merge 7 commits into
mainfrom
feat/vaults-connect-bitwarden
Draft

giordano-lucas wants to merge 7 commits into
mainfrom
feat/vaults-connect-bitwarden

Conversation

@giordano-lucas

@giordano-lucas giordano-lucas commented Nov 4, 2026 •

Copy link
Copy Markdown
Member

Based on #170 (API client regeneration, which main needs to pass CI): its two commits show in this diff until #170 merges, then I rebase onto main.

Adds notte vaults connect --provider bitwarden and notte vaults disconnect. A cloud session can then fill logins from the user's Bitwarden Password Manager through Agent Access (aac). The backend is nottelabs/monorepo#5083; the commands do nothing useful until it's deployed.

Usage

notte vaults connect --provider bitwarden --session-id <id>
notte page fill 'input[name=password]' --vault-field password --session-id <id>

How vaults connect works

  1. Runs aac listen --reusable-psk in the terminal. The user unlocks the vault there (/unlock) and approves each login request.
  2. Builds the token <psk>_<listener fingerprint> from aac's own files, not its screen:
    • the first PSK in ~/.access-protocol/psk_store_user_client.json, which --reusable-psk loads; the CLI writes one when the store is empty;
    • the fingerprint from aac connections list --client-type user.
  3. Sends it to POST /sessions/{id}/vault/connection. The token is never printed.
  4. Waits until the user quits aac (Esc or Ctrl+C), then calls DELETE on the same route.

With --token (or AAC_TOKEN), the user runs the listener themselves and the command only connects. Only reusable PSK tokens are accepted: a /pair code pairs once. A hidden --aac-provider flag runs aac's demo provider (example), for trying the flow without a vault.

The routes are outside the published schema for now, so internal/api/vault_connection.go calls them by hand, as payments.go does. check-skills needs nottelabs/notte-skills#61 merged first.

Testing

  • Unit tests:

    • internal/aac: PSK store creation and reuse, aac's PSK id, refusal of invalid stores, fingerprint parsing, token shape.
    • internal/cmd: token mode, a pairing code refused, the listener run until it quits followed by a disconnect, and the listener stopped when the session refuses the connect.
    • go test -race ./... and golangci-lint pass.
    • checkcoverage -check skills passes against the skills branch.
  • Live: the built binary ran in a PTY with real aac v0.11.0 (demo provider) against a recording API:

    • It sent POST with a well-formed token from the stored PSK.
    • The monorepo backend's lookup used that token to get the github.com login after one approval.
    • Ctrl+C quit aac, and the CLI sent DELETE and exited 0.
  • Live against monorepo #5083's full-stack preview:

    • The built binary connected a cloud session with aac's demo provider.
    • A placeholder form_fill on github.com/login filled the demo login after one approval, with neither value in the responses.
    • Quitting aac disconnected the session.

Not verified with a real Bitwarden vault.

🤖 Generated with Claude Code

@greptile-apps

greptile-apps Bot commented Nov 4, 2026 •

Copy link
Copy Markdown

RetriggerView in GreptileConfidence Score: 5/5

[Critical impact] The latest changes appear safe to merge, with no new actionable issues found.

Summary

Adds Bitwarden connections for browser sessions through aac.

  • Session fills can use logins approved through a local Bitwarden listener.
  • Go callers can use generated methods for payment requests and wallet status.

Reviews (4) · Last reviewed commit: "Disconnect a session whose connect may h..." · Reviewed by Greptile

Comment thread internal/cmd/vaults_connect.go Resolved
Comment thread internal/aac/aac.go Resolved
Comment thread internal/api/vault_connection.go Resolved
Comment thread internal/cmd/vaults_connect.go Resolved
github-actions Bot and others added 2 commits November 4, 2026 01:56
GET /payments and GET /payments/connection (nottelabs/monorepo#5047) serve
the console Payments page; a CLI command for them is a follow-up.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
giordano-lucas and others added 3 commits November 4, 2026 02:05
`notte vaults connect --provider bitwarden` runs `aac listen --reusable-psk`
(Agent Access) in the terminal and connects it to the session: the session's
login fills then ask the user's Bitwarden vault, and the user approves each
request in aac. Quitting aac disconnects the session. With --token (or
AAC_TOKEN) the user runs the listener and the command only connects.
`notte vaults disconnect` disconnects it.

The token is `<psk>_<listener fingerprint>`, read from aac's reusable PSK
store (created when empty) and `aac connections list`, not from its screen.
The session routes (POST/DELETE /sessions/{id}/vault/connection) are not in
the published schema yet, so the client calls them by hand like payments.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A --token value is in argv, where other processes can read it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- A SIGTERM or SIGINT sent to notte alone is forwarded to aac, which is
  killed if it has not quit within 5 s; the session is then disconnected.
- An aac exit other than a quit the user or such a signal asked for is
  reported as an error (the session is still disconnected).
- Concurrent first connects agree on one PSK: the store is written to a
  temporary file and linked into place only if none exists, then re-read.
- The connect request never follows a redirect, which would resend the token.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@giordano-lucas giordano-lucas reopened this Nov 4, 2026
@giordano-lucas
giordano-lucas force-pushed the feat/vaults-connect-bitwarden branch from 07e8bf3 to 8d19275 Compare November 4, 2026 10:18
Comment thread internal/cmd/vaults_connect.go Resolved
When the connect fails, aac is interrupted and the main loop waits for it,
so the kill deadline and further stop signals still apply: an aac that
ignores the interrupt no longer hangs the command.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@giordano-lucas

Copy link
Copy Markdown
Member Author

@greptileai review

Comment thread internal/cmd/vaults_connect.go Resolved
A connect whose answer was lost or cut short may still have stored the
token; only an answer refusing it rules that out. The CLI now disconnects
in every other case, and says to run `notte vaults disconnect` if that
fails.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@giordano-lucas

Copy link
Copy Markdown
Member Author

@greptileai review

@giordano-lucas
giordano-lucas marked this pull request as draft November 4, 2026 18:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant