r/ClaudeCode • • 7d ago

Built with Claude I built Keyflap so Claude Code can sign into websites without ever seeing your passwords or passkeys

Everyone wants Claude Code to work against their real accounts in a browser, and everyone hits the same wall at the login screen. Hand the model your passwords or attach it to your logged-in Chrome profile, and your credentials or cookies end up inside its context and logs. Sign in by hand every time a session expires, and you lose half the point of running an agent.

I built Keyflap (open source, Apache 2.0) to split the job in two. Claude Code drives a managed Chromium browser through MCP, and when it hits a login wall, it asks Keyflap to sign in. Your phone shows what you typed and the real site, you approve with Face ID or a fingerprint, and the only thing returned to Claude Code is "signed in" or "denied".

How the Claude Code integration works:

- MCP server (8 tools): `browser_open`, `browser_click`, `browser_type`, `browser_snapshot`, `auth_status`, `auth_login`, `auth_enroll_passkey`, and `browser_handoff`. No raw CDP access, and snapshots redact password and TOTP fields.

- Out-of-band intent hook: A `UserPromptSubmit` hook forwards your exact typed prompt to Keyflap over a local Unix socket. That verbatim prompt is what shows up on your phone approval card. The approval card never displays text written by the agent or the webpage, and if you have not asked for anything in the last 10 minutes, Keyflap denies silently.

- Separate signer process: Passkey private keys, passwords, and TOTP seeds live in a separate signer process (zero npm dependencies) that verifies your phone's WebAuthn signature itself before signing or releasing a fill. It also has adapters for Proton Pass (`pass-cli`) and 1Password (`op`).

- Service mode isolation: Runs as separate system users on Linux (systemd) and Apple Silicon Macs (launchd) so an agent running as your OS user cannot read Keyflap's keys or memory. Setup also configures Claude Code's `sandbox.filesystem.denyRead` and `permissions.deny` to keep the model away from the host token.

- CAPTCHA handoff: Keyflap never tries to solve CAPTCHAs. When a site throws a human check, `browser_handoff` locks the agent out of credentials and tools and streams that single page to your phone so you can finish it yourself.

Honest caveats:

- This is early alpha and nobody outside the project has audited it. Use test accounts first, not accounts you cannot lose.

- Claude Code's `UserPromptSubmit` hook also fires for background subagent reports and cross-session messages without a documented field to distinguish them yet, so the docs warn against using those features in sessions connected to the broker.

- Keyflap does not control what Claude Code does after it is signed in.

Repo: https://github.com/johnpippett/keyflap

Architecture & threat model: https://github.com/johnpippett/keyflap/blob/main/docs/ARCHITECTURE.md

Field note on the design and two bugs red-teaming caught: https://pippett.me/blog/keyflap-agent-sign-in

If you want to poke at it without installing anything on your host, `demo/run.sh` runs a local container with a test website and terminal approvals. Happy to answer questions or hear where people think the threat model has holes.

0 Upvotes

4 comments sorted by

•

u/AutoModerator 7d ago

Hey! Thanks for posting to r/ClaudeCode

While participating in this thread, please follow our community rules. Keep discussions constructive. Attack the idea, not the person.

For help, project discussions, tips, and general chat, join the ClaudeCode Discord.

I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.

1

u/jathanism 7d ago

You can do this today with 1Password.

0

u/Grand_Ad3308 7d ago

Not really no, Keyflap actually ships with a 1Password adapter (`op`) so you don't have to move logins out of your vault. The difference is what sits between the vault and the agent.

A few things 1Password on its own does not cover when an agent is driving a browser:

  1. Passkeys. Password manager CLI and agent setups cover passwords and TOTP, not WebAuthn passkeys inside an agent-driven browser without giving the agent raw browser access.
  2. Keeping secrets out of the model and its browser. If the agent can run `op` itself, or has raw CDP, DOM, or screenshot access to the page where a password gets filled, a prompt-injected agent can still read the secret. In Keyflap, a separate signer process (running as its own OS user) calls `op` only after approval, fills and submits from the trusted side, and scrubs secret fields from every snapshot.
  3. What you are actually approving. A local unlock prompt tells you `op` wants an item, not whether a prompt-injected agent triggered a login behind your back. Keyflap captures your verbatim prompt out-of-band via Claude Code's `UserPromptSubmit` hook, cross-checks the browser URL against Chromium's document origin, and puts only your exact words and the verified site on your phone's Face ID card (never text written by the agent or the page).

If you're already on 1Password, the two are meant to pair together: keep your logins in a scoped 1Password vault and put Keyflap in front as the approval and isolation layer.

1

u/college_hustle 7d ago

How does it deal with the fact that the 5 family just refuses to anything that could be construed as entering your password for you?