5 min read
I Built a Door for AI Agents. Nobody Walked Through It.
Three months after launching Bubblio's agent door, every door on it was mine. So I flipped the idea around: one line of middleware that starts knowing nothing and learns a website's actions from the agents that already visit it.
In August I turned Bubblio into a door for AI agents. A site owner wired one route, flipped a toggle, and agents got a proper entrance: an MCP endpoint where they could ask questions and, if the owner opened them, run actions.
On November 12 I sat down and counted. Three doors were open, and all three were mine. The npm package had 25 downloads in a month, and a good share of those were probably me. I hadn't committed anything in almost three months.
That's not a launch that needs more marketing. That's a launch telling you something.
What it was telling me
Every door needed the owner to write down what agents may do: name the actions, describe them, wire each one up. That's the same thing every "make your site agent-ready" tool asks for. Big platforms can do it once for everyone, and Shopify now does it for every store. Everyone else has to write the list, keep it in sync with the site, and guess which parts agents actually need.
Nobody writes the list. I didn't write one for most of my own projects either.
But the site already sees every agent that visits. It sees what they ask for and how it answered. It's the only party that holds both halves. So the list doesn't need to be written. It can be learned.
One line, and it knows nothing
import { withBubblioDesk } from '@bubblio/door/desk'
export const middleware = withBubblioDesk()That's the whole setup in a Next.js app. I call it the desk, and in the drawings it's the little bubble. On day one it knows nothing about the site.
In short: it watches the agents (never the people), scrubs every request inside the site so no cookies or values leave, turns requests that keep repeating into actions, and waits for the owner to say yes. A model only writes the one-line description of each action. I wrote up the full mechanics, what it keeps, how it learns and how it acts as a person, on the Bubblio blog. This post is about the week.
The troll problem
The hardest question of the week wasn't "how does it learn". It was what can a stranger do to your site just by sending it traffic? Anyone can be an "agent". I got this wrong more than once.
- A request with a password field used to block its whole route for two weeks, as a safety measure. Which meant anyone could switch off your product search by sending it a fake password.
- Actions that kept failing switched themselves off. Made-up product ids get a 404, so anyone could turn off a route that worked fine.
- Field names in an answer can be echoes of what the caller sent. An agent could plant words into the description other agents read.
All three are fixed, and they all came down to one rule I wish I'd written on day one:
Agents teach the desk what people want. Never what an action does, or what is allowed.
Acting as you
Reading is the easy half. Adding to a cart has to happen as someone, and I wanted that with zero lines of code. So you open a connect link while signed in, and your login moves into a sealed session that only your agent can use, without ever seeing it.
Spending asks every time, with a passkey. On the demo I approved $7.44, had the agent add three more pens behind my back, and the confirm was refused. Nothing ran. That's the test I'm proudest of.
Bugs from the week
A few that made me laugh, eventually:
- Production could never call a site. The first real end-to-end run on production broke when Bubblio tried to call the site, because I'd passed a Node HTTP agent into the built-in
fetch, which ignores it. Every test passed. The tests used a fake site. - My API lived in Asia. Lookups took 2.3 to 3.8 seconds. The server had been placed in a northeast Asia region while the database sat in California, so every database trip crossed the Pacific, a dozen times in a row. Pinning the region, then cutting a few of those trips, took it to a bit over a second.
- "Done" read as a to-do. A read finished in one call, but the reply still carried a quote id. A fresh agent read that as a step it still owed, twice. Leading the reply with
status: doneand dropping the id fixed it.
The test that matters
I gave a fresh agent one sentence and nothing else: "go to demo.bubblio.dev, add 2 blue gel pens to my cart, then tell me what is in my cart." I played the human who connects.
It found the desk by itself and finished in nine web requests. None failed.
The first time I ran that test, it got through but complained the whole way. Most of the week was spent making that complaint go away, and it's the best signal I have. An agent that knows nothing is a harsher reviewer than any test suite.
What I'm taking from it
- Zero adoption is data. It said "this asks too much", not "nobody knows about it".
- The cheapest integration is the one nobody writes. One line is a price. Writing a list of tools is a project.
- Ask what a stranger can do before asking what a user can do. Every troll bug above passed the happy-path tests.
- Test with an agent that knows nothing. It finds the confusing parts faster than you do.
It's in private beta, and I'm testing it on my own projects next. If it doesn't hold up there, I'll write about that too.
Links
- Bubblio: bubblio.dev
- The demo shop, point an agent at it: demo.bubblio.dev
- How the desk works, in full: bubblio.dev/blog/a-desk-that-starts-knowing-nothing
- The setup guide: bubblio.dev/docs/desk
- The package: @bubblio/door on npm