← All Blogs
AI Agent Security

Researchers hid secrets in AI prompts, and attackers were using them the next day

We’ve spent years getting engineers to keep secrets out of code. We built scanners, pre-commit hooks, and push protection to catch the ones that slip through. Then we gave AI agents access to those same secrets, and they started copying them into prompts.

So I work from one rule: if an AI agent can read a secret, treat that secret as already leaked.

This month, Dragos showed us just how literally we should take that. On October 21, its research team put a working AWS key into a single AI prompt. Someone was using it the next day, and it was still in use three weeks later. The people using it checked whose key it was, tried to run AI models on it, and tried to create a new IAM user, which is how an attacker stays in after you rotate a key.

The key was a canary. The team ran what amounts to a honeypot for AI prompts: canary secrets in nearly two million prompts sent to AI providers, with every AWS key tied to an empty, fully logged account. The keys in your agents' prompts open real systems, and attackers may already be using them.

Prompts pass through more hands than you think

A prompt doesn't go straight from your agent to a model. It can pass through routers, resellers, and log services you never chose. Dragos found that at least three AI providers had been breached, and none of them knew until Dragos informed them. It also found resellers keeping customer prompts in ordinary request logs, and prompts flagged Zero Data Retention that were still stored and read.

It's worth asking your AI vendors which routers, resellers, and log services touch your prompts, and whether Zero Data Retention holds at every hop.

A secret in a prompt is even worse than a secret in your codebase. A secret in your codebase sits in one place you control. You can scan for it, see who touched it, and revert the commit. A secret in a prompt leaves your perimeter on every model call and lands in logs you can't scan or delete. Agents resend their context on each turn, so a secret read once travels again and again. Nobody tells you it was read, unless you planted a canary.

How secrets end up in prompts

People paste passwords and API keys into prompts to finish faster. Builders hard-code them into system prompts, which go out with every call. And agents add them on their own.

An agent will do whatever it takes to complete the task at hand. If it can read a credential and the credential helps, it will use it and send it along. It bears no consequences for doing so, and the worst part is that you may never know it happened.

Together AI noticed, and it still was not fast enough. An AI coding agent working on one of its public GitHub repositories committed a credential for a private repository of stored prompt samples. A scanner caught the commit and the team reverted it, but someone had already taken the credential. That person downloaded the samples, searched them for more credentials, and tested what they found. Five were Dragos canaries.

Find the secrets, then take them away from agents

Training and redaction do not fix this. Redaction only catches secrets in formats it recognizes, and training people does nothing about what agents send on their own. If an agent can read a secret, it will eventually send it somewhere. The control I trust is making sure the agent never holds it, and that takes two steps.

Find the secrets already in prompts

You need visibility into agent activity and system prompts that flags credentials, so you can remove plaintext secrets from prompts and rotate them, starting with the ones that unlock the most.

Inject secrets at runtime instead of handing them out

One way is an access broker. When an agent needs access to another service, it asks the broker. The broker checks policy, opens the session, injects the secret on its side, and returns only the results. The secret never enters the agent's context, the prompt, or the response. The person who started the task never sees it either.

None of this is new. Access management solutions have injected credentials into human admin sessions for years. Vaults with short-lived, dynamic secrets help, too, because they shrink how long a leaked secret works. But with a vault, the agent still retrieves the secret and holds it, and anything an agent holds can end up in a prompt. A broker is not the only way to avoid that. A hook in the agent's runtime is another: it adds the secret to a tool call after the model has written it, so the model never sees the value. The mechanism matters less than the outcome: the agent never knows the secret.

Runtime injection removes the credential, not the risk of misuse. A hijacked agent can still run a destructive query with the access it was given. Policy still has to decide which actions an agent may take, and the data that comes back in a response still needs care.

What Zero Standing Access means for AI agents

Treat every agent as a non-human identity with an owner. Register it, give it a human sponsor, scope it to what its tasks need, and revoke its access when the task ends.

Zero Standing Access (ZSA) means no agent holds access between tasks. When an agent needs access, it gets it for that task, and access is revoked when the task ends. Every action is logged against the agent, the person it acts for, and the task.

Where Venice fits

Finding exposed secrets without removing them leaves you with a list of problems. Injecting secrets at runtime without finding the old ones leaves those keys working. Venice does both: it flags secrets in prompts, rotates them, and then injects credentials at runtime under each agent's policy.

Venice injects the credential into the connection on the agent's behalf, at the moment of access, whether the target is an AWS account, a web app, a database, or a service in your data center. It then rotates the credential after use, without breaking your agentic workflow, so anything that leaked before stops working. The same controls cover the people and machines in your environment, across cloud and on-prem, so agents don't need a separate tool.

If you want to see what that looks like across your entire agent fleet, book a demo.

Related articles

Done with standing access?

Book a demo