Back

Spec-driven development with AI agents: building Pookie in two weeks


Spec-driven development with AI agents: building Pookie in two weeks

Two weeks to a first working version, and 70% of the code is tests. That’s the record made by Pookie, an internal OVHcloud proxy that hides secrets from AI models. I built it with AI agents writing much of the code. But the interesting part isn’t the speed. It’s how you come to trust code you didn’t write line by line. This article walks through the spec-driven development approach behind it, with AI agents at every step, and the lessons any team can reuse. For what Pookie does, let’s start with how a redaction proxy works.

Let the AI interview you first

I didn’t start by asking an agent for code. I spent about six hours being questioned by one. The agent asked questions until the plan had no open ones left, and every answer became a written decision record. By the end, there were 54 of them.

This workflow isn’t mine. I used open source skills from Matt Pocock’s agent skills collection, shared with the developer community. Grill-me interviews you relentlessly about a plan until every branch of the decision tree is resolved. Grill-with-docs runs the same interview against your existing documentation and writes down decisions as they take shape.

The point is coverage. The AI asks the questions you forgot. One of them reshaped Pookie, which replaces each secret with a placeholder, for example __PK_HOST_3f2a…__, and puts the real value back when the answer returns. We had assumed that every placeholder in an answer was one Pookie had created. The question we hadn’t asked was: what if the AI model invents a placeholder?

It did, and it still does every now and then. The model saw folder names full of placeholders, learned their shape, and tried to open sibling folders under names it made up. Nothing leaked, because no secret stood behind those names. But to the operator, an invented placeholder looked the same as a lost real one, and the two cases need opposite responses. A lost one means investigating the storage. An invented one means nothing is wrong.

That question changed the design. Each time Pookie stores a secret, it also writes a second, smaller record. That record holds no secret. It only says that Pookie created this placeholder, and when. It lives four times longer than the secret itself, which means 12 days with the default 72-hour lifetime. So when an unknown placeholder comes back, Pookie can tell a real one that expired from one the model made up, and nobody chases a storage incident that never happened.

Each decision record captures what was chosen and why. Here’s one. If Pookie can’t read an outgoing request completely, it blocks the request, because a secret that reaches the provider can’t be taken back. If it can’t restore a hidden value in the reply, it lets the placeholder through and raises an alarm, because that text only goes back to the user’s own machine. Pookie has no switch to turn this protection off, and we accept that it can stop an agent until we support a new provider format.

Study prior art, then prototype

In parallel, multiple agents studied similar open source tools, from secret scanners to existing AI proxies, and compared them. For each one, they wrote a short scout note covering what to borrow and what to avoid. That’s how Pookie inherited a proven position in the request path and battle-tested detection patterns, and how it made a deliberate break: secret scanners usually tune for precision, while Pookie tunes for recall, because a missed secret costs more than a hidden harmless value.

Next came throwaway prototypes, built with the prototype skill from the same collection. Each one answered a single question, then was deleted. The biggest question was the language: Go or Rust? The agent could have written Pookie in either. But most of a request’s time is spent waiting for the model provider’s answer, so Rust’s extra speed wasn’t worth its extra complexity. Pookie is written in Go.

Give the agent a pass-or-fail signal

With the specs and research in place, the agent got a feedback loop before it got a task:

  1. Write a failing test.
  2. Let the agent implement until the test passes.
  3. Have separate AI agents review the code and its security.
  4. Run Pookie on a real repository to see what it catches and misses.

Repeat until everything is green. Tests make up 70% of the code, and that ratio is the trust model. You don’t review every line an agent writes; you review what it must prove.

At first, I focused on reviewing the specs and the tests, not the code itself. I moved to the code once something worked.

Most of what the reviews and real-repository audits surfaced was tuning rather than bugs. The delicate part is the balance between false positives and false negatives, because every rule that catches more secrets also hides more harmless values.

Next time, I’d invest more in loop engineering, the setup that lets the agent move from one feature to the next on its own. On Pookie, I regularly stepped in to tell it which feature to build next. That has a cost: if the agent ends up waiting for you at 7:30 p.m. on a Friday, you lose the whole weekend.

From a single VM to a shared instance

Pookie started as a Docker Compose stack on a virtual machine instance in OVHcloud Public Cloud. It then moved to OVHcloud Managed Kubernetes Service (MKS), with Redis, to serve many users at once. One engine now runs in four modes: a command-line preview, a standalone binary, a Docker Compose stack, and a Helm chart for the shared instance. A test with a fixed key checks that the proxy and the command-line tool produce byte-identical output, so the modes can’t drift apart. For the cryptography and isolation behind it, read inside Pookie’s design.

Spec-driven development with AI agents

The method fits in three habits. Let the agent interview you until the plan has no gaps, and write every decision down. Make it study prior art and prototype before building. And give it a test it must pass before you read its code. Spec-driven development with AI agents doesn’t remove review; it moves it to the specs and tests, where one person can keep up.

If you want to practise with a coding agent that keeps your code and prompts in Europe, you can connect it to AI Endpoints through its OpenAI-compatible API.


Share on: