All chapters
  1. Start hereA valid token is not a permission
  2. Foundations · 1Identity and trust primitives: who is calling, and who checks
  3. Foundations · 2People and identity proofing: accounts, passwords and recovery
  4. Foundations · 3Sessions and browser security: cookies, CSRF, XSS and the BFF
  5. Foundations · 4Authenticators and MFA: passwords, passkeys and phishing resistance
  6. Foundations · 5API keys and application credentials: what a key proves
  7. Foundations · 6Tokens: bearer, JWT anatomy, validation and revocation
  8. Foundations · 7OAuth, OpenID Connect and federation: delegation and login
  9. Authorization · 8Authorization from first principles: subject, action, resource, context
  10. Authorization · 9Access control models: RBAC, ABAC, ReBAC and ownership
  11. Authorization · 10The enforcement architecture: PEP, PDP, PIP and PAP
  12. Authorization · 11Policy as code: versions, tests, engines and decision logs
  13. Authorization · 12Tenant and data isolation: one platform, many brokerages
  14. Authorization · 13Identity governance and lifecycle: joiner, mover, leaver
  15. Authorization · 14Privileged access: standing rights, just-in-time elevation and break-glass
  16. Workloads · 15TLS, PKI and certificates: proving a host, and a client
  17. Workloads · 16Workload and service identity: SPIFFE, mTLS and caller allowlists
  18. Workloads · 17API gateways and zero trust: the edge checks, the service decides
  19. Workloads · 18Event-driven identity: Kafka principals, ACLs and replay
  20. Workloads · 19Cloud IAM and secretless deployment: roles, federation and no stored keys
  21. Workloads · 20External SaaS, webhooks and trust: calls that cross company lines
  22. Workloads · 21Private controlled environments: what private networking does and does not secure
  23. AI-native · 22Authenticating to model providers: keys, gateways and cloud IAM
  24. AI-native · 23MCP identity and authorization: discovery is not permission
  25. AI-native · 24RAG and retrieval authorization: only what this caller may read
  26. AI-native · 25Agents as principals and delegates: whose authority is this?
  27. AI-native · 26Agent-to-agent trust: identity, capabilities and forwarded authority
  28. AI-native · 27Coding agents and CI: repository scopes, OIDC and no production keys
  29. Operations · 28Auditing and observability of access: decisions you can prove later
  30. Operations · 29Threat modeling and testing: the negative tests that prove access control
  31. Operations · 30Operational lifecycles: rotation, revocation and outages
  32. Reference · 31Standards, frameworks and products: what each one is, and what it is not
  33. Reference · 32Architecture decision playbooks: choosing an auth strategy
  34. ReferenceGlossary
  35. AboutAbout this site and its sources
Workloads · 16

Workload and service identity: SPIFFE, mTLS and caller allowlists

A service proves what it is with a short-lived identity document, not a header. SPIFFE IDs and SVIDs, mTLS identity, signed workload assertions, application ids as metadata, receiving-service allowlists and identity propagation.

You will name
A workload with a SPIFFE ID, carried in a short-lived SVID it received without any secret in its image.
You will decide
At the receiving service, with a caller allowlist keyed on the verified id, never on an x-app-id header.
You will carry
Two identities on one call, the workload and the person it acts for, without letting either impersonate the other.

A platform ticket proposes a tidy-up. The intake agent and the underwriting agent run in the same namespace, are deployed by the same team, and call mostly the same services. Why maintain two identities? Run both under one service account, uw-agents, issue one certificate for it, and put that one name on every allowlist.

A reviewer asks one question before approving: "When the quote service sees a call from uw-agents asking to record a recommendation for SUB-1004, which agent is it?"

Nobody can answer, because the design has erased the difference. The intake agent turns a broker's request into a submission and, in the example, holds only uw.read. The underwriting agent may record a recommendation inside a delegated task. With one shared name, the quote service either lets both record recommendations or neither. The allowlist, the audit record and every incident investigation lose the one fact they depend on: which program acted.

The ticket is the mistake this page is about. It confuses "deployed together" with "the same principal". The example keeps the corrected state: spiffe://insurer.example/ns/uw/sa/intake-agent and spiffe://insurer.example/ns/uw/sa/underwriting-agent are two identities, each with its own certificate and its own rows on each allowlist.

A workload is a principal too#

A workload is a running program with one job: the quote service, the underwriting agent, a nightly export. Standard (SPIFFE concepts, read 2026-11-18): "a single piece of software, deployed with a particular configuration for a single purpose". Workload identity is the verified name such a program proves when it calls another one, the way a person proves a username with a passkey.

A tiny example: the underwriting agent calls the quote service. The quote service does not ask "which person is this?" first. It asks "which program is on the other end of this connection?", and the answer must come from a credential the program holds and the quote service can verify, not from a field the program typed.

Unlike a person, a workload starts, restarts and scales out with nobody there to type anything, so its credential must arrive automatically, be short-lived, and never be a password copied into a container image.

Before AI. Enterprise Java ran on service accounts for decades: a database user per application, an LDAP account with a password in a properties file, a Kerberos keytab on the host. Each was a workload identity. Each also leaked in the same ways: passwords copied between environments, one account shared by five applications, a keytab still valid years after the application was retired. Modern workload identity keeps the idea and removes the stored secret.

The smallest primitive: a SPIFFE ID#

The smallest useful workload identity is a name with a fixed shape that every service in the organization parses the same way. Standard (SPIFFE, read 2026-11-18): "A SPIFFE ID is a string that uniquely and specifically identifies a workload", with the form spiffe://<trust domain>/<workload identifier>.

spiffe://insurer.example/ns/uw/sa/underwriting-agent
         └── trust domain ┘└── workload identifier ───┘

The trust domain, insurer.example, says which authority issued the name. Standard (SPIFFE concepts): "The trust domain corresponds to the trust root of a system." The path is the workload's name inside that domain; the example's /ns/uw/sa/... shape is a convention, not a requirement. Standard (SPIFFE-ID, read 2026-11-18): the ID "MUST NOT include a query or fragment component", and trust domain names "MUST contain only letters, numbers, dots, dashes, and underscores".

PrincipalSPIFFE ID in the example
intake agentspiffe://insurer.example/ns/uw/sa/intake-agent
underwriting agentspiffe://insurer.example/ns/uw/sa/underwriting-agent
cockpit BFFspiffe://insurer.example/ns/uw/sa/cockpit-bff
quote servicespiffe://insurer.example/ns/uw/sa/quote

A name is still only a claim. It becomes an identity when it arrives inside a document the receiver can verify.

SVIDs: the document that carries the name#

Standard (SPIFFE concepts): an SPIFFE Verifiable Identity Document, an SVID, "contains a single SPIFFE ID", and comes in two formats.

An X.509-SVID is an X.509 certificate with the SPIFFE ID in its SAN. Standard (X.509-SVID, read 2026-11-18): the SPIFFE ID "is set as a URI type in the Subject Alternative Name extension"; "An X.509 SVID MUST contain exactly one URI SAN", and validators seeing more than one "MUST reject the SVID". It is used in an mTLS handshake, so the quote service learns the caller's id from the connection itself. Every check from TLS and PKI applies: chain, validity, SAN, key possession.

A JWT-SVID is a signed token. Standard (JWT-SVID, read 2026-11-18): "The sub claim MUST be set to the SPIFFE ID of the workload"; "The aud claim MUST be present"; "The exp claim MUST be set, and validators MUST reject tokens without this claim." "Single audience JWT-SVID tokens are strongly recommended to limit the scope of replayability."

The two differ in one property that matters a great deal. An X.509-SVID proves itself with a fresh handshake signature; a JWT-SVID is a bearer token that works for whoever presents it. Standard (SPIFFE concepts): "it is advised to use X.509-SVIDs whenever possible" because "tokens are susceptible to replay attacks." Use a JWT-SVID where TLS does not reach end to end, for example through a proxy that terminates TLS, and keep its audience to one service and its life short.

The example's own workload token is a signed workload assertion of the same family. The snippet prints the claims of the underwriting agent's demo token, the one agent.py presents as the actor in token exchange. It is not a JWT-SVID: the example puts the directory id in sub and the SPIFFE ID in a spiffe_id claim, where a JWT-SVID puts the SPIFFE ID in sub. The tokens are HMAC-signed teaching tokens with keys that say they are not secrets; use a maintained library and a real issuer in production.

import json

import demo_keys
import tokens
from clock import START_EPOCH_S as NOW

# The agent's own workload token (a signed workload assertion), as agent.py issues it for the token endpoint.
tok = tokens.issue_for("wl-underwriting-agent", aud=tokens.STS_AUDIENCE, now=NOW, seed="workload")
v = tokens.verify(tok, keyset=demo_keys.keyset(), expected_issuer=tokens.ISSUER,
                  expected_audience=tokens.STS_AUDIENCE, now=NOW)
keep = ["iss", "sub", "aud", "exp", "principal_type", "spiffe_id", "scope", "business_unit"]
print("valid:", v["valid"])
print(json.dumps({k: v["claims"][k] for k in keep}, indent=2))

Run in a scratch copy of examples/uw-auth on 2026-11-18 (the agent here is a scripted stand-in, so these results show how the access controls work, not how good any model is):

valid: True
{
  "iss": "https://idp.insurer.example",
  "sub": "wl-underwriting-agent",
  "aud": "https://idp.insurer.example/token",
  "exp": 1794993300,
  "principal_type": "agent",
  "spiffe_id": "spiffe://insurer.example/ns/uw/sa/underwriting-agent",
  "scope": "uw.read uw.recommend",
  "business_unit": "commercial-west"
}

Notice the audience: the token endpoint only, so the assertion cannot be replayed at the quote service. One audience per assertion is the most useful rule for signed workload tokens.

How a workload gets its SVID without holding a secret#

Baking a private key into the agent's image, or mounting it from a shared volume, turns the key into a file anyone with the image can copy. The SPIFFE answer inverts the flow: the workload asks a local endpoint, and the endpoint decides who the workload is by looking at it from the outside.

Standard (SPIFFE concepts): the Workload API "does not require that a calling workload have any knowledge of its own identity", so "your application need not co-deploy any authentication secrets with the workload." Standard (SPIFFE Workload Endpoint, read 2026-11-18): the endpoint "MUST NOT require any direct authentication of its clients" and "SHOULD perform out-of-band authenticity checks" such as "kernel introspection or orchestrator interrogation"; implementations "SHOULD prefer Unix Domain Socket transport", and every request must carry the gRPC metadata key workload.spiffe.io with value true, a hardening measure against server-side request forgery (a program tricked into calling the endpoint for someone else).

SPIRE is the reference implementation. Product (SPIRE, as documented on 2026-11-18): "a production-ready implementation of the SPIFFE APIs", a CNCF graduated project, latest release v1.16.0 (5 November 2026). Its parts:

Diagram: How the underwriting agent gets its SVID · no secret in the image, trust from the outside

Time runs down the page. First the node proves itself: the SPIRE agent on the node presents a platform-signed document to the SPIRE server, which checks it and accepts the node. Then the underwriting agent starts and asks the local Workload API for its identity, over a Unix domain socket, without presenting any credential. The SPIRE agent inspects the calling process from outside, matches what it sees against a registration entry, and hands over an X.509-SVID with a fresh private key and the trust bundle. The agent then uses that SVID in mTLS to the quote service, which still checks its allowlist.

  1. SPIRE agent (on the node) to SPIRE server: node attestation: platform-signed document. The node agent proves which node it is with something the platform vouches for.
  2. SPIRE server to SPIRE agent (on the node): node accepted; entries for this node. The server learns which registration entries the agent may serve.
  3. Underwriting agent (process) to SPIRE agent (on the node): FetchX509SVID over UDS, no credential. The workload authenticates nothing itself; the request carries the metadata workload.spiffe.io true.
  4. SPIRE agent (on the node): workload attestation: who is this process?. Kernel and orchestrator facts about the caller are matched against selectors in a registration entry.
  5. SPIRE agent (on the node) to Underwriting agent (process): X.509-SVID + private key + trust bundle. Delivered over the local socket, short-lived, renewed automatically.
  6. Underwriting agent (process) to Quote service: mTLS with the SVID. The handshake gives the quote service a verified SPIFFE ID.
  7. Quote service to Underwriting agent (process): allowlist decides the operation. Identity is established; permission is a separate question.

Read the diagram for where trust comes from. The node proves itself with something the platform vouches for. The agent process proves nothing itself; the node agent inspects it and matches a reviewed registration entry. The key arrives over a local socket and never sits in an image or a repository.

That is also where the opening ticket would have done its damage. A registration entry maps selectors to one SPIFFE ID. If the selector is a service account shared by two agents, both receive the same name, and nothing later in the system can tell them apart. This site's recommendation: one SPIFFE ID per workload purpose; give each agent its own service account (or other selector) so attestation can distinguish them.

x-app-id is metadata: where it still helps, and where it must stop#

Primitives showed the forged header once: UW-A04, an unauthenticated script sends x-app-id: svc-cockpit-bff and a service that trusts the header returns a quote. This section asks the next question. Many enterprise platforms run on a "requestor application id": every caller sends its app id in a header, and every service keeps a list of app ids it accepts. Is that pattern wrong?

The list is right; the source of the id is wrong. An x-app-id header is a value the caller chooses, so it identifies the caller only if the caller is honest. The fix keeps the allowlist and changes where the id comes from: the receiving service takes the caller's identity from the verified peer (the SPIFFE ID from mTLS, or a verified signed assertion), and treats any app id header as metadata at most.

The snippet replays UW-A04 in both designs through services.py request_path. It demonstrates what the quote service records as the credential and the subject in each. It does not run TLS; "requires the mTLS peer id" means the quote service accepts identity only from a verified certificate in this simulation.

import services
from clock import START_EPOCH_S as NOW

for label, toggles in [("service trusts the header", {"forged_app_id": True, "trust_header": True}),
                       ("service requires the mTLS peer id", {"forged_app_id": True})]:
    r = services.request_path("own", toggles, now=NOW)
    svc = r["hops"][2]
    print(label, "->", r["outcome"])
    print("   credential:", svc["credential"])
    print("   subject:   ", svc["subject"], "| decided_by:", svc["decided_by"])
service trusts the header -> {'status': 200, 'data_returned': True, 'leaked': True}
   credential: x-app-id header (claimed: svc-cockpit-bff)
   subject:    svc-cockpit-bff (claimed, never verified) | decided_by: nobody
service requires the mTLS peer id -> {'status': 401, 'data_returned': False, 'leaked': False}
   credential: no verified peer identity (mTLS required)
   subject:    unknown | decided_by: svc-quote

The second design is not "ignore the header". The header may still be useful as a label: a dashboard grouping, a rate-limit key that is checked against the verified id, a hint in a log. This site's recommendation: derive the caller id from the verified credential; if a header is present, compare it with that id and reject a mismatch with 401, recording both values in clearly named fields (peer_id verified, claimed_app_id as sent). A mismatch is a signal worth an alert, because honest callers never send one.

The four-hop lab starts on the forged_mtls preset; switch to forged to see the header trusted.

PresetOwn quote Q-5531Other tenant's Q-6620What it shows
forged200, returned to an unauthenticated script (nobody decided)200, leaked (nobody decided)A plain x-app-id header is metadata, not proof: the service that trusted it returned the quote.
forged_mtls401 (svc-quote)401 (svc-quote)Requiring the mTLS peer identity refuses the forged header: identity comes from a verified credential.
default200 (PDP rule R-AZ-03)404 (PDP rule R-AZ-03)A valid token is not a permission: the service asked the PDP about this quote and answered 404, without revealing it exists.
Common confusion. "We sign the app id header at the gateway" moves the problem rather than solving it. A signed header proves the gateway said so; the service must still verify the gateway's own identity on the connection and make sure no other path reaches it. Guideline (OWASP Microservices Security Cheat Sheet, read 2026-11-18): "A signature protects an assertion's integrity; it does not itself grant access to a requested resource."

The receiving service's caller allowlist#

Once the quote service knows the caller's verified id, it still has to decide whether that caller may call the operation at all. A caller allowlist is the receiving service's own list: for each operation, which workload ids may call it. Everything not listed is denied.

The example's allowlist, in mtls.py:

ALLOWLIST: dict[str, list[str]] = {
    "submission.read": [AGENT_ID, COCKPIT_ID],
    "decision.record": [COCKPIT_ID],
}

Two properties make it work. It is owned by the receiving service, because only the team that owns decision.record knows who should carry decisions; a central team may review it, but the quote service enforces it. And it is keyed on verified ids, so editing a header changes nothing. The lab below starts on the allowlist scenario: the agent's handshake succeeds and decision.record is refused.

ScenarioCertificateClockOperationHandshakeOperation decision
valid-readagent-2026a09:00Zsubmission.readestablishedallow 200
allowlistagent-2026a09:00Zdecision.recordestablisheddeny 403: not on the allowlist for decision.record
cockpit-decidecockpit-202609:00Zdecision.recordestablishedallow 200
wrong-sanquote-server09:00Zsubmission.readrefused at SANdeny 401
untrusted-carogue-agent09:00Zsubmission.readrefused at chain (CN=Unknown CA not trusted)deny 401

Notice the status codes. A caller with no verified identity gets 401: the quote service does not know who it is. A verified caller that is not listed gets 403: the quote service knows exactly who it is and says no.

An allowlist is coarse on purpose. It says "the cockpit BFF may submit decisions", never "this underwriter may decide this submission". The finer question needs the person, the record and the policy, which is the next section.

Two identities on one call: propagation#

When the underwriting agent reads roof data for SUB-1004, two principals are involved. The agent is the program making the call. The underwriter u-uw-w1 is the person the work is for. Identity propagation is carrying the second identity across the hop without letting the first one pretend to be it.

Each identity travels in its own credential. The workload identity travels in the connection (the X.509-SVID in mTLS). The person's authority travels in a token. And that token must not be the underwriter's own token forwarded as is, which would carry the wrong audience and uw.decide. The agent application obtains a narrower delegated token by token exchange. Standard (RFC 8693, read 2026-11-18): in delegation "the actor keeps its own identity", recorded in an act claim; in impersonation the actor is indistinguishable from the subject. OAuth and OIDC runs that exchange (UW-A22); this section shows what the receiving service does with the two identities once both arrive.

The snippet builds the delegated token with agent.py delegated_token, then asks four questions in order at the receiving side. Steps 1, 3 and 4 use the example's functions. Step 2, the binding check, is written for this page and is not part of the example: it confirms that the token's actor is the same workload as the verified peer. A successful run proves the four checks are separate and each can refuse; it does not prove anything about a real token service or TLS stack.

import agent
import demo_keys
import mtls
import services
import tokens
from clock import SimClock
from directory import PRINCIPALS, resource_for

clock = SimClock()
now = clock.now()
d = agent.delegated_token(clock)
claims = tokens.verify(d["exchange"]["response"]["access_token"], keyset=demo_keys.keyset(), expected_issuer=tokens.ISSUER,
                       expected_audience=tokens.MCP_AUD, now=now)["claims"]

# Layer 1: which workload is on the other end of the connection? (mTLS handshake, synthetic certificate)
peer = mtls.verify_peer(mtls.chain_for("agent-2026a"), mtls.TRUST_BUNDLE, None, now)
print("1 peer (mTLS):     ", peer["peer_id"])
# Layer 2: does the token's actor belong to that same workload? (binding check written for this page)
actor = claims["act"]["sub"]
bound = PRINCIPALS[actor]["spiffe_id"] == peer["peer_id"]
print("2 token actor:     ", actor, "-> spiffe id matches peer:", bound)
# Layer 3: may that peer call this operation at all? (the receiving service's allowlist)
print("3 caller allowlist:", mtls.authorize_peer(peer["peer_id"], "submission.read", mtls.ALLOWLIST)["status"])
# Layer 4: may this subject read THIS record? (the policy decision point, on the record)
subject = services.subject_from_claims(claims, now=now)
print("4 subject:         ", subject["principal_id"], "on behalf of", subject["delegation"]["on_behalf_of"])
for action, sid in (("submission.read", "SUB-1004"), ("assessment.read", "SUB-1004"), ("assessment.read", "SUB-1007")):
    r = services.pep_decide(subject, action, resource_for(sid, "submission"), {"now": now})
    print("  ", action, sid, r["status"], r["rule"], r["reason"])
1 peer (mTLS):      spiffe://insurer.example/ns/uw/sa/underwriting-agent
2 token actor:      wl-underwriting-agent -> spiffe id matches peer: True
3 caller allowlist: 200
4 subject:          wl-underwriting-agent on behalf of u-uw-w1
   submission.read SUB-1004 403 R-AZ-05 action submission.read is not in the delegated task
   assessment.read SUB-1004 200 R-AZ-05 agent acting for u-uw-w1 inside its delegated task
   assessment.read SUB-1007 403 R-AZ-05 submission SUB-1007 is outside the delegated task (task names SUB-1004)

Each line narrows. The connection says "the underwriting agent", the token's actor agrees, and the allowlist lets this workload call submission.read in general. Still the policy decision point refuses submission.read, because the delegated task lists only assessment.read, guidance.search, precedent.search and recommendation.record. It allows assessment.read on SUB-1004, the task's submission, and refuses it on SUB-1007, the peer underwriter's. The workload's identity opened the building; the person's delegated task chose the room. (In a real deployment the two assessment.read decisions belong to the assessment service, which keeps its own allowlist; the example runs every decision through the same policy decision point.)

Diagram: Four questions on one agent call · each layer is blind to what the next one checks

Rows are the four checks the receiving side makes when the underwriting agent, acting for underwriter u-uw-w1, calls for submission data. Columns are where the answer comes from, who answers, and what that layer cannot know. Read down the right column: the handshake does not know the person, the binding check does not know the operation, the allowlist does not know the record, and only the policy decision point sees subject, task and record together.

  1. 1 Which workload?
    1. X.509-SVID in mTLS: The verified client certificate and the handshake signature.
    2. TLS layer of the quote service: Chain, validity, SAN and key possession.
    3. which person the work is for: A certificate names a program, never the underwriter behind the task.
  2. 2 Same workload?
    1. act claim + verified peer: The delegated token's actor must be the workload on the connection.
    2. receiving service: A name comparison, or a certificate hash in the token (x5t#S256) that the service checks.
    3. whether the operation is allowed: Matching identities say nothing about the operation.
  3. 3 May it call this?
    1. receiver's own list: Operation to exact verified ids, deny by default, owned by the receiving team.
    2. quote service: Checks the verified id against the list.
    3. which record, which task: The list is coarse: it allows a caller for an operation in general.
  4. 4 May it act on this record?
    1. subject + task + record: Subject from the delegated token, the task claim, and the record's attributes.
    2. policy decision point: Applies the rules, here R-AZ-05 for a delegated agent.
    3. nothing needed from headers: Every input came from a verified credential or the directory.

The diagram lays the four questions side by side with who answers each and what each refusal looks like. The important observation is the column "what it cannot know": every layer is blind to something the next layer checks.

Step 2 compared names. A stronger design, RFC 8705 certificate-bound tokens, makes the token unusable on any other connection; the first folded block under "Advanced perspective" shows it.

In our insurance example. The quote service, the assessment service and the tool server each verify the caller's SPIFFE ID, check their own allowlist, and then ask the policy decision point with the subject built from the delegated token. The audit record names both: principal_id wl-underwriting-agent and on_behalf_of u-uw-w1. The model writes a tool request; the agent application sends it with the agent's credentials; it never sees a key.

Service account boundaries#

Back to the opening ticket. Its proposal failed because one identity would have covered two purposes. A service account boundary is the line that keeps one workload's identity from being used by another, and it has to hold at three levels.

At issuance. The registration entry, or the cloud's equivalent binding, must select exactly the workload it names. A selector on a shared service account, a shared namespace with no further selector, or a node-wide identity gives every process the same name.

At the trust domain. Production and staging should not share a trust domain. Standard (SPIFFE concepts): the concepts page advises separate trust domains for different environments such as production and staging. Then a staging agent, however compromised, holds no name the production quote service accepts.

At the receiver. No allowlist entry should use a wildcard that admits "any workload in ns/uw". The reviewer of an allowlist change asks which exact ids it adds.

DesignWho can present the nameWhat the allowlist can express
one service account for both agents (the ticket)intake agent and underwriting agentboth or neither
one SPIFFE ID per agent (the example)only the attested agentintake agent: read; underwriting agent: read, recommend in a task
one node identity for every process on a hostanything on the hostalmost nothing
a scheduled job with its own idonly that jobexactly the job's operations; no person involved

The last row matters as much as the first. A scheduled export has no person behind it. This site's recommendation: give the job its own workload identity and nothing else; never mint a fake person for it, and never require a user token where no user exists.

Choosing a workload identity design#

SituationSimplest credible choiceGrow when
two or three services, one teammTLS with an internal CA, one certificate per service, an allowlist at each receivercertificates are renewed by hand, or a second team arrives
many services, several teams or clustersSPIFFE IDs issued by SPIRE (or the platform's equivalent) through attestation, X.509-SVIDs, allowlists owned by receiverscallers need per-person authority: add delegated tokens
a hop where TLS terminates in betweena JWT-SVID or signed workload assertion with one audience and a short lifethe proxy can pass mTLS through: move back to X.509-SVIDs
an agent acting for a personthe agent's workload identity on the connection plus a delegated token with act from token exchangehigh-value writes: bind the token to the certificate (RFC 8705), require approval
workloads calling cloud APIsthe cloud's workload identity federationcross-cloud: federate trust, keep one identity per purpose
What this is not. This page is about who a calling program is. What a gateway in front of the services checks, and why zero trust is not a product, is on Gateways and zero trust. Delegation chains, task tokens and approvals for agents are on Agents.
In a coding agent. A coding agent's runner is a workload too. In CI it proves its identity to the cloud with an OIDC token from the CI platform, federated to a narrowly scoped role, instead of a stored key; a repo-scoped GitHub App installation, not a personal token, gives it repository access. The pull request it opens is merged by a person with merge rights. Coding agents and diff-to-deploy.sammuthu.com own the details.

Security notes#

Monday checklist#

  1. List every workload identity in one environment and the workloads that can present each. Any identity presented by two workloads is a finding.
  2. Search every service for headers used as caller identity (x-app-id, x-service-name, x-caller). For each, find the verified credential that replaces it, and add a mismatch check.
  3. For one sensitive operation, print its allowlist. Confirm it names exact ids, that the owning team approves changes, and that an unlisted verified caller gets 403.
  4. Find any private key or service account key inside a container image, repository or shared volume, and plan its replacement with attestation-issued credentials.
  5. Check that the audit record of an agent call names both the workload (principal_id) and the person (on_behalf_of).

Exercises#

1. The quote service receives a request over mTLS from spiffe://insurer.example/ns/uw/sa/intake-agent with the header x-app-id: svc-cockpit-bff, asking for decision.record. What does it answer, and what does it record?

AnswerReject the mismatch; the verified id decides

The verified peer is the intake agent; the header disagrees. Under this page's recommendation the mismatch is refused with 401 and both values are recorded separately. Even ignoring the header, the intake agent is not on the allowlist for decision.record (403).

2. Why does the example's delegated token not let the underwriting agent read SUB-1007, although the agent's workload identity is on the quote service's allowlist for submission.read?

AnswerThe allowlist is coarse; the task is specific

The allowlist says the agent may call the operation in general. The policy decision point reads the delegated task, which names SUB-1004 and four actions; SUB-1007 is outside it, so rule R-AZ-05 refuses with 403.

3. A team wants one JWT-SVID with audiences for the quote, assessment and retrieval services, "to save round trips". What is the risk?

AnswerReplay across services

A JWT-SVID is a bearer token. Any one of those services, or anyone who copies the token from it, can replay it at the other two. The JWT-SVID standard strongly recommends a single audience to limit replayability.

Advanced perspective#

Binding the delegated token to the workload: RFC 8705A copied token fails on any other connection

The binding check in the propagation snippet compared names. A stronger design makes the token unusable by anyone but the workload it was issued to. Standard (RFC 8705, read 2026-11-18): a certificate-bound access token carries a cnf claim whose x5t#S256 member is the SHA-256 hash of the client certificate, and the resource server "MUST verify that the certificate matches the certificate associated with the access token". The agent's delegated token would then name agent-2026a's certificate hash, and a copy presented over another connection fails with 401 invalid_token. Plan for rotation: when the agent switches to agent-2026b, tokens bound to the old certificate stop working, so token lifetime must not outlast the certificate overlap. Tokens compares this with DPoP.

Across trust domains: SPIFFE federationSeparate bundles, separate allowlist rows

A partner's workloads live in another trust domain with another root. Standard (SPIFFE Federation, read 2026-11-18): "SPIFFE Federation enables the authentication of identity credentials (SVIDs) across trust domains." Each domain publishes its bundle at a bundle endpoint, "an HTTPS URL that responds to an HTTP GET with a SPIFFE bundle", and "Bundle contents from different trust domains MUST NOT be merged into a single, larger bundle." Clients poll at the bundle's spiffe_refresh_hint, or every five minutes if it is unset. Keeping bundles separate lets the verifier insist that a certificate chaining to the partner's root carries a SPIFFE ID in the partner's trust domain; a merged bundle would let the partner's CA mint names in insurer.example. Federation authenticates and authorizes nothing, so partner ids go on allowlists one by one. Cloud platforms accept workload identities in the same spirit. Product (Microsoft Entra workload identity federation, as documented on 2026-11-18): the listed scenarios include SPIFFE/SPIRE, and the federated credential's "issuer, subject, and audience values must case-sensitively match" the token's. Cloud IAM owns how workloads reach cloud APIs without stored keys.

Attestation is only as strong as its selectorsWhat the node agent can actually observe

Workload attestation answers "who is this process?" from facts the node can observe: a Unix user id, a container image digest, a Kubernetes namespace and service account, a pod label. Some selectors are strong (an image digest, which changes with every build), some are weak (a label anyone who can deploy can set). A registration entry that selects on a label grants the identity to everyone with deploy rights in that namespace. Review registration entries as you would review a role grant: who can create a workload that matches these selectors? The node attestation step has the same shape one level down: the node's identity is only as good as the platform document it presented. And the person who can write registration entries can mint any identity, so that permission belongs with privileged access, behind approval and audit (Privileged access).

Mesh identity versus application identityWhen a sidecar terminates mTLS for the application

In a service mesh, a sidecar proxy beside each workload performs mTLS, so the application code never handles certificates. The application still needs the verified peer identity to apply its allowlist and to write it into the audit record. Pattern: the sidecar passes it in a header on the local connection (how a given mesh does this is product-specific and not covered by the sources read here). That header is safe only because the local connection cannot be reached from the network and the sidecar overwrites any incoming header of the same name; if a workload can be reached around its sidecar, the header becomes x-app-id again. Check both properties when you adopt a mesh. Mesh authorization policies can enforce coarse caller allowlists close to the workload, which is useful; they cannot see records, so they never replace the policy decision point (Gateways and zero trust).

Long call chains: whose identity at hop three?Re-exchange per hop, record the chain, never widen

When the tool server calls the assessment service on behalf of the agent acting for the underwriter, there are three principals. Forwarding the incoming token unchanged would give the assessment service a token minted for someone else's audience. Pattern: at each hop, the calling service exchanges the token it holds for one whose audience is the next service, with equal or fewer scopes; RFC 8693 records earlier actors in nested act claims, least recent most deeply nested, and only the outermost actor counts for access control. Each receiver authenticates its immediate caller by mTLS, reads the delegated subject from the token, and records the whole chain in the audit record. The rule that keeps chains safe is monotonic narrowing: no exchange may return more scope, a wider audience or a longer life than the token it consumed. Agents and A2A take this further.

Removing a workload identity in a hurryShort SVIDs, entry deletion, allowlist removal

A compromised workload should lose its identity within minutes. Three levers exist, and they act at different speeds. Deleting the registration entry stops new SVIDs, but the one already issued lives until it expires, which is why SVID lifetimes are short; the SPIFFE concepts pages read here do not state a default lifetime, so pick one deliberately. Removing the id from every allowlist takes effect as fast as allowlists reload, at every receiver you remembered. Revoking the delegated tokens the workload holds needs the token service's revocation or short token lifetimes. Write all three into the incident runbook with an owner, and test them together: Operations measures access removal against a promised time.

In one breath#

A workload proves which program it is with an SVID, a short-lived certificate or token carrying one SPIFFE ID, issued through attestation so that no secret sits in its image. The receiving service takes the caller's identity only from that verified credential, checks it against its own allowlist, and treats any app id header as metadata to compare, never as proof. When the workload acts for a person, the person's authority travels separately in a delegated token with act, and the policy decision point decides on the record. One identity per purpose keeps every one of those checks meaningful.

Every service can now tell which program is calling and for whom. Most platforms also put an API gateway, a firewall and perhaps a service mesh in front of those services, and teams are tempted to let those layers carry the authorization. Gateways and zero trust shows what each of them can check, what none of them can see, and how NIST's zero trust tenets apply to one request.