An API key pasted into an environment variable for a demo, and still valid in production months later, is how many AI agents prove who they are. That persists even though a workload identity standard that issues identities with no stored secret at all reached graduated status at the Cloud Native Computing Foundation in 2022. SPIFFE for AI agents lets an agent prove what it is from where it runs.
SPIFFE (Secure Production Identity Framework for Everyone) is an open standard that gives each workload a name and a short-lived signed document, the SVID, that proves it. SPIRE (the SPIFFE Runtime Environment) implements it with a signing server and an agent on each node that checks which process is asking.
It answers secret zero cleanly, but it fails agents in one place. SPIRE attests processes, so five agents in one Python process share a single SPIFFE ID, and every log line describes all five. SPIFFE for AI agents works when three conditions hold: each agent has a boundary the attestor can see, a broker turns the verified identity into access without handing the agent a credential, and the trust domain’s signing keys are protected. The first one decides whether SPIFFE fits your agents at all.
SPIFFE vs. SPIRE: Understanding the Difference
SPIFFE is the specification and SPIRE is one implementation of it, so a service that only verifies your agents can do it with the trust bundle and a SPIFFE library, without running SPIRE. Every identity is a URI:
spiffe://<trust-domain>/<workload-identifier>
spiffe://acme.com/agents/refund-approver
The trust domain is the root of trust for every identity in it. An SVID is valid only when that domain’s authority signed it, so whoever holds its signing keys can mint any SPIFFE ID there. Name agent paths by role, since pods get replaced and audit logs outlive them.
What an SVID Is, and the Two Formats
An SVID (SPIFFE Verifiable Identity Document) is the signed document a workload presents to prove its SPIFFE ID, in one of two stable formats.
| Property | X.509-SVID | JWT-SVID |
|---|---|---|
| How the ID is carried | The certificate’s single URI SAN | The sub claim |
| Transport requirement | Mutual TLS, so the caller must hold the private key | A bearer header, so every hop needs TLS |
| Replay risk | Low: a copied certificate is useless without its key | High: a captured token works until it expires |
| Where it fits | Calls where both ends terminate TLS | Calls through an L7 proxy, and APIs that expect a JWT |
Under the X.509-SVID specification, a certificate carries exactly one URI SAN and validators must reject any that carries more, so one certificate can never name several agents. The JWT-SVID specification makes aud and exp mandatory and still warns that whoever captures the token can replay it. SPIRE’s five-minute default lifetime for JWT-SVIDs narrows that window without closing it, so prefer X.509 wherever both ends can run mutual TLS. A third format builds on the IETF’s Workload Identity Token (WIT). The WIT-SVID adds proof of possession, but it is still marked Incubating, so its details may change.
How a Workload Gets an Identity Without Having One First
A workload gets its first identity from facts the platform and the kernel already hold, which is how SPIFFE answers secret zero. The SPIFFE Concepts page says the Workload API “does not require that a calling workload have any knowledge of its own identity, or possess any authentication token when calling the API.”
Node attestation happens when a SPIRE Agent starts and presents evidence only its machine can produce, such as an AWS instance identity document, a GCP instance identity token, an Azure managed identity token, or, for Kubernetes workloads, a projected service account token. The SPIRE Server verifies it with the platform and gives the agent its own SPIFFE ID.
Workload attestation happens on every Workload API call. The SPIRE Agent asks the kernel for the caller’s process ID, and attestor plugins turn it into selectors such as unix:uid:1001, or k8s:ns:billing and k8s:sa:refund-agent from the kubelet. A registration entry maps selectors to a SPIFFE ID:
spire-server entry create \
-parentID "spiffe://acme.com/spire/agent/k8s_psat/prod/${NODE_UID}" \
-spiffeID spiffe://acme.com/agents/refund-approver \
-selector k8s:ns:billing \
-selector k8s:sa:refund-agent
This entry’s parent is one SPIRE Agent, so only pods on that node qualify. To cover a cluster, create a node alias with spire-server entry create -node and a selector such as k8s_psat:cluster:prod, then parent the entry to the alias. The X.509-SVID lives one hour under SPIRE’s server defaults and is renewed before expiry, so nothing long-lived sits in the pod.
Where This Gets Hard for AI Agents
It gets hard wherever several agents share one process, because attestation identifies processes and a framework’s agents are objects inside one, all presenting the same selectors. You have three ways to give each agent its own SPIFFE ID:
- One process per agent, each under its own Unix user, so unix:uid tells them apart. It’s the cleanest boundary, at the cost of an interpreter per agent and handoffs that become calls between processes.
- One container per agent in a shared pod, told apart by k8s:container-name. Memory stays separate, but each container needs the SPIRE Agent’s socket, and the pod spec grows with every agent.
- A broker that fetches identities for the agents it hosts through SPIRE’s Delegated Identity API. Per the SPIRE Agent reference, an allowlisted delegate can impersonate any workload whose SVIDs it fetches, which makes the broker the process on the node most worth guarding.
Agents that still share a process behind that broker get attribution without isolation. SPIFFE assumes one workload can’t steal another’s credentials after issue, yet any code in a shared process, a prompt-injected tool call included, can read every agent’s key.
| The Audit Consequence When two agents share a SPIFFE ID, every log entry and policy decision naming it describes both, and nobody can tell which agent acted. Per-agent attribution starts with distinct identities, as does revoking one agent while the other keeps working. |
SPIFFE Federation: Bridging Trust Domains
Federation lets a tool in another trust domain, such as a partner’s MCP server, verify your agent’s SVID: each domain publishes its trust bundle at a bundle endpoint, and peers refresh it on a schedule so keys can rotate. The SPIFFE Federation specification defines two endpoint profiles. With https_web, the endpoint serves a publicly trusted certificate, which suits a partner on public DNS but puts Web PKI in your trust path. With https_spiffe, it presents an X.509-SVID, at the price of loading the peer’s bundle once before the first fetch.
# Inside the server block of server.conf
federation {
bundle_endpoint {
address = "0.0.0.0"
port = 8443
profile "https_spiffe" {}
}
federates_with "partner.example" {
bundle_endpoint_url = "https://spire.partner.example:8443"
bundle_endpoint_profile "https_spiffe" {
endpoint_spiffe_id = "spiffe://partner.example/spire/server"
}
}
}
SPIRE requires endpoint_spiffe_id here because it names the SVID the partner’s endpoint must present. Load the partner’s bundle with spire-server bundle set, and add -federatesWith spiffe://partner.example to each calling agent’s registration entry, or that agent never receives the bundle. The partner then knows which agent is calling, though not whether it may read the table it wants.
SPIFFE Is the Identity, Not the Access
An SVID tells a target which workload is calling and grants nothing by itself; most databases and SaaS APIs accept only their own credentials. A broker in front of the target closes the gap:
- The agent presents its SVID, over mutual TLS or as a JWT-SVID for the broker’s audience.
- The broker validates it against the agent’s trust bundle and checks policy for that SPIFFE ID.
- If policy allows, the broker creates short-lived access to the target, such as a temporary database login, and uses it inside the agent’s session.
- The access ends with the task, and the agent never sees it.
For cloud APIs, workload identity federation can make the exchange instead: a SPIFFE tutorial has AWS IAM trust SPIRE’s OIDC Discovery Provider and swap a JWT-SVID for a role, though the agent then holds temporary cloud credentials.
Akeyless SecretlessAI applies the brokered pattern for agents that never hold a secret: the agent authenticates to Akeyless, and the Akeyless Gateway opens each connection with a credential that stays on the Gateway. The Akeyless documentation lists SPIFFE/SPIRE among its workload authentication methods, and its machine identity security brokers just-in-time access for the services around your agents.
The trust root needs the same care, since SPIRE’s disk key manager keeps signing keys on the server host. The Key Manager among the Akeyless SPIRE plugins generates and manages them in Akeyless as Classic Keys, protected by a Distributed Fragments Cryptography key, which is how Akeyless protects the trust root.
Deciding Whether SPIFFE for AI Agents Fits Your Stack
Start with a question a process listing answers: does each agent run in its own process or container? If it does, and you run SPIRE or can, SPIFFE for AI agents is the right identity layer, and the first step is small. Register two agents and run spire-agent api fetch x509 from each one’s container or Unix user; once the SPIFFE IDs differ, register the rest. If your framework keeps every agent in one process, decide whether a broker holding every agent’s key is acceptable before building one.
Either way, targets still need a broker that grants access without handing over a credential, and signing keys belong somewhere stronger than the SPIRE Server’s disk. SPIFFE also doesn’t judge what an authenticated agent does next. Akeyless Agentic Runtime Authority makes that check at the Gateway, against the request that started the work, as part of Akeyless’s AI agent identity security.
FAQs About SPIFFE for AI Agents
What is a SPIFFE ID?
A SPIFFE ID is a URI naming one workload, such as spiffe://acme.com/agents/refund-approver. Its trust domain identifies whose keys sign the workload’s documents, and administrators choose the path. Every SVID carries exactly one.
What is the difference between an X.509-SVID and a JWT-SVID?
An X.509-SVID is a certificate used in mutual TLS, where the caller proves it holds the private key. A JWT-SVID is a bearer token with mandatory aud and exp claims, which anyone who intercepts it can reuse until it expires.
How does a workload get a SPIFFE identity without a credential?
Through attestation. The SPIRE Agent proves its node to the SPIRE Server with platform evidence, such as an EC2 instance identity document, then identifies each Workload API caller through the kernel and serves the SVID its selectors match.
Can two AI agents in the same container have different SPIFFE IDs?
Yes, if they run as separate processes the attestor can tell apart, such as under different Unix users matched by unix:uid selectors. Agents in one process share an ID unless a trusted broker fetches per-agent SVIDs, and that broker can act as any of them.
Does SPIFFE replace my secrets manager?
No. SPIFFE removes the secret a workload needs just to prove who it is. Databases and SaaS APIs still expect their own credentials, and SPIRE’s signing keys still need safe storage, which is the job of a platform that brokers access and holds keys.