ArchitecturePart 2 of 8

Agent Identity: How an Agent Proves Who It Is

If an agent's identity is a field in the request, anyone can claim it. Why multi-agent systems need platform-issued, short-lived identity, and what it should contain.

DNotifier Team••6 min read
Back to blog
Agent Identity: How an Agent Proves Who It Is

In most multi-agent systems I review, an agent's identity is a string. Somewhere in the payload there's "from": "billing-agent", and the receiver believes it.

That works right up until something other than billing-agent sends a request with that string in it. Could be a leaked project key. A tool that got prompt-injected and now makes calls of its own. A test script someone pointed at production. Or a copy of an agent that a developer cloned and forgot about. The receiver can't tell the difference, because the only proof of identity is a claim.

Part 1 of this series listed four questions every multi-agent system answers. This part is about the first one, who is this?, because every later answer depends on it. An allowlist that checks a name nobody verified is decoration.

Why agents are harder than services

We already know how to give services identity. Service meshes use mutual TLS, cloud platforms give workloads their own credentials, and standards like SPIFFE describe how to issue identity to running workloads instead of to people. All of that is worth borrowing.

Agents add three twists.

They're created per task. A service runs for weeks. An agent "instance" might live for one run of forty seconds, then disappear. Long-lived credentials don't fit something that short.

What they do depends on what they read. A service runs the code you deployed. An agent runs the code you deployed plus whatever a web page, a document or another agent put in its context. Identity has to survive that: a hijacked agent should still only be able to act as itself, within its own limits.

They share a project. Most platforms authenticate at the project level. Every agent in the project uses the same key. That proves "this request comes from our project". It doesn't prove which agent sent it.

What good agent identity looks like

The design we've settled on, and that I'd recommend for any platform, has five properties.

1. The platform issues it. When the platform starts an agent run, it mints a credential for that run. The agent doesn't create its own identity and can't pick one.

2. It's short-lived and run-scoped. The credential carries the project, the agent, the execution and the session, and it expires with the run. A token copied out of one run is useless in the next one. This also makes rotation a non-problem: nothing lives long enough to need rotating.

3. The server reads the caller from the credential, never from the request. If the body says "from": "triage" and the token says refunds, the caller is refunds. Better still, drop the body field entirely so nobody is tempted to trust it.

4. Every agent-to-agent call and every state write carries it. Not just the first hop. If writes to shared state don't require identity, the conflict rules in parts 5 and 6 have nothing to stand on.

5. The model never sees it. The SDK attaches the credential to outgoing calls. It isn't in the prompt, the tool results or the agent's memory. If the model can't see the token, a prompt injection can't ask it to print the token or reuse it somewhere else. This one gets skipped a lot, and it matters.

Platform-issued agent identity
Platform-issued agent identity

What the claims are for

A typical run credential carries something like:

ClaimWhy it's there
projectSo a credential from one project can never act in another
agentThe actual identity. Every permission check keys off this
executionBinds the credential to one run, so it can't be replayed into another
sessionLets you scope state and memory to the user conversation the run belongs to
expiryMinutes, not days. Long-running agents refresh through the platform
chainWho called whom to get here. Covered in part 3

Notice what isn't on the list: permissions. It's tempting to stuff "can call refunds, can write ticket.category" into the token. Don't. Permissions change, and a token you've already handed out can't be updated. Keep identity in the token and look permissions up at the moment of each call.

Failure modes to design for

Replay across runs. Someone captures a token from run 1 and uses it in run 2. Binding the token to the execution ID and checking it on every call closes this.

Long runs. An agent that waits for a human approval for an hour will outlive a fifteen-minute token. The platform should refresh it while the run is alive, rather than issuing long tokens to everything just in case.

Remote agents. When an agent runs in another service, that service should receive a credential for the specific call it's handling, not a standing key that works for any call.

Platform-initiated runs. Scheduled jobs and webhooks have no calling agent. The caller is the platform itself, and that should be an explicit identity of its own, not a blank field that permission checks treat as "anyone".

How DNotifier handles it

When DNotifier starts an agent run, it issues a short-lived token tied to the project, the agent, the execution and the session. Every agent-to-agent call and every write to shared state carries it, and the server reads the caller from the token, never from the request body.

In practice that means:

  • A request claiming to be agent A without A's token is refused, and the refusal is recorded in Traces.
  • A token captured from one run is useless in another, because it's bound to that execution.
  • The token is attached by the SDK and never appears in the prompt, tool results or memory, so a prompt injection can't print it or reuse it.
  • Remote agents receive a credential for the call they're handling, not a standing key.
  • Scheduled runs and webhooks start with a named platform identity, so allowlists can name them explicitly.

Identity is the base for everything else in this series: the allowlists in the next part, the tool approvals in part 4 and the key ownership in part 5 all check the identity in this token.

A checklist for your own system

  • Can a request change its claimed sender by editing a field? If yes, that's your first fix.
  • Do all agents in a project share one long-lived key? Then a single leak gives an attacker every agent's identity.
  • Do your tokens expire within minutes, and are they bound to one run?
  • Can the model read its own credential anywhere in its context?
  • Are platform-initiated runs (cron, webhooks) a named caller, or an empty one?
  • When a call is refused for identity reasons, is that logged somewhere a person will see it?

FAQ

Is a signed JWT enough for agent identity?

A signed token is the right container. What matters more is who signs it (the platform, never the agent), how long it lives (minutes), what it's bound to (one execution), and whether the server ignores identity claims in the request body.

Should agents use OAuth?

For calling external APIs on a user's behalf, yes, and that's a separate credential from the agent's own identity. For agent-to-agent calls inside a platform, a run-scoped token issued by the platform is simpler and easier to reason about. The delegation ideas from OAuth token exchange are still useful, and part 3 borrows them for call chains.

What about agents from different companies talking to each other?

That's where open protocols for agent-to-agent communication come in, and identity there is a harder problem because nobody controls both sides. Everything in this post still applies inside each side's boundary. Start there.

Does agent identity stop prompt injection?

No. It limits the damage. An injected agent can still be tricked into doing something within its own permissions. Identity makes sure it can't pretend to be a more powerful agent while doing it. Part 8 covers the injection side.

Trust in multi-agent systems

Part 2 of 8

  1. Part 1Multi-Agent Systems Need Shared Context, Not Just Message Passing
  2. Part 2Agent Identity: How an Agent Proves Who It Is
  3. Part 3Who Can Call Whom: Agent-to-Agent Authorization
  4. Part 4Requested vs Granted: Tool Permissions for AI Agents
  5. Part 5Conflict Resolution on Shared State: Owners and Write Rules for Every Key
  6. Part 6Version-Checked Writes and Proposals: Optimistic Concurrency for AI Agents
  7. Part 7Consensus for AI Agents: Validation, Judges, Votes and Humans
  8. Part 8Agent-to-Agent Prompt Injection and Earned Trust

Tags

#multi-agent-systems#agent-trust#agent identity#agent-to-agent authentication#ai agent identity#workload identity for agents#short-lived tokens

Keep reading

Related articles

View all →