# What Is SPIFFE? SPIFFE IDs and SVIDs Explained

> SPIFFE names workloads; an SVID proves the name. The SPIFFE ID format, X.509 vs JWT SVIDs, how to decode one, and whether SPIFFE is mTLS.

- Canonical URL: https://webofmike.com/spiffe-id-and-svid/
- Author: Mike Moore (https://webofmike.com/about/)
- Published: 2026-11-22
- Last modified: 2026-11-22
- Tags: Security, Platform Engineering, AI Agents, AI Gateways
- Cite as: Mike Moore, "What Is SPIFFE? SPIFFE IDs and SVIDs Explained", Web of Mike (webofmike.com), 2026-11-22. https://webofmike.com/spiffe-id-and-svid/

I work at Solo.io, which makes agentgateway.

SPIFFE is an open standard for naming software workloads and proving those names, and a SPIFFE ID is that name: a URI like `spiffe://example.org/ns/agents/sa/researcher`. An SVID is the document that carries a SPIFFE ID, either an X.509 certificate with the ID in its URI SAN, or a JWT whose `sub` claim is the ID. This page takes both apart, field by field, from a real SVID. It is part of the site's section on [identity for AI agents](/agent-identity/).

SPIFFE is mostly two things: a name format, and two documents that carry the name. Learn the name, then open the certificate and find it yourself. The decode below uses an X.509-SVID and a JWT-SVID issued on Nov 22, 2026 by a throwaway SPIRE 1.16.0 server, set up with the [SPIRE quickstart](https://spiffe.io/docs/latest/try/getting-started-linux-macos-x/) on Linux, in the `example.org` trust domain. Nothing in it is a real identity.

## What is SPIFFE, and what does it stand for?

SPIFFE stands for Secure Production Identity Framework for Everyone. The [SPIFFE overview](https://spiffe.io/docs/latest/spiffe-about/overview/) calls it a set of open-source standards for identifying software systems in dynamic environments. It is a set of specs, not a product. You do not install SPIFFE. You install something that implements it.

What it is for: a workload, such as an agent, a gateway or a model server, gets an identity from the platform it runs on, not from a secret someone pasted into a config file. The identity is short-lived, it can be checked by anyone who trusts the issuer, and it names the workload in a way policy can match on.

SPIRE is one implementation that issues SVIDs. How it decides who gets which ID is its own topic.

## What is a SPIFFE ID, and what format does it use?

A SPIFFE ID is a URI with three parts: the `spiffe://` scheme, a trust domain, and a path. In `spiffe://example.org/ns/agents/sa/researcher`, the trust domain is `example.org` and the path is `/ns/agents/sa/researcher`.

The trust domain is the issuer's namespace. Everything signed by one root of trust shares it. The path names the workload inside that domain. The [SPIFFE ID standard](https://github.com/spiffe/spiffe/blob/main/standards/SPIFFE-ID.md) sets the rules:

- The trust domain must be lowercase and must not contain percent-encoded characters.
- No userinfo or port in the authority part.
- The path must not contain percent-encoded characters.
- No query string and no fragment.
- Implementations must support SPIFFE URIs up to 2048 bytes and should not generate longer ones.

The path has no required structure. `ns/<namespace>/sa/<service-account>` is one common convention on Kubernetes, and it is the one used here. It is a convention, not a rule. Pick one that matches how you want to write policy, because policy will match on it.

## What is an SVID?

SVID stands for SPIFFE Verifiable Identity Document. It is the document a workload presents to prove it holds a SPIFFE ID. There are two kinds: an X.509-SVID, which is a certificate, and a JWT-SVID, which is a signed token.

The ID is in the document. What proves it is the trust bundle: the set of keys or CA certificates for the trust domain. A verifier that holds the bundle for `example.org` can check any SVID that claims an `example.org` ID. A verifier that does not hold it cannot check anything.

## X.509-SVID or JWT-SVID: what is the difference?

An X.509 certificate binds a public key to a name and is signed by a CA. That is the format TLS already uses. The X.509-SVID puts the SPIFFE ID in that certificate. The JWT-SVID puts it in a signed JSON token instead.

| | X.509-SVID | JWT-SVID |
|---|---|---|
| Where the SPIFFE ID lives | The only URI in the Subject Alternative Name | The `sub` claim |
| What proves the holder | Possession of the private key, shown in a TLS handshake | Only the signature on the token |
| Replay | A stolen certificate is useless without the key | A bearer token. Anyone holding it can present it until `exp` |
| Required limits | Validity period in the certificate | `aud` and `exp` must be present |
| Typical use | mutual TLS between services | Calls that cross an L7 proxy or load balancer between two workloads |

The [JWT-SVID standard](https://github.com/spiffe/spiffe/blob/main/standards/JWT-SVID.md) says it plainly: being a bearer token, a JWT-SVID is open to replay, and `aud` plus `exp` reduce that risk without removing it. [SPIFFE concepts](https://spiffe.io/docs/latest/spiffe-about/spiffe-concepts/) advise X.509-SVIDs whenever possible, and name an L7 proxy or load balancer between two workloads as a case where a JWT-SVID may be the only option.

## How do you decode an SVID?

With `openssl` and a few lines of Python. Both run locally, so the document never leaves your machine. Avoid pasting a live token into a web decoder.

The SPIRE agent wrote three files: `svid.0.pem` (the certificate), `svid.0.key` (its private key) and `bundle.0.pem` (the trust bundle).

### Decode an X.509-SVID

```text
$ openssl x509 -in svid.0.pem -noout -ext subjectAltName,basicConstraints,keyUsage,extendedKeyUsage
X509v3 Key Usage: critical
    Digital Signature, Key Encipherment, Key Agreement
X509v3 Extended Key Usage:
    TLS Web Server Authentication, TLS Web Client Authentication
X509v3 Basic Constraints: critical
    CA:FALSE
X509v3 Subject Alternative Name:
    URI:spiffe://example.org/ns/agents/sa/researcher
```

Read four things:

1. **Subject Alternative Name.** Exactly one `URI:` entry, and it is the SPIFFE ID. The [X.509-SVID standard](https://github.com/spiffe/spiffe/blob/main/standards/X509-SVID.md) requires exactly one URI SAN.
2. **Basic Constraints.** `CA:FALSE`. A leaf SVID is not allowed to sign other certificates.
3. **Key Usage.** `Digital Signature` must be there. `Key Encipherment` and `Key Agreement` are allowed on a leaf. `Certificate Sign` and `CRL Sign` must not be.
4. **Validity.** From the full `-text` output: `Not Before: Nov 23 04:27:04 2026 GMT`, `Not After : Nov 25 04:27:14 2026 GMT`. The quickstart's server config sets `default_x509_svid_ttl` to 48h.

Now look at what the full `-text` output shows as the subject:

```text
        Issuer: C=US, O=SPIFFE, serialNumber=94711799188949518237829453434119572654
        Subject: C=US, O=SPIRE
```

The SPIFFE ID is not in the subject. Every SVID from this server has the same subject. Anything that authorizes on the certificate subject is authorizing on a string that says nothing about the workload.

Then check the chain against the trust bundle:

```text
$ openssl verify -CAfile bundle.0.pem svid.0.pem
svid.0.pem: OK

$ openssl x509 -in bundle.0.pem -noout -subject -ext subjectAltName,basicConstraints,keyUsage
subject=C=US, O=SPIFFE, serialNumber=94711799188949518237829453434119572654
X509v3 Key Usage: critical
    Certificate Sign, CRL Sign
X509v3 Basic Constraints: critical
    CA:TRUE
X509v3 Subject Alternative Name:
    URI:spiffe://example.org
```

The bundle certificate is the mirror image: `CA:TRUE`, `Certificate Sign`, and a SPIFFE ID that is the bare trust domain, with no path.

### Decode a JWT-SVID

A JWT is three base64url parts separated by dots: header, payload, signature. This prints the first two:

```text
$ python3 -c 'import sys,base64,json; h,p,s=sys.stdin.read().strip().split("."); [print(json.dumps(json.loads(base64.urlsafe_b64decode(x+"="*(-len(x)%4))),indent=2)) for x in (h,p)]' < jwt.txt
{
  "alg": "ES256",
  "kid": "885oEgehiBLVBNq7JLZ9Jgmo3aXFMbAY",
  "typ": "JWT"
}
{
  "aud": [
    "mcp-gateway"
  ],
  "exp": 1795408335,
  "iat": 1795408035,
  "sub": "spiffe://example.org/ns/agents/sa/researcher"
}
```

- `sub` is the SPIFFE ID.
- `aud` is who the token is for. It was fetched with `spire-agent api fetch jwt -audience mcp-gateway`.
- `exp` minus `iat` is 300 seconds. This token was good for five minutes.
- `kid` names the key in the trust bundle that signed it. The verifier looks it up there.

Decoding is not verifying. Anyone can decode a JWT. Only the signature check against the bundle says it is real.

## What must a verifier check?

From the specs, in order:

1. **The chain or signature.** An X.509-SVID must chain to the trust bundle for its trust domain. A JWT-SVID's signature must verify with a key from that bundle, and its `alg` must be one the standard allows.
2. **The leaf rules.** For X.509: `CA:FALSE`, no `Certificate Sign`, no `CRL Sign`.
3. **The JWT limits.** `aud` contains you, and `exp` has not passed. A token without either is rejected.
4. **Then authorize on the SPIFFE ID.** Not on the subject, and not on "it chained, so it is fine". A valid SVID says who is calling. It does not say what that caller may do.

## Is SPIFFE mTLS?

No. SPIFFE defines workload identity: the name, the documents, and how to trust them. X.509-SVIDs are often used as the certificates in mutual TLS, because each side can present one and check the other's. JWT-SVIDs are not used for mTLS at all. SPIFFE is not a transport protocol. It is what mTLS can use to know who is on the other end.

If you are comparing it with tokens issued by an authorization server, [SPIFFE vs OAuth for AI agents](/spiffe-vs-oauth-for-ai-agents/) is that question.

## How does agentgateway check an SVID?

agentgateway v1.5.0 added SPIFFE Workload API support: it gets its own SVID and the trust bundle from the local socket, requires client certificates on the listener, and verifies them against the bundle. The verified SPIFFE ID is then available to CEL authorization rules as `source.spiffeId`. The full working setup, including a valid SVID that still gets a 403, is in [SPIFFE for AI agents, end to end](/spiffe-identity-for-ai-agents/).

## Where does this fit with the rest of agent identity?

An SVID is one way for an agent to prove what it is without holding a long-lived secret. [Secretless AI agents](/secretless-ai-agents/) is the case for doing that at all. [Workload identity federation for agents](/workload-identity-federation-agents/) covers trading a platform identity for a credential a cloud API accepts. The SPIFFE ID is the name all of those end up matching on.

