Deja de compartir claves de API y secretos con tus agentes de IA

Por qué de verdad no deberías pegar secretos en tus agentes de IA, y cómo lo resolvimos con Laze

When you paste an API key into Claude Code, ChatGPT or any AI chat, the key becomes part of the prompt. That prompt often passes through several companies before it reaches a model, and each of them can read it.

HD Moore, a researcher at the security firm Dragos, sent nearly two million prompts holding fake keys he could track. Attackers tried some of them within hours, even from prompts marked as never to be stored. "A privacy flag doesn't help when the attacker is already inside," Moore wrote, as Ars Technica reported on 20 November.

Your prompt passes through more companies than you think

Your prompt often goes first to an AI router, such as OpenRouter or Vercel, which reads it to pick a model and forwards it to other hosting companies. Each of them can log it and keep it.

Moore put a unique secret in each prompt, such as an Amazon cloud key tied to an empty account, so he knew where every leak came from. His full write-up is on the Dragos blog. The keys leaked three ways:

  1. Breached hosts. At least three hosts had attackers inside, who used a couple hundred of the Amazon keys, some within hours.
  2. Resellers. Some cheap sellers logged requests and used the keys themselves.
  3. Scrapers. One lab's systems opened the secret links two or three days later.
A prompt with a real key goes from your agent to an AI router and on to three model hosts, and each stop keeps a copy. From there one copy reaches an attacker, one a reseller who uses it, and one a scraper that opens your links, even when the prompt was marked as never to be stored.

On 21 November, OpenRouter emailed customers that some prompts may have been read. Moore's advice is to run models yourself or buy straight from the model's maker, and even then it's only a promise. For keys there's a simpler fix: a prompt with no key in it.

With Laze, your agent only holds a fake copy of each key

Laze is a team workspace where people and AI agents work together. Its agents run on a hosted Laze computer, one small cloud machine per person, or on your own laptop with Claude Code or Codex.

On a Laze computer the agent never gets your key. It gets a placeholder with the same length and prefix, so libraries such as Stripe's accept it. The placeholder is random for each agent and computer, so it's worthless anywhere else.

Every request leaves the computer through Laze's egress proxy. When the proxy sees the placeholder going to a site approved for that key, such as Stripe, it writes in the real key, and it puts the placeholder back if the reply echoes the key.

On a Laze computer your agent only has a placeholder for the Stripe key. The AI model sees the placeholder and answers with a Stripe call that uses it. When the agent runs the call, the Laze proxy writes in the real key on the way out and puts the placeholder back into Stripe's reply, so the agent and the model only ever see the placeholder.

The agent's files, memory, output and prompts only ever hold the placeholder, and that's all a router or host would see. The proxy doesn't follow redirects, so a request can't carry the real key to another site.

The first time a key goes to a new site, you get a card on your phone or Mac to allow or deny it.

Some keys have to be inside the program

Some keys never go over the web. If your agent runs your app's database migrations, the app connects to Postgres with a password, so there's no web request for Laze to swap the key into.

For those, the agent asks for the real value for one command. An automatic check refuses a command that would print, copy or send the key and sends unclear ones to you. The value lives only inside that command.

On your laptop, every key works this way. If a command prints the key, Laze shows four stars before the agent sees the output, and the Claude Code plugin swaps any key left in the session file for a reference.

The database password for an app you are building: an automatic check allows the request, the password goes into the one command that runs the migrations, the output shows four stars where it was printed, and it is gone when the command ends.

You decide how far each key goes

Each key gets a level: free to use, checked by a second AI model against the task, held until you approve each use, or people only. Every use is logged with who asked, which agent and the answer.

Each key has one of four levels, shown in turn: free to use, checked by a second AI model, held until you allow it on your phone, and people only, which turns the agent away. Behind the scenes, every answer is written to the audit logs.

If you paste a key into a message to an agent or a Slack channel, Laze stops it on your device and offers to save the key to the vault and send a reference instead.

You paste a key into a message. Laze stops the message on your device, saves the key in the vault, and sends the message with a link to the saved key instead.

Laze is one more company your requests pass through, so keys are stored encrypted and the proxy holds a key in memory for a minute at most. The security docs describe every step. See how the Laze vault works, or start a workspace and connect your own agent.

Delega directamente en el Claude de tu compañero

Empezar gratis