Back

Protect sensitive data from AI agents with a redaction proxy


Protect sensitive data from AI agents with a redaction proxy

Have you ever cleaned a log file by hand before pasting it into an AI assistant? Most engineers have. Frontier models are among the most capable AI models available today, and they run outside your infrastructure, often under another jurisdiction. Every prompt your coding agent sends could carry IP addresses, passwords, or customer identifiers. If you want to protect sensitive data from AI agents without giving up the most capable models, manual cleaning won’t scale. Here’s how I automated that step with a redaction proxy at OVHcloud, and what any team can borrow from the approach.

Security and sovereignty

Sending a prompt to a third-party model raises two questions. The first is security. Can a secret leak, be logged, or be kept long enough to be cracked later? The second is sovereignty, meaning who can legally reach the data once it has left. Data processed by a provider outside your jurisdiction falls under that provider’s laws, and some of them let authorities request access. For European organisations bound by rules such as the GDPR or NIS2, that’s a compliance question as much as a technical one.

The OWASP project ranks sensitive information disclosure second among the top security risks for applications built on large language models (LLMs), and one of its recommended mitigations is to sanitise sensitive values before they reach the model. Redaction answers both questions at once, because a value that never leaves can’t be reached by anyone. It’s the same logic behind OVHcloud’s commitment to data sovereignty.

Why manual redaction falls short

Before joining OVHcloud, I worked on a highly secured offline site. Nothing left it unchecked. Each data export went through an administrator, who ran a cleaning script and then reviewed the result line by line.

Years later, at a different company and for a different reason, the list of data that must never leave is almost identical: hostnames, IP addresses, passwords and tokens, encrypted secrets, and customer identifiers.

My first answer was the one I’d used on that site, a small find-and-replace script run by hand before anything went into an AI tool. It had four flaws:

  • Manual: you have to remember to run it, and sooner or later you forget.
  • Incomplete: each kind of secret needs its own rule.
  • One-way: the model answers with <REDACTED>, and you put the real value back yourself.
  • Inconsistent: two different servers both become <PRIVATE_IP>, so the model can no longer tell them apart.

As colleagues shared their own cleaning scripts, results drifted from one team to the next. The next step was to take the human out of the loop.

How a redaction proxy works

A proxy is an application that sits between a client and a server and relays the traffic between them. In Pookie’s case, the client is your AI tool and the server is the model provider, so every request and every response passes through it. Several open source and commercial tools already occupy this position. I built Pookie to fit OVHcloud’s own rules. The name is French slang for a “snitch,” but this one keeps its mouth shut.

Redact on the way out, restore on the way in

Imagine your agent reads a welcome note for a new server:

bash
Welcome to your private instance. The IP is 10.20.30.40 and the password to connect is v9wpAv59zX7VOIdNF2Qp.

Before the request leaves, Pookie swaps the sensitive values for placeholders. The provider receives this instead:

bash
Welcome to your private instance. The IP is [IP #1] and the password to connect is [SECRET #1].

The model answers with the placeholders, for example “Connect to [IP #1] with the password [SECRET #1].” On the way back, Pookie restores the real values. You get a working answer, and the provider never sees what was behind the placeholders.

In short, on the way out, we redact the data. On the way in, we restore the data.

Think of it as a bouncer with a cloakroom. Real values stay in the cloakroom, and each message leaves with a ticket. If the bouncer can’t check a message, it doesn’t go out at all.

Placeholders the model can still reason with

Two design choices keep the model useful. Placeholders are deterministic: within a session, the same value always gets the same placeholder, so if your agent mentions two servers, the model still sees two distinct servers. They’re also typed, which means the model knows it’s handling an IP address or a secret, just not its value. The provider gets the shape of your setup (a server’s role, its OS version, its firewall rules) without the details that would tie it to real machines.

What gets caught

Pookie looks for five families of data:

  • Secrets and credentials: passwords and login tokens.
  • Keys and encrypted material: server keys and encrypted strings, hidden but never opened.
  • Network identifiers: IP addresses and server names.
  • Personal data: email addresses, phone numbers, bank cards, IBANs, and customer account IDs.
  • Random-looking strings: anything with the statistical profile of a generated secret.

Detection combines known patterns with a check on how random a string looks. The engine is deliberately biased toward caution: it would rather hide a harmless value than miss a real secret. During a live demo, it replaced a regular expression it had mistaken for a password, the kind of false positive that trade-off accepts.

What a proxy can and can’t do

A redaction proxy lowers the risk a lot; it doesn’t remove it. A passphrase made of ordinary words doesn’t look like a secret, so it can slip through. Servers are only recognised once their names and IP ranges are configured. Postal addresses and personal names are out of scope for now, because telling a name from a project that shares it takes machine learning. And the proxy trusts your AI tool: it isn’t a cage for a rogue agent.

That’s why Pookie is a safety net, not a permission: secrets still belong in a vault rather than in your code. For the cryptography, the per-user isolation, and the full list of limits, read how the redaction proxy is built. Pookie itself is an internal tool, now moving from beta to general availability, and I built its first working version in two weeks with AI agents, a method described in this companion article.

Protect sensitive data in your own agents

You don’t need Pookie to apply its principles. When you protect sensitive data from AI agents, a few rules carry over to any setup:

  • Replace values rather than deleting them, so the model keeps its reasoning.
  • Keep placeholders consistent and typed.
  • Block the request when protection fails, and never let data through by default.
  • Write your limits down before an auditor finds them.

The other option is to keep the model itself where your data lives. AI Endpoints runs open-weight models in the European Union behind an OpenAI-compatible API, so many agents can switch to it without rewriting code. To try it in your editor, start with this guide to building a code assistant with Continue and AI Endpoints.


Share on: