Everyone wants their AI agent to act on their behalf, use their real accounts, and get past login screens. That sounds simple on paper, but there’s a reason it still isn’t widely solved.

Hand an agent your passwords, cookies, or full browser access, and your credentials end up inside its context window, prompts, and logs. Log in manually every time a session expires, and you’ve defeated half the point of running an agent.

I built Keyflap to split the job in two: let the agent drive the browser, keep every secret somewhere it can never reach, and require a Face ID or fingerprint tap on your phone before anything signs in.


Keep the keys out of the room

The rule behind Keyflap is straightforward: treat the AI agent as untrusted. It never sees a password, passkey, or one-time code, and it never gets raw browser debugging access. It asks Keyflap for a sign-in, and the only answer it gets back is “signed in” or “denied”.

Under the hood, I split the local tool into separate pieces so no single bug exposes your keys. The main broker handles policy rules, browser automation, and a tamper-evident audit log, while storing zero secrets in its database. Your actual keys live in a locked-down signer process of their own.

01 / Process split
Split the browser from the keys. The broker holds zero secrets. The vault verifies your phone’s approval itself. NO DIRECT AGENT → VAULT PATH sign-in result only UNTRUSTED AI Agent Browser client gets: signed in KEYFLAP BROKER Policy & Routing Rules · intents · audit Stores 0 secrets Managed Browser No raw DevTools access KEYFLAP APP Your Phone Face ID · signs tap ISOLATED SIGNER Key Vault Encrypted passkeys Verifies phone token
Even if the broker had a bug, the isolated vault checks your phone’s signed approval token on its own before releasing a signature.

That second check matters most. The vault does not just take the broker’s word that you tapped approve; it verifies the phone’s cryptographic signature itself, tied to that exact site and request. Even the installer follows the same principle: an agent can help walk you through setup, but it never gets to install its own guardrails.

One implementation lesson worth sharing early: don’t use Chrome’s built-in virtual authenticator for real passkeys. It looks convenient in browser automation, but it keeps private keys inside the browser process where debugging APIs can read them out. Keyflap intercepts the browser’s passkey calls and delegates the actual signing to the isolated vault instead.


Two bugs red-teaming caught

Right before releasing the public alpha, I sat down to attack my own design. Two subtle failure modes stood out - the kind that look clean on a whiteboard and break once real browsers and prompt injection get involved.

A matching URL isn’t always the same site

Keyflap never asks the agent or the webpage what site is open. It reads the URL directly from the trusted browser layer, blocks iframes, and requires HTTPS.

Granted, reading the URL from the browser already shuts down basic phishing. Even still, it isn’t enough. If a real site serves user-uploaded HTML with a sandbox header (Content-Security-Policy: sandbox), the page keeps the site’s real URL while Chromium isolates it into an opaque security origin. Checking only the URL would let an untrusted upload request credentials for the parent site.

So Keyflap checks both the browser URL and Chromium’s internal document origin, and fails closed if they disagree.

02 / Dual origin gate
A matching URL isn’t enough. Both the browser URL and Chromium’s real document origin must match. DUAL GATE 1. Browser URL 2. Document origin REAL HTTPS PAGE URL: app.example Origin: app.example EXACT MATCH Allowed to sign in SANDBOXED UPLOAD URL: app.example Origin: opaque MISMATCH → FAIL CLOSED Sign-in blocked before any key or fill
A sandboxed HTML upload keeps the parent site’s URL while Chromium assigns an opaque origin. Checking both stops it cold.

Never let the agent explain why it wants in

Origin checks stop fake websites. They do not stop a prompt-injected agent from navigating to a real site you use and asking for a login behind your back.

Imagine your phone buzzing with an approval request for your email or bank. If the agent gets to write the explanation on that screen, a hijacked model can make almost anything sound routine. So Keyflap refuses to display a single word written by the agent or the webpage.

Instead, a hook inside your agent host forwards your exact, verbatim prompt over a separate local channel. That is the line shown on your phone card. If you haven’t asked for anything recently, Keyflap denies the request silently so you don’t get spammed with approval prompts.

03 / Out-of-band intent
Your words on the card. Never the agent’s. No recent user request means silent auto-deny. One pending approval per agent. HOST CHANNEL · YOUR EXACT PROMPT VERBATIM USER INPUT “Sign me in to GitHub” UNTRUSTED · AGENT / WEBPAGE TEXT MODEL-WRITTEN PRETEXT “Routine account verify” BLOCKED never shown PHONE APPROVAL CARD YOU SAID “Sign me in to GitHub” SITE github.com AGENT claude-code METHOD passkey Approve with Face ID
Your approval signature binds the exact site, credential, and request hash together so a single tap cannot be replayed elsewhere.

The honest caveat: if an AI agent runs under your exact same OS account with shell access, it can eventually find ways to poke that local channel. That is why running agents in their own OS user or container is the right long-term boundary - Keyflap separates credentials today, and stronger per-agent isolation is next on the roadmap.


Where I drew the line

Every new site starts at ask: confirm on your phone before anything signs in. High-risk categories like banking, email, code hosting, and government stay locked to ask-strong with no temporary bypasses. You can allow a low-risk site for a short window if you want, but nothing defaults to open.

The other line I refused to cross is bot detection. When a website throws a CAPTCHA or human check, Keyflap does not try to solve it, hide that it’s automated, or bypass it. It locks the agent out of all credentials and tools, streams that single page to your phone, and lets you solve the check yourself.

04 / Policy & handoff
Default to ask. Hand CAPTCHAs to a human. No fake stealth. No CAPTCHA solving. Every decision hits the audit log. PER-SITE POLICY deny always blocked ask default for every site ask-strong banks · email · code · gov · no bypass allow-for ≤ 24h · low-risk only ON CAPTCHA · HUMAN HANDOFF Site asks for a human check AGENT PAUSED Credentials & other tools fail closed SOLVE ON YOUR PHONE You finish the check · agent sees 0 frames
High-risk origins stay pinned to ask-strong. On a human check, Keyflap pauses the agent and hands the page straight to your phone.

Most AI security problems turn out to be classic security fundamentals wearing a new coat of paint: process isolation, least privilege, and keeping a real verification step outside the model. Keyflap is early alpha and open source under Apache 2.0 on GitHub and keyflap.com.