Learn · Threats
Stop token theft and replay attacks on AI agents, and retire shared API keys
A token that works for whoever holds it is a liability: it leaks through logs, prompts, config files and chat. A shared API key is worse, because many agents use it and one leak exposes all of them. The fix is to make each agent prove it holds a key, on every call, with a proof that works once.
The problem with shared keys and bearer tokens
With a shared key you cannot tell which agent did what, you cannot stop one agent without breaking the rest, and rotating the key means touching everything that uses it. A copied bearer token behaves the same from any machine.
What stops theft and replay
- One identity per agent, from its own key created on its own host.
- Tokens that last minutes (at most five) and name a session key held only in memory.
- A single-use proof on every call with a nonce used once. A replayed proof is refused, and so is a token without its session key.
- Host binding: a copy on another machine does not match the recorded host and gets no token.
Replacing a static secret
- Enroll the agent and have a principal approve it.
- Put Oathera Agent Enforcement in front of the tool in watch mode, so it logs what it would refuse.
- Move the tool off the shared key.
- Switch the rule to enforce.
How Oathera helps
Oathera removes the standing secret an agent can leak. What the agent holds, an identity token, is useless without the session key it names, and each call needs a fresh proof. Revoking an agent refuses its next token request and next decision, and tokens already issued expire within five minutes.
Oathera does not verify people, judge model output, inspect or rewrite prompts, or replace your identity provider. Your identity provider and proofing sources do the first; Oathera is the layer under them for agents.
FAQ
How do you prevent token theft for AI agents?
Bind the token to a key the agent holds, rotate that key often and require a single-use proof on every call, so a stolen token cannot be used.
How do you stop replay attacks?
Each operation proof carries a nonce used once and is signed over the exact operation and arguments. A replay or an altered argument is refused.
Why remove shared API keys?
They hide which agent acted, cannot be revoked per agent and spread one leak across every user of the key.
How quickly does revocation work?
The revoked agent's next token request and next decision are refused. Tokens already issued stay valid until they expire, five minutes at most.
Related: Per-agent identity vs shared API keys · Credential lifetimes for AI agents · Proof of possession for AI agents
Become a design partner Watch the simulator More guides
← Back to Learn