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.
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.
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.
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.
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.
