SPIFFE ID: design workload names and trust boundaries correctly
Learn what a SPIFFE ID names, how its URI rules constrain trust domains and paths, and why a name alone proves neither identity nor permission.
SPIFFE ID: design workload names and trust boundaries correctly
A SPIFFE ID is a URI-form name that uniquely identifies a workload such as a service or process in a SPIFFE environment. Its basic form is spiffe://<trust-domain>/<workload-path>: the trust domain identifies the system that issues the identity, and the path distinguishes a workload within that namespace. A SPIFFE ID is not a private key or an access grant. A workload proves its identity by presenting a signed SPIFFE Verifiable Identity Document (SVID) containing the ID; the other party validates it against the issuer's trust bundle and then decides separately which actions to allow.
Read an example in parts
spiffe://prod.example.org/payments/api`spiffe://`: the SPIFFE URI scheme.
`prod.example.org`: the trust-domain name, indicating the trust namespace that issues and validates the identity.
`/payments/api`: a workload path defined by the trust-domain administrator. In this illustrative example, it identifies a production payments API.
The SPIFFE specification does not define what a path means. Another organization might use a structure such as ns/prod/sa/api for a namespace and service account, but that convention is not automatically validated by every SPIFFE implementation. Before using path text to grant access, make sure issuance and authorization policies agree on what it means.
Important naming constraints
The SPIFFE specification requires the URI scheme to be spiffe, a non-empty trust domain, and no query or fragment. The trust-domain authority has no userinfo or port, and its host is lowercase and contains only letters, numbers, dots, hyphens, or underscores. The path cannot contain percent-encoded characters, empty segments, . or .. segments, or a trailing slash. Path matching is case-sensitive; the scheme and trust-domain name are case-insensitive. For interoperability, implementations must support IDs up to 2048 bytes, and operators should not generate longer IDs.
A trust-domain name is not a public DNS name with a central registrar that verifies ownership. Different operators can choose the same name, which may prevent their domains from federating because they use different trust roots. If you control a registered DNS domain, using it as a suffix reduces accidental collision risk. For automatically generated names, the specification recommends a random unique value such as a UUID. If production, test, and development have different trust levels, consider separate identity namespaces and cryptographic roots.
A path is not a policy attribute
Readable path segments such as prod, admin, or payments can help people manage identities, but the name alone does not prove that an attribute is true, current, or approved. Before deriving an authorization decision from a path, verify who can issue or change that ID. Mutable organizational structure or personal attributes may belong in a separately trusted attribute source or policy instead.
| Need | Possible ID design | What to check |
|---|---|---|
| Identify a long-lived service | /payments/api | Does the ID keep the same meaning when the service is redeployed? |
| Separate environments | Distinct domains such as staging.example.org and prod.example.org | Are the trust roots and authorization policies separate too? |
| Distinguish runtime instances | A unique opaque identifier | How will ID lifecycle and observability work during scaling and restarts? |
| Represent team owner or deployment branch | Do not encode these permanently in the path | These can change; use separately verified evidence and policy. |
Issuance, validation, and use
**Choose the trust-domain owner.** Decide who manages the root keys and SVID issuance, and which environments share a trust domain.
**Define workload path rules.** Choose a stable, unambiguous, human-readable structure. Document path-segment case, word separators, and change policy.
**Use verifiable evidence to decide who receives an ID.** A SPIFFE implementation such as SPIRE can use registration selectors and node/workload attestation to determine which SPIFFE ID a process may receive. Restrict and audit registration rights because they can change what an ID means.
**Validate the SVID containing the ID.** The caller checks its format, signature, trust domain, and relevant cryptographic material. A trust bundle identifies trusted issuer keys, so bundle rotation and revocation updates must reach validators in time.
**Decide authorization after identity validation.** A valid `spiffe://prod.example.org/payments/api` ID does not by itself permit writes to a particular database; a service-to-service policy decides that.
**Test replacement and revocation.** Check when old SVIDs and bundles become invalid after workload shutdown, deployment replacement, federation removal, or root-key rotation.
For example, a payments API and an internal notification worker can receive different paths in the same production trust domain, while policy allows only the payments API to call the payment store. Sharing a trust domain does not give the two IDs the same permissions. This is an illustrative design, not a tested SPIRE deployment.
References
[SPIFFE Identity and Verifiable Identity Document Specification](https://spiffe.io/docs/latest/spiffe-specs/spiffe-id/) — SPIFFE ID format, syntax, case rules, length, SVID, and trust-domain constraints.
[SPIFFE Trust Domain and Bundle Specification](https://spiffe.io/docs/latest/spiffe-specs/spiffe_trust_domain_and_bundle/) — issuer roots, bundles, rotation, and trust-domain separation.
[SPIFFE Concepts](https://spiffe.io/docs/latest/spiffe-about/spiffe-concepts/) — workload, trust domain, SVID, and Workload API concepts.