{"slug": "verifiable-credentials-for-ai-agents-oid4vci-and-oid4vp-without-a-qr-code", "title": "Verifiable credentials for AI agents: OID4VCI and OID4VP without a QR code", "summary": "IzySSI's approach to W3C Verifiable Credentials via OpenID for Verifiable Credential Issuance (OID4VCI) and OpenID for Verifiable Presentations (OID4VP) can be applied to AI agents by replacing the human QR-code step with a headless wallet, since the QR code only carries a URL that can instead travel in an API response. The article argues that API keys and copied session tokens tell a receiving service only that the caller holds a valid secret, not who delegated the task, which actions were delegated, on which resources, or until when. It recommends generating the agent's key as a non-exportable key in a cloud KMS or HSM, tying key access to Kubernetes workload identity via SPIFFE/SPIRE SVIDs, and using OID4VCI 1.0 key attestations so issuers do not bind credentials to arbitrary keys.", "body_md": "# Verifiable credentials for AI agents: OID4VCI and OID4VP without a QR code\n\nA person scans a QR code with the wallet on their phone. An AI agent calling an MCP server at 2 a.m. has no phone and no camera. The protocols underneath, OID4VCI and OID4VP, never needed either: the QR code only carries a URL.\n\n## Agents act for someone, but their credentials do not say who\n\nAn AI agent that triages incidents, opens pull requests or scales a deployment calls APIs, tools and MCP servers for a person or a team. In most setups it does so with an API key, a client secret or a token copied from a developer’s session. From that credential the receiving service learns one thing: the caller holds a valid secret.\n\nIt does not learn who delegated the task, which actions were delegated, on which resources, or until when. A key created for one task keeps working for every task after it. If the key leaks, whoever holds it looks exactly like the agent. When something goes wrong, the audit log shows a key ID and people rebuild the rest from chat histories.\n\nSelf-sovereign identity solves a similar problem for people. A holder carries signed claims from an issuer and proves them to a verifier, which checks the issuer’s signature without calling the issuer at presentation time. This article shows how the same model, with the same protocols izySSI uses for people, applies to AI agents that have neither a phone nor a camera.\n\n## How izySSI works for people today\n\nizySSI connects Keycloak to W3C Verifiable Credentials through OpenID for Verifiable Credential Issuance (OID4VCI) and OpenID for Verifiable Presentations (OID4VP). The human journey has four steps:\n\n1. The user logs in to the organisation’s site through Keycloak.\n2. The site shows a QR code that encodes a credential offer.\n3. The user scans it with the izySSI Android wallet, which runs the OID4VCI exchange and stores the credential.\n4. Later, a relying party shows another QR code with an OID4VP authorization request. The wallet asks for consent and sends a signed presentation.\n\nLook at what the QR code carries in steps 2 and 4. In the first case it is an\n`openid-credential-offer://` link, with the offer inline or a `credential_offer_uri` that points to\nit. In the second it is an authorization request, usually as a `request_uri`. The QR code moves a URL\nfrom a screen to the device that holds the keys. Everything after that is HTTPS between the wallet\nand the issuer or the verifier.\n\nFor an agent, the screen and the device are the same process, so the URL can travel in an API response.\n\n## A headless wallet for the agent\n\nA wallet has three jobs: it holds a private key, it stores credentials bound to that key, and it builds presentations when a verifier asks for them. None of these needs a user interface. A headless wallet is a library or a sidecar that does the same three jobs inside the agent’s runtime.\n\nThe key is what every credential gets bound to, so its protection sets the value of the credential. Generate it in a cloud KMS or an HSM as a non-exportable key and let the wallet call the signing API: the agent process never sees the private key. On Kubernetes, tie access to that key to the workload identity. SPIFFE/SPIRE issues each pod an SVID after attesting the node and the workload, so only the intended service account in the intended namespace can request signatures.\n\nThe identifier can be a DID (`did:web` under the organisation’s domain, or `did:jwk` derived from the\nkey) or simply the public key as a JWK, which is what SD-JWT VC puts in the `cnf` claim for holder\nbinding. A SPIFFE ID such as `spiffe://acme.example/ns/ops/sa/release-agent` can travel in the\ncredential as an attribute, so a verifier can match the presentation to a workload.\n\nAn issuer should not bind a credential to whatever key it receives. OID4VCI 1.0 defines key attestations: a signed statement, from the wallet provider or the platform, that a key lives in a given kind of protected storage. For mobile wallets the attestation comes from the phone’s hardware. For a headless wallet it can come from the HSM (Google Cloud KMS, for example, produces attestation statements for HSM-protected keys) or from an internal attestation service that trusts the SPIRE server. The issuer checks it before issuing anything.\n\n## Issuing a delegation credential with OID4VCI\n\nThe agent should not log in by itself: the authority it needs belongs to a person. Issuance therefore starts with the person, in the same Keycloak login they use today.\n\n```\nsequenceDiagram\n  autonumber\n  actor U as User\n  participant K as Keycloak / izySSI issuer\n  participant A as AI agent (headless wallet)\n  U->>K: Log in (OIDC + MFA)\n  U->>K: Delegate to agent: actions, resources, duration\n  K-->>A: Credential offer by API (pre-authorized code)\n  U-->>A: tx_code over a separate channel (optional)\n  A->>K: POST /token (pre-authorized_code, tx_code)\n  K-->>A: access_token\n  A->>K: POST /nonce\n  K-->>A: c_nonce\n  Note over A: Sign proof JWT with KMS key, add key attestation\n  A->>K: POST /credential (proofs.jwt)\n  K->>K: Check proof, nonce, attestation, agent key\n  K-->>A: SD-JWT VC bound to the agent key (cnf)\n```\n\n### The person delegates to a specific agent\n\nThe user logs in to the izySSI portal through Keycloak with their usual credentials and MFA, picks a registered agent and chooses what to delegate: actions, resources and a maximum duration. Keycloak already knows the user’s roles, so the portal can refuse to delegate more than the user holds.\n\n### The credential offer reaches the agent by API\n\nWhere the human flow renders a QR code, the issuer sends the credential offer to the agent’s registration endpoint, or the orchestrator that starts the agent job passes it in. The offer uses the pre-authorized code grant:\n\n```\n{\n  \"credential_issuer\": \"https://ssi.acme.example\",\n  \"credential_configuration_ids\": [\"AgentDelegation_SDJWT\"],\n  \"grants\": {\n    \"urn:ietf:params:oauth:grant-type:pre-authorized_code\": {\n      \"pre-authorized_code\": \"SplxlOBeZQQYbYS6WxSbIA\",\n      \"tx_code\": { \"length\": 6, \"input_mode\": \"numeric\" }\n    }\n  }\n}\n```\n\nThe pre-authorized code is a single-use bearer secret, so the offer should expire within minutes. The\n`tx_code` adds a second factor delivered over a different channel: the orchestrator can read it from\na secret store, or the user can paste it into the agent’s job.\n\n### Token, nonce and credential requests\n\nThe agent redeems the code at the token endpoint, gets a fresh `c_nonce` from the nonce endpoint and\nsigns a proof JWT (`typ: openid4vci-proof+jwt`) with its KMS key. The proof names the issuer as\naudience, carries the nonce, and includes the key attestation in its header.\n\n```\nPOST /token HTTP/1.1\nHost: ssi.acme.example\nContent-Type: application/x-www-form-urlencoded\n\ngrant_type=urn:ietf:params:oauth:grant-type:pre-authorized_code\n&pre-authorized_code=SplxlOBeZQQYbYS6WxSbIA&tx_code=493536\n\nPOST /credential HTTP/1.1\nHost: ssi.acme.example\nAuthorization: Bearer czZCaGRSa3F0MzpnWDFmQmF0M2JW\nContent-Type: application/json\n\n{\n  \"credential_configuration_id\": \"AgentDelegation_SDJWT\",\n  \"proofs\": { \"jwt\": [\"eyJ0eXAiOiJvcGVuaWQ0dmNpLXByb29mK2p3dCIs...\"] }\n}\n```\n\nThe issuer checks the proof signature, the nonce, the attestation, and that the public key belongs to the agent the user selected. Then it issues a credential bound to that key.\n\n### What the delegation credential contains\n\nWith SD-JWT VC, the decoded payload looks like this:\n\n```\n{\n  \"iss\": \"https://ssi.acme.example\",\n  \"vct\": \"https://ssi.acme.example/vct/agent-delegation/v1\",\n  \"sub\": \"spiffe://acme.example/ns/ops/sa/release-agent\",\n  \"iat\": 1795424400,\n  \"exp\": 1795425300,\n  \"cnf\": { \"jwk\": { \"kty\": \"EC\", \"crv\": \"P-256\", \"x\": \"TCAER19Zvu3OHF4j4W4vfSVoHIP1ILilDls7vCeGemc\", \"y\": \"ZxjiWWbZMQGHVWKVQ4hbSIirsVfuecCE6t4jT9F2HZQ\" } },\n  \"delegation\": {\n    \"delegated_by\": \"maria.rossi@acme.example\",\n    \"actions\": [\"deployments:scale\", \"deployments:get\"],\n    \"resources\": [\"k8s:prod-eu-1/ns/checkout\"],\n    \"max_replicas\": 10,\n    \"ticket\": \"OPS-4182\"\n  },\n  \"status\": { \"status_list\": { \"idx\": 4182, \"uri\": \"https://ssi.acme.example/status/agents/1\" } }\n}\n```\n\n`cnf.jwk` is the holder binding: only the agent’s key can present this credential. `delegation` is\nnot a registered claim. Its structure is defined by the credential type in `vct`, which the issuer\nand the verifiers agree on. The expiry here is 15 minutes; for longer jobs, hours rather than months.\n`status` points to a Token Status List entry for revocation before expiry.\n\nClaims that not every verifier needs, such as the delegator’s email or the ticket number, can be selectively disclosable, so the agent reveals them only to verifiers that ask. W3C VC Data Model 2.0 also works here, secured with JOSE/COSE or a Data Integrity proof. izySSI issues W3C VCs for people today; for agents, the format follows what the verifiers accept.\n\n## Machine-to-machine presentation with OID4VP\n\nOn the verifier side, the QR code becomes an HTTP response.\n\n```\nsequenceDiagram\n  autonumber\n  actor U as User\n  participant A as AI agent (headless wallet)\n  participant S as Service / MCP server (verifier)\n  participant I as izySSI issuer\n  A->>S: Tool call without access token\n  S-->>A: 401 + OID4VP request_uri\n  A->>S: GET request_uri\n  S-->>A: Signed request (client_id, nonce, dcql_query, response_uri)\n  Note over A: Select credential, disclose claims, sign KB-JWT (nonce, aud)\n  A->>S: POST response_uri: vp_token, state (direct_post)\n  S->>I: Issuer keys and status list (cached)\n  S->>S: Verify, then apply policy\n  opt Sensitive action\n    S->>U: Approval request\n    U-->>S: Approve\n  end\n  S-->>A: Short-lived DPoP-bound access token\n  A->>S: Tool call with token + DPoP proof\n  S-->>A: Result\n```\n\n### The service asks for a presentation\n\nThe agent calls a protected API or MCP server without a valid access token. Where a website would show\na QR code, the service answers 401 with a pointer to an OID4VP authorization request. No standard yet\nsays how a 401 should carry that pointer. The MCP authorization specification uses OAuth 2.1 with\nprotected resource metadata (RFC 9728), so the request can be advertised there or in a\n`WWW-Authenticate` parameter that both sides agree on.\n\nThe request is a signed JWT. In OID4VP 1.0 the verifier states what it wants with a DCQL query:\n\n```\n{\n  \"client_id\": \"x509_san_dns:mcp.acme.example\",\n  \"response_type\": \"vp_token\",\n  \"response_mode\": \"direct_post\",\n  \"response_uri\": \"https://mcp.acme.example/oid4vp/response\",\n  \"nonce\": \"n-0S6_WzA2Mj\",\n  \"state\": \"eyJhZ2VudCI6InJlbGVhc2UifQ\",\n  \"dcql_query\": {\n    \"credentials\": [{\n      \"id\": \"delegation\",\n      \"format\": \"dc+sd-jwt\",\n      \"meta\": { \"vct_values\": [\"https://ssi.acme.example/vct/agent-delegation/v1\"] },\n      \"claims\": [\n        { \"path\": [\"delegation\", \"actions\"] },\n        { \"path\": [\"delegation\", \"resources\"] },\n        { \"path\": [\"delegation\", \"delegated_by\"] }\n      ]\n    }]\n  }\n}\n```\n\n### The agent builds and sends the presentation\n\nThe headless wallet checks who is asking (the request signature and the `client_id`), finds a\ncredential that satisfies the query and applies its own rules. An agent should present only to\nverifiers it was configured for, because a phishing MCP server can ask for credentials too. For an\nSD-JWT VC, the wallet discloses the requested claims and appends a key binding JWT signed with the\nagent’s key. The KB-JWT contains the `nonce`, the verifier’s `client_id` as audience and a hash of the\npresentation, so it cannot be replayed to another service. With `response_mode=direct_post` the\nwallet posts the result to `response_uri`:\n\n```\nPOST /oid4vp/response HTTP/1.1\nHost: mcp.acme.example\nContent-Type: application/x-www-form-urlencoded\n\nvp_token={\"delegation\":[\"eyJhbGciOiJFUzI1NiIsInR5cCI6ImRjK3NkLWp3dCJ9...~WyJ...~eyJ0eXAiOiJrYitqd3Qi...\"]}\n&state=eyJhZ2VudCI6InJlbGVhc2UifQ\n```\n\n### What the verifier checks\n\n``` php\nflowchart TD\n  R[vp_token received] --> C1{Issuer signature<br/>valid and trusted?}\n  C1 -- no --> X[Reject]\n  C1 -- yes --> C2{Within<br/>iat and exp?}\n  C2 -- no --> X\n  C2 -- yes --> C3{KB-JWT: cnf key,<br/>nonce, aud?}\n  C3 -- no --> X\n  C3 -- yes --> C4{Delegation covers<br/>tool and resource?}\n  C4 -- no --> X\n  C4 -- yes --> C5{Not revoked in<br/>status list?}\n  C5 -- no --> X\n  C5 -- yes --> C6{OPA or Cedar<br/>policy}\n  C6 -- deny --> X\n  C6 -- needs approval --> H[Ask the delegating user]\n  H -- rejected --> X\n  H -- approved --> T\n  C6 -- allow --> T[DPoP-bound token, 5 minutes<br/>sub = user, act = agent]\n```\n\nThe verifier checks the issuer’s signature against its list of trusted issuers, then the validity\nperiod, then the holder binding. Next comes the delegation itself: the requested tool and resource\nmust fall inside `actions` and `resources`, and the verifier can also check with Keycloak that the\ndelegating user still holds those rights. After the status list, local policy in OPA or Cedar has the\nlast word and can send sensitive actions to a human.\n\nIf everything passes, the agent receives an access token that lives for minutes, so it does not repeat\nthe presentation on every call. The token is bound to the agent’s key with DPoP (RFC 9449): stolen\nfrom a log, it is useless without the key. It names the user as subject and the agent as actor, with\nthe `act` claim from OAuth token exchange (RFC 8693), so every API log line records both. OID4VP does\nnot define what the verifier returns to a `direct_post` beyond an optional redirect, so returning the\ntoken there, or through a token exchange call after it, is an implementation choice.\n\n## The human flow and the agent flow side by side\n\n```\nflowchart LR\n  subgraph P[Person with the izySSI Android wallet]\n    direction TB\n    P1[Log in through Keycloak] --> P2[QR code with credential offer]\n    P2 --> P3[Wallet scans it, keys on the phone]\n    P3 --> P4[Verifier shows QR with OID4VP request]\n    P4 --> P5[User consents, wallet posts the VP]\n  end\n  subgraph G[AI agent with a headless wallet]\n    direction TB\n    G1[User logs in through Keycloak and delegates] --> G2[Credential offer delivered by API]\n    G2 --> G3[Wallet library, keys in KMS or HSM, SPIFFE identity]\n    G3 --> G4[Service answers 401 with OID4VP request]\n    G4 --> G5[Wallet rules select claims, wallet posts the VP]\n  end\n  P ~~~ G\n```\n\nThe issuer, the verifier, the protocols and the credential format stay the same. Three things change. The offer and the request travel in API responses instead of QR codes. The keys move from the phone to a KMS or HSM tied to a workload identity. Consent splits in two: the person approves the delegation once, at issuance, and the wallet’s configured rules decide each presentation within that delegation.\n\n## Why this is better than API keys and shared tokens\n\n| Question | Static API key or shared token | Delegation credential | \n|---|---|---|\n| Who delegated? | Not recorded | `delegated_by` , signed by the issuer | \n| What may the agent do? | Whatever the key allows | `actions` and`resources` , checked per call | \n| Until when? | Until someone rotates it | `exp` in minutes or hours | \n| Revocation | Rotate the key, break every user of it | One status list entry | \n| Proof of identity | Possession of a copyable string | Signature from a non-exportable, attested key | \n| Audit | Key ID | User as subject, agent as actor, ticket | \n| Interoperability | Proprietary per service | OID4VCI, OID4VP, SD-JWT VC, W3C VC | \n\nThe verifier needs no shared secret with the issuer and no call to it for each request: the issuer’s public keys and a cached status list are enough. That matters when the services an agent calls belong to other teams or other companies. Every presentation is also evidence. The verifier can store the disclosed claims and the KB-JWT, which together show that this agent, holding this key, acted on this delegation at this time.\n\n## Open problems\n\n### Delegation chains\n\nAn orchestrator agent that hands work to sub-agents should pass on less authority than it holds. The\nheadless wallet could act as an issuer for a narrower credential, and the verifier would walk the\nchain and check that each step shrinks the scope, the idea behind capability tokens such as UCAN or\nBiscuit. OID4VCI and OID4VP do not define chained delegation, and nested `act` claims from RFC 8693\nrecord a chain without proving it. For now, keep chains short and have sub-agents request their own\ncredentials from the issuer.\n\n### Real-time revocation\n\nStatus lists are cached, so revocation takes effect when the verifier’s cache expires. Short credential lifetimes and access tokens of a few minutes bound the exposure. For high-risk actions the verifier can fetch a fresh status list or ask the issuer directly.\n\n### Key management\n\nRotating an agent’s key means issuing new credentials. Teams have to decide whether a key belongs to an agent type or to each running instance, and what happens when a pod restarts. Key attestation in OID4VCI was designed with phones in mind; formats for server-side keys in KMS and HSM services are not standardized yet.\n\n### Humans in the loop for sensitive actions\n\nA delegation credential sets a ceiling, not a blank cheque. Deleting data or moving money should still go back to a person at the moment of the action. OpenID CIBA (Client-Initiated Backchannel Authentication) fits this case because it needs no browser on the agent’s side.\n\n### eIDAS 2.0 and the EUDI Wallet\n\nRegulation (EU) 2024/1183 and the EUDI Wallet use OID4VCI, OID4VP, SD-JWT VC and ISO mdoc, the same building blocks described here. The wallet architecture covers natural and legal persons, not software agents. A practical bridge exists anyway: the user who delegates can authenticate to the issuer with their EUDI Wallet instead of a password, so the agent’s credential traces back to a verified person or company.\n\n## Where izySSI and IzyTrust fit\n\n[izySSI](https://izylifesolutions.com/products/izylife-ssi-platform/) implements OID4VCI and OID4VP with Keycloak for people. The\nagent flow keeps the same issuer and verifier roles and adds offers and requests delivered by API, a\nheadless wallet and a delegation credential type.\n\n[IzyTrust](https://izylifesolutions.com/products/izytrust/) governs what agents do through a self-hosted MCP gateway, with\nshort-lived delegated tokens, OPA or Cedar policy and human approval for destructive actions. In a\ncombined design, the IzyTrust gateway is the verifier: it accepts the agent’s presentation, checks the\ndelegation and issues the token it already uses for each tool call.\n\nIf you are connecting agents to internal APIs or MCP servers and want delegation that a verifier can\ncheck, [contact us](https://izylifesolutions.com/#contacts) for a demo or to scope a pilot with one agent and one service.", "url": "https://wpnews.pro/news/verifiable-credentials-for-ai-agents-oid4vci-and-oid4vp-without-a-qr-code", "canonical_source": "https://izylifesolutions.com/articles/verifiable-credentials-for-ai-agents-oid4vci-oid4vp-without-qr-code/", "published_at": "2026-11-23 09:00:00+00:00", "updated_at": "2026-11-26 11:42:51.170673+00:00", "lang": "en", "topics": ["ai-agents", "agent-protocols", "ai-safety", "artificial-intelligence"], "entities": ["izySSI", "Keycloak", "OID4VCI", "OID4VP", "SPIFFE/SPIRE", "W3C Verifiable Credentials", "Kubernetes", "SD-JWT VC"], "also_reported_by": [], "takeaway": "Run a headless wallet inside the agent runtime with a non-exportable key held in a cloud KMS or HSM, gate signing on a SPIFFE/SPIRE SVID tied to the pod's workload identity, and have issuers require OID4VCI 1.0 key attestations rather than binding credentials to any submitted key.", "recommendation": {"advice": "Give each agent a headless wallet whose non-exportable key lives in a KMS or HSM, authorize signing only via its SPIFFE/SPIRE workload identity, and require OID4VCI 1.0 key attestations before issuing credentials.", "playbook": "agent-security", "playbook_url": "https://wpnews.pro/playbooks/agent-security"}, "alternates": {"html": "https://wpnews.pro/news/verifiable-credentials-for-ai-agents-oid4vci-and-oid4vp-without-a-qr-code", "markdown": "https://wpnews.pro/news/verifiable-credentials-for-ai-agents-oid4vci-and-oid4vp-without-a-qr-code.md", "text": "https://wpnews.pro/news/verifiable-credentials-for-ai-agents-oid4vci-and-oid4vp-without-a-qr-code.txt", "jsonld": "https://wpnews.pro/news/verifiable-credentials-for-ai-agents-oid4vci-and-oid4vp-without-a-qr-code.jsonld"}}