← All 8logsSecrets management for AI agents

Who Gave the Agent the Keys?

Last year, most AI assistants answered questions. This year, they book meetings, query databases, open tickets and change cloud settings. To do any of that, an agent needs keys.

So here is a simple question for any team rolling out AI agents: who gave the agent the keys? And do you know which doors they open? This is what secrets management for AI agents is really about.

AI agents are a new kind of non-human identity

For years, secrets management had two kinds of users. People, who log in. And machines, like apps, containers and CI/CD jobs, that call each other with API keys and service accounts.

AI agents don't fit neatly into either box. Like a machine, an agent runs on its own, fast, around the clock. Like a person, it makes decisions. And it is often acting for someone. When an agent books a meeting, it books it on your behalf, with your permissions.

That changes the questions we need to answer every time an agent touches a system:

  • Which agent is this?
  • For whom is it acting?
  • For how long should it have access?

Most teams can't answer all three today.

Why static API keys break with AI agents

The quick way to give an agent access is the way we used to give apps access. Create an API key. Give it broad rights so nothing fails. Store it somewhere the agent can read it. Maybe in an environment variable. Maybe (we have seen this) in the prompt.

That just about worked for normal apps, because normal apps are predictable. The same code does the same thing every time. You can test it and know what the key will be used for.

Agents are not predictable. The same request can lead to different steps on different days. An agent might decide it needs a tool you didn't expect. It can be tricked by a cleverly written email or web page (this is called prompt injection). Give that agent a long-lived key with wide rights, and you have handed a stranger a master key that never expires.

Secrets in prompts are the worst case. Prompts get logged, cached, sent to model providers and shown in debugging tools. Treat anything in the context window as something that can leak.

Five secrets management habits for AI agents

The good news: the fix is not exotic. It is the same discipline good platform teams already apply to apps, applied properly to agents.

1. Give every agent its own identity

No shared keys. No single "AI service account" used by ten different agents. Each agent is registered, has an owner, and can be switched off on its own.

2. Hand out access at run time, not in advance

Instead of holding a stored key, the agent proves who it is and asks for access when it needs it. It gets a credential made for that one task.

3. Keep credentials short-lived and narrow

Minutes, not months. One database, read only, not "admin, everywhere". If a credential leaks, it is useless by the time anyone finds it. Some teams go as far as one credential per chat session that expires after five minutes.

4. Keep secrets out of the model's sight

The model decides what to do. The tool layer does it. Credentials belong in the tool layer, fetched by the code that calls the API. Never in prompts, never in the context, never in code.

5. Record every access, including "on behalf of"

Every time an agent gets access, log which agent, which person it was acting for, what it touched and when. When something goes wrong (and something will), you need that trail. Your auditors will ask for it too.

Start with the basics

Here is the uncomfortable part. Many companies want to jump straight to AI agents while their secrets are still scattered across config files, wikis and old pipelines.

Agents don't fix that mess. They multiply it. Every new agent is another place for a long-lived key to hide.

So the best AI security project you can start this quarter might not look like an AI project at all. Find your secrets. Move them to one managed place. Swap static keys for short-lived ones. Turn on audit logs. Teams that have done this can let agents in safely. Teams that haven't will spend next year cleaning up.

Three questions for your team this week

  1. How many AI agents (or AI-powered tools) can reach our systems today, and who owns each one?
  2. If one of those agents' keys leaked tonight, how long would it keep working?
  3. For any action an agent took, could we show whose behalf it was acting on?

If your answers are "not sure", "forever" and "no", you are not alone. But now is the time to fix it, before the agents multiply.

Got a problem? Good.

Tell us. We reply with a clear next step.

Email us
Resolve Technology HQUnit A, 7/F, King Palace Plaza55 King Yip Street, Kwun TongKowloon, Hong Kong+852 3618 9970[email protected]Also in the UK, Taiwan and Singapore.Existing client? Use Client Login to manage your Red Hat and OpenSearch licenses and open a support case.