Home / Chapter 6 · Quality and security
    Last edited · 11 min read

    Use with AI

    Agent identity

    Services an agent calls need to know who sent each request. A shared API key can’t tell them: anyone can copy it and use it for months. SPIFFE is an open standard that lets you replace it with a short-lived credential, issued automatically based on where and how the process runs.

    In plain wordsInstead of a shared door password, a receptionist issues a named pass for one hour. They recognise you, so you don’t need to remember a secret. A lost pass soon expires. The receptionist doesn’t check what you do inside.

    Why agents need SPIFFE

    Three ways to authenticate an agent: what the attacker is left with

    An agent handles support tickets and uses a CRM. Rows are situations, columns are ways to authenticate, and cells show what the attacker holds. Tap a cell, and the next steps explain each column.

    Default TTLs in SPIRE: 1 h for a certificate, 5 min for a token. Both can be shortened.

    How SPIFFE works

    Step from a SPIRE entry to the MCP server’s decision. Highlights show who is communicating at each step

    Messages are shortened; names and values are examples. This combines existing standards for services in your own trust domain. It isn’t a ready-made profile: MCP doesn’t specify mTLS or SPIFFE, and your authorization server must support certificate-bound tokens.

    Agent and user identity

    Limits and uses

    Check yourself

    How should an agent prove its identity to tools, and what doesn’t SPIFFE solve?

    An API key proves only that someone holds it, so an agent should get a short-lived credential instead. In SPIFFE, a process fetches an SVID, a certificate or JWT with a SPIFFE ID, through the local Workload API. It supplies no secret: the SPIRE agent, already verified by the server, identifies it through the kernel and orchestrator. The SPIRE server signs the certificate; the receiver verifies it using the bundle. The certificate enables mTLS, and a certificate-bound token requires the private key. The tool’s access decision must account for both agent and user. SPIFFE doesn’t judge intent: a manipulated agent has a valid SVID, and a shell in its container can usually obtain the same identities. You still need a sandbox, narrow permissions and human approval.

    Po polsku

    Klucz API potwierdza tylko, że ktoś go ma, dlatego agent powinien dostawać krótkotrwałe poświadczenie. W SPIFFE proces pobiera z lokalnego Workload API SVID, czyli certyfikat albo JWT z SPIFFE ID. Nie podaje przy tym żadnego sekretu, bo agent SPIRE, sprawdzony wcześniej przez serwer, rozpoznaje go przez jądro i orkiestrator. Serwer SPIRE podpisuje certyfikat, a odbiorca sprawdza go zestawem kluczy. Certyfikat daje mTLS, a powiązany z nim token nie zadziała bez klucza prywatnego. Decyzja w narzędziu musi uwzględniać agenta i użytkownika. SPIFFE nie ocenia intencji: zmanipulowany agent ma ważny SVID, a powłoka w jego kontenerze zwykle dostanie te same tożsamości, więc nadal potrzebne są piaskownica, wąskie uprawnienia i zatwierdzanie przez człowieka.

    Follow-up questions (5)
    Does SPIFFE protect against prompt injection?
    Partly. Credentials expire quickly, and the harness keeps them outside the model’s context. This won’t stop a manipulated agent using its own valid permissions to call tools (see “Prompt injection”). Narrow permissions, policy in the tool and human approval help.
    JWT-SVID or X.509-SVID?
    Use X.509-SVID for a direct TLS connection to the service: mTLS proves possession of the key. Use JWT-SVID with a proxy that terminates TLS. It’s a bearer token, so set one aud and a short lifetime. WIMSE Proof Tokens and HTTP signatures prove key possession at the application layer.
    Why separate tools from the harness?
    Attestation sees a process and container, not who issued a command. With namespace and service-account selectors, a shell in the harness’s container matches the same entry. The Workload API issues it the same SVIDs for any aud. A separate sandbox without the socket and with different selectors blocks this path.
    How fast can you block an agent?
    Deleting the registration entry stops new SVIDs; existing ones work until expiry. Cached entries, open TLS connections and credentials exchanged for cloud tokens also affect access time. Lifetimes add up: an exchange just before expiry starts a new session. Set TTLs and connection limits for that worst-case total.
    When is SPIFFE overkill?
    When an agent runs in one cloud and native roles suffice. Also on a laptop, where the agent runs under the user’s account and attestation adds little. SPIRE is another critical service, so it pays off across several clouds, clusters or teams.

    Sources

    Report an error · Suggest a fix