# passkey attenuated capabilities

- Status: `experiment`
- Track: [delegated authority & keyless execution](https://aifoc.us/labs/delegated-authority/)
- Layer: 3. Identity, Permissions & Delegated Authority
- Updated: 1 December 2026
- Live demo: https://passkey-agent-caps.kinlan-test.workers.dev
- Source: https://github.com/PaulKinlan/passkey-agent-caps

## Inspired by

- [calling apis from the browser shouldn't mean exposing keys](https://aifoc.us/dangerous/)
- [on-device ai needs a trust model](https://aifoc.us/on-device/)

## Hypothesis

- **Claim:** Non-extractable WebCrypto ECDSA P-256 keys combined with WebAuthn Level 3 `prf` confirmation and Durable Object spend ledgers enforce verifiable per-action scope, TTL, replay nonce, and cumulative dollar caps without exposing long-lived account secrets.
- **Confirms it:** Attempting to exceed dollar caps, reuse nonces, tamper payload fields, or call outside granted tool scopes rejects server-side in `DelegationLedger` while valid attenuated tokens execute cleanly.
- **Falsifies or bounds it:** Key derivation latency or frequent passkey user-presence prompts create UX friction that pushes developers back to ambient OAuth sessions.

> **Why this exists:** Static API tokens and ambient OAuth cookies grant broad account authority rather than narrow task limits. This lab mints short-lived, scope-bound, spend-capped ECDSA P-256 and WebAuthn PRF capability proofs enforced server-side inside a Cloudflare Durable Object SQLite ledger.


## What this lab tests

Static bearer keys and ambient session cookies grant unbounded authority when delegated to an automated tool loop. What does cryptographically attenuated delegation look like between a browser user and an edge Worker?

[Passkey Attenuated Capabilities](https://passkey-agent-caps.kinlan-test.workers.dev) ([GitHub](https://github.com/PaulKinlan/passkey-agent-caps)) mints scope-restricted, dollar-capped, short-TTL ECDSA P-256 proofs (with optional [WebAuthn Level 3 `prf`](https://www.w3.org/TR/webauthn-3/#prf-extension) hardware confirmation alongside non-extractable [`crypto.subtle`](https://developer.mozilla.org/en-US/docs/Web/API/SubtleCrypto) session keys) and verifies every signature, expiry, nonce replay check, and cumulative spend cap in a Cloudflare Durable Object SQLite ledger (`DelegationLedger`).


## Open questions to iterate on

- What delegation lifetime and spend threshold minimizes WebAuthn ceremony interruptions while preserving bounded blast radius?
- Can delegated sub-tokens chain offline attenuation cleanly without hitting the Durable Object ledger on every read?

## Iteration log

- **2026-12-01:** Built ECDSA P-256 + WebAuthn PRF capability minter backed by SQLite Durable Object `DelegationLedger` and top-of-page verification code.
- **2026-12-01:** Reordered workbench above setup snippets, added live signing/passkey/edge latency telemetry, unified CSP-safe DOM syntax highlighting, hardened 700px embed layout, and enforced no-cache static headers via Worker routing.

## Primitives tested

- `WebAuthn Level 3 PRF`
- `crypto.subtle ECDSA P-256`
- `Signed JSON Capability Tokens`
- `Durable Object SQLite`

## Connected labs in other tracks

- [keyless browser proxy](https://aifoc.us/labs/delegated-authority/keyless-browser-proxy/) — Applies ephemeral origin-bound quota tokens for zero-key frontend demos.
- [signed web citations](https://aifoc.us/labs/web-protocols/signed-web-citations/) — Uses WebCrypto signature verification on origin HTTP payloads.

---
Canonical: https://aifoc.us/labs/delegated-authority/passkey-agent-caps/
