SPIFFE vs OAuth for AI Agent Security

Resumo

Pixel shares a practical guide to SPIFFE and OAuth for securing AI agents. It explains how SPIFFE verifies workload identity while OAuth handles permissions and user delegation, and why production platforms often combine both.

DEV Community

Do AI Agents Need SPIFFE or OAuth?

Originally published at webofmike.com on 2026-10-05. They answer different questions. SPIFFE proves which process is calling, without a provisioned secret. OAuth scopes what it may do and, when a human is in the loop, for whom. Most production agent platforms need both, joined by assertion or token exchange. Neither is a winner. Disclosure: I work at Solo.io, which created agentgateway and sells Solo Enterprise for agentgateway. The demos I cite are public repositories. This page is the when-each. The how-to is SPIFFE identity for AI agents, where I ran agentgateway + SPIRE until agent-alpha got HTTP 200 and agent-beta got HTTP 403. I am not rewriting that demo here. The short answer SPIFFE/SPIRE gives an agent an attested, short-lived workload identity (an SVID) so the platform can prove which process is calling without a long-lived secret at rest. OAuth gives a scoped, audience-restricted access token, and a delegation story (on-behalf-of) when a user is in the loop. OAuth alone does not attest the runtime. SPIFFE alone does not carry permissions or a user. Either one is enough alone only in the narrow cases in the table below. Production platforms usually run both. Lin Sun's CNCF post Agent Auth: a lawyer's day in court is the metaphor I would paste into the ADR: the lawyer is not the client. The agent is not the user. You need agent identity, principal identity, and a delegation artifact, then policy on top. Two different questions Stop treating them as rivals. Identity is not authorization. A verified name is not a permission. What a SPIFFE ID gives you, and what it does not SPIRE attests the calling process (in my demo, a docker label; on Kubernetes, namespace and service account) and issues a short-lived X.509 or JWT SVID from the Workload API. There is no key file to mount. The certificate lives minutes and rotates in place. What you get: a verified name (spiffe://example.org/ns/demo/sa/agent-alpha), mTLS or a JWT-SVID, and a bootstrap that does not start with a provisioned secret. What you do not get: a permission model, scopes, audiences for third-party APIs, or a human sub. The demo's agent-beta holds a perfectly valid SVID and still gets 403, because CEL allows only agent-alpha. That is the point. What an OAuth token gives you, and what it does not An access token is a permission envelope: scopes, audience, expiry, and (with OBO) a user. A resource can decide what this caller may do, and for whom. What you do not get: platform attestation that this process is the agent. A client secret or a private key the agent holds is possession of a credential, not workload identity. A fleet that shares one client_id audits a credential, not a workload. Stolen bearer tokens are ambient authority until they expire. MCP's shipped enterprise auth authenticates the employee through an IdP, not the unattended agent. I walked through that in MCP agent identity. When each is enough Situation Reach for Because In-cluster agent to gateway to model, one trust domain, no human OBO SPIFFE (or mesh equivalent) Policy can be an ACL on source.spiffeId. I ran this. Agent acting for a logged-in human Both You need the agent principal and an OBO / subject token. Third-party SaaS APIs that only speak OAuth client auth OAuth, plus SPIFFE in front if you can attest the caller The SaaS will not verify your SVID. The gateway still should. CI, laptop, or serverless with no SPIRE OAuth or platform OIDC You cannot attest the workload the SPIFFE way yet. Say so. Multi-hop agent to agent Both, joined by exchange Each hop needs a new audience. Do not forward the same bearer. MCP tools with different risk profiles Both A SPIFFE name is not a tool allowlist; a user token is not a workload. SPIFFE only Same trust domain you control end to end. Policy is an ACL on the SPIFFE ID at the gateway. No human OBO required. That is the SPIFFE demo. verify.sh asserts the claims rather than narrating them: verifying...
ok no certificate or key files in the repo...
SPIFFE vs OAuth for AI Agent Security
Powered by Readybot.io

As últimas novidades de Pixel

Incident Response: Look Beyond the Red Alert

Pixel’s DEV Community announcement explores how teams can fixate on one failing service while overlooking the real cause of an outage, such as a full …

Sach: AI Fact-Checks WhatsApp Forwards in India

Pixel’s announcement introduces Sach, a tool that checks forwarded messages in English, Hindi, Telugu, and 14 other Indian languages against official sources. It gives cited …

Java 25 Removes SecurityManager: What to Fix

Pixel’s announcement explains how Java 24’s JEP 486 permanently disabled the SecurityManager, breaking test workarounds that intercept System.exit. It recommends returning exit codes or throwing …