OpenBao on Cloudflare Workers In review

Run the upstream OpenBao core inside a Worker isolate. Give ForgeGraph and existing OpenBao clients access to its KV v2 and Transit engines. Give agents a way to request and verify a credential operation using only references and receipts.

Llavero system design · Revised 2026-11-24 · docs/vault-kms-forgegraph-design · Codex with the project owner

Overview and owner decisions

Execution requirement
The upstream OpenBao core itself must execute inside a Cloudflare Worker isolate. A Go-to-Wasm port is acceptable.
First store to replace
ForgeGraph application and stage secrets, including development overrides and the values consumed at deployment.
Compatibility contract
Existing OpenBao clients must run their named KV v2 and Transit workflows using their current CLI or SDK.
Production root
Production secrets require a hardware-backed root. Compare owner-operated and managed hardware through the same contract. Software roots are for fixtures.
Provider factors
Default to phone custody per provider account. The owner can explicitly enroll an automation account for vault-held passkeys or TOTP.
Local use
A protected helper may deliver to a pinned executable when its inputs, outputs and execution environment are isolated from the agent.

What counts as a replacement

An unmodified client reaches OpenBao’s Go request handler, ACL, barrier and mounted engine inside a deployed isolate. The same client passes its named workflow against stock OpenBao. A migrated ForgeGraph stage can set, read for an authorized consumer, rotate and delete a secret after access to its old value table is disabled. A custody receipt identifies the stored version. A separate deployment attestation identifies the version the workload actually uses.

Scope and alternatives

Use one upstream core for each tenant’s migrated data. The public value API and ForgeGraph’s private adapter reach that core through different credentials. The native distribution is the conformance reference. A Worker proxy with a container or external OpenBao server would execute the core elsewhere. A TypeScript protocol implementation would execute different code. Either change would require a new product decision. If the port misses its acceptance tests, keep the affected stage on its existing authority and report the failing test.

The first release targets named mounts, operations, key types and authentication flows. Additional engines such as PKI, SSH, database dynamic issuance, full sys-admin APIs, cloud-provider wire APIs, HSM certification and organization-wide SSO each require their own consumer and conformance evidence. Existing external custody, including Preflight-owned signing material and BizPulse-owned production credentials, changes only through its own migration.

What already exists

Source baseline is Llavero 49f3144 and ForgeGraph e18bef99c (inspected Git revision). “Implemented” here describes repository code. Deployment and disaster-recovery evidence have their own gates below.

Fixture evidence recorded November 24

On the repository's Node 24.14.0, the browser runtime, rotation, step-up and mobile suites passed 226 tests. The vault identity and root-rewrap suites passed 10. The MCP, credential-use and owner-passkey suites passed 84 on the final run. The concurrent last-passkey-removal test failed once in the initial group and then passed both in isolation and with the same group. Its reliability is an open release check. These runs used fixtures. Hardware recovery, real-device provider handoff and a migrated ForgeGraph stage each require their own evidence.

SurfaceReuse from the repositoriesWork required
CustodyPrivate SQLite Durable Objects, immutable encrypted versions, tenant-bound AES-GCM envelopes, wrapped organization keys, root rewrap and a hash-chained audit.Port upstream OpenBao, adapt physical storage and auto-unseal, move scoped values behind its barrier and rehearse cross-store recovery. Retain the legacy reader for existing Llavero envelopes.
MCP and rotationScoped OAuth, reference discovery, intake, declared proxy operations, one-use leases, exact plan digests, standing policies, rotation checkpoints and receipts.Private handoff of redeemable claims, typed safe result projections, protected local execution and complete trace testing.
Owner and provider identityOwner WebAuthn, paired Expo phone with signed decisions, owner-entered codes, wake-only push and a vault signer for separately enrolled provider identities.Native mobile credential providers, device-held seed storage, private factor delivery and demonstrated provider-supported completion.
BrowserCloudflare Puppeteer adapter with recording disabled, Workers AI adapter, reviewed action IDs and fixture tests. A separate headful executor has signed run routes.Bind and deploy the cloud runtime in a sandbox, constrain egress and observations, and verify every enabled provider. The checked-in web Wrangler environments bind the vault without binding Browser Run.
ForgeGraphThe Go CLI uses ForgeGraph HTTP routes. Those and the web router read or write encrypted stage rows. Llavero already has a destination adapter that writes a stage key.Move ForgeGraph reads and writes behind a custody interface, including internal direct SQL callers. The existing outbound adapter alone leaves ForgeGraph as a second store.
Source entry points for implementation and review
  • Llavero custody and contracts live in apps/web/src/server/llavero/{crypto,vault-core,vault-do}.ts, packages/domain/src/credentials/ and packages/api/src/llavero/. Follow install.ts, mcp-tools.ts, standin.ts, personal.ts and stepup-store.ts for existing caller behavior.
  • Execution and phone code live in packages/{rotation,browser-runtime,stepup}/src/, apps/executor/src/ and apps/mobile/src/lib/. The ForgeGraph destination is packages/destinations/src/adapters/forgegraph.ts.
  • ForgeGraph evidence comes from agent/cmd/fg/commands/secret.go, packages/api/src/lib/secret-store.ts, packages/db/src/schema/secret.ts, packages/api/src/routers/secret.ts, apps/web/src/app/api/fg/secrets/, apps/web/src/app/api/agent/secrets/route.ts and apps/web/src/lib/secret-sinks.ts.

The upstream core inside the isolate

The fixture pins OpenBao v2.7.3 at 0439ef5812538733afb277b4445a54706edc1db7. Its Go entry point builds inside the module, registers the KV and Transit factories, constructs vault.NewCore and attaches the upstream internal/http handler to an in-process HTTP transport. The fixture uses upstream token authentication. The deployed profile will also need a workload identity and a metadata-only audit device. The handler calls Core.HandleRequest for logical operations. Its ACL evaluation, barrier, routing, KV versioning and Transit cryptography execute in the Wasm module. [Pinned source · HTTP entry point]

Local port evidence · November 24. The pinned OpenBao core, HTTP mux, KV v2 and Transit run inside local workerd. The upstream Go SDK initializes the Shamir seal, unseals the core, creates a policy and uses a scoped token. The fixture writes two KV versions, reads version one and the latest value, checks stale CAS and a denied write, encrypts and decrypts with Transit, and checks anonymous denial. The SDK and handler share one Wasm instance and an in-process HTTP transport. The fixture uses generated keys and an explicit memory backend with outbound networking disabled. [Llavero backlog proposal]

Reproduce the port and qualify a release

From the Llavero repository root, run pnpm openbao:test. The build fetches the release by commit, applies tools/openbao-worker/openbao-worker.patch, and links for js/wasm with Go 1.27.4. It excludes Raft/bbolt, native test clusters and their Pebble dependency, and daemon telemetry exporters. It selects the JS-capable metrics implementation and reports memory locking as unsupported if requested. The patch preserves the upstream ACL evaluator, encryption barrier and both logical engines.

The Go linker produces a roughly 77 MiB module. The packager retains the executable sections and removes the static data section after capturing its initialized memory. Workerd streams that gzip-compressed image into fresh linear memory before starting Go. On Node 24.14.0, the four input modules total 53,630,519 bytes. Wrangler 4.128.0 reports 52,373.55 KiB (51.15 MiB) for the complete dry-run upload. One local workerd run ended with 47,972,352 bytes of Wasm linear memory. The manifest records SHA-256 for the compiled fixture sources, linked Wasm, packaged modules, platform patch and upstream module checksum files. The dry-run gate compares each emitted module digest with the local workerd input and the actual upload byte count with the manifest. The durable service subsequently passed a live Cloudflare fixture with two SQLite-backed tenant objects, private ingress, a native client comparison, eviction and a disabled-Wasm control. Production capacity, private audit and hardware-root recovery have separate gates. Deployed execution evidence

The initial unmodified build failed on native Raft/bbolt, Pebble, signal metrics and memory locking. The WASI baseline also encountered network-interface discovery. The earlier Shamir-only module served as a negative control for the core fixture. Although Go exited successfully, workerd rejected it because it never completed the OpenBao operations.

Start with the standard Go js/wasm target, its matching runtime glue and a statically imported, precompiled Wasm module. Compare Go wasip1/wasm against an explicit inventory of required imports. Workers has partial WASI support and a single execution thread. Share only immutable module code between objects. Each tenant object owns its Go runtime, linear memory, callbacks and unsealed keys. A bridge waiting on host I/O must yield the event loop and resume in the owning request or alarm context. Test simultaneous requests to two tenants for data and callback isolation. [Workers Wasm support]

Record the upstream SHA, reviewed patch series, build tags, Go/tool versions, module checksums, enabled engines, Wasm digest and Wrangler bundle manifest. Re-run the comparison suite, review upstream security fixes and rehearse a storage-compatible upgrade or restore for each release. [Upstream toolchain]

BoundaryProposed host contract and proof
Request and identityRoute each enrolled endpoint to its server-selected tenant object. Translate Fetch method, raw path/query, allowed headers and bounded body bytes into a Go request. Preserve the response status, headers and bytes. Carry the workload’s credentials through to upstream auth and ACLs. Exercise native LIST, error envelopes, token renewal, denial and mount discovery. Management and agent operations enter on separate identities.
Core and native dependenciesPackage built-ins statically. Isolate compile-time dependencies on Raft, filesystem-backed storage, external plugin subprocesses, cluster listeners and host diagnostics behind reviewed platform files. Disable unsupported capabilities explicitly. Preserve secure entropy, clock, cancellation and upstream failure behavior. Assert a failing mount or unsupported syscall cannot fall back to an in-memory value store. Restrict egress to the host bindings the profile declares.
Physical storageGive each tenant object its own Wasm instance and SQLite records. Bridge sdk/physical.Backend including Get, Put, Delete, hierarchical List and sorted ListPage. Implement the pinned interactive transaction interfaces for the selected engines. One design uses a stable read generation, read-your-writes overlay and bounded writes. On commit validate the generation and apply all mutations in one synchronous SQLite transaction. Reject conflicts and retry only before external effects. Test prefix scans, pagination, aborts, evictions and two writers racing on a KV CAS. [Upstream storage contracts · Object storage transactions]
Lifecycle and sealStart sealed on cold creation. Initialize persistent storage exactly once under a fenced administrative operation. A later instance reopens the same barrier and mounts. Keep unsealed keys confined to the tenant instance. Bridge the upstream auto-seal to the root authority and run hardware calls outside storage transactions. Use durable deadlines and idempotent alarms for expiry and revocation work. On wake, reconcile overdue work and check absolute expiry before granting access. Exercise duplicate alarms, stale instances and a failed unseal. [OpenBao seal · Object lifecycle · Alarms]
Resource budgetMeasure the complete uncompressed upload, module startup, cold first request including unseal, warm p50/p95/p99 latency, CPU, combined JS and Wasm peak memory, subrequests and per-tenant throughput. Cloudflare currently documents a 64 MiB uncompressed Worker bundle, 128 MB per isolate and one second of global startup. Test the target account and compatibility date with concurrent tenants and the largest named payload. A local test supplies no deployed resource measurements. [Workers platform limits]

First passing deployment. Record the Worker version, Wasm digest and upstream revision. Run with no network path to any OpenBao server and a fixture seal. Initialize and unseal, mount both engines and reject an underprivileged token. Write versions 1 and 2 to one KV v2 path using CAS, then read version 1. Encrypt a fixture using Transit, rotate the key, rewrap and decrypt. Recreate the isolate over the same durable state, verify a fresh boot ID, repeat the reads and decrypt, then seal and prove access is denied. Match the native reference using the same CLI and SDK. Capture operation names and outcomes. If compilation, behavior or the resource budget fails, retain the evidence and keep migration blocked at this milestone.

Custody, identity and recovery

Each owner installs Llavero in their own Cloudflare account. The edge authenticates the caller, resolves its tenant and stage, then evaluates the operation against a server-owned policy. Agent OAuth, workload identity, an owner's session, the phone's enrolled device key and an executor's run identity have distinct audiences. A grant authorizes a proposal or a read of metadata. The plan digest, approval and live membership govern the subsequent effect.

The private custody Worker hosts the tenant objects that run OpenBao. Its seal adapter alone can call the install’s root authority. Give ForgeGraph, the exchange broker, the browser runner and the model caller separate deployment identities and narrow capabilities. The browser runner can submit private capture or claim a factor for an approved run. The MCP handler can request an operation and read its outcome. Add per-tenant request, cryptographic operation and browser-run quotas at admission.

Upstream OpenBao execution, storage and seal in LlaveroReferenceStage operationScoped requestScoped tokenBarrier recordsAuto-unsealPrivate deliveryAgent / MCPLlavero grantsand approvalsForgeGraphOpenBaoGo/Wasm corein the tenantWorker isolateOpenBao CLI orSDKDurable ObjectSQLiteHardware rootEnrolled recipient
ForgeGraph and the agent broker use scoped operations. Existing OpenBao clients authenticate to the core. Durable Object SQLite holds its records, and the hardware root protects the unseal material.
Diagram source
flowchart TB
    agent["Agent / MCP"] -->|"Reference"| policy["Llavero grants and approvals"]
    fg["ForgeGraph"] -->|"Stage operation"| policy
    policy -->|"Scoped request"| core["OpenBao Go/Wasm core<br/>in the tenant Worker isolate"]
    client["OpenBao CLI or SDK"] -->|"Scoped token"| core
    core <-->|"Barrier records"| disk["Durable Object SQLite"]
    core <-->|"Auto-unseal"| hsm["Hardware root"]
    core -->|"Private delivery"| dest["Enrolled recipient"]
Owner of the recordAuthoritative state
D1 control planeTenant membership, enrolled endpoints, authorized recipient public keys, ForgeGraph scope mapping, routing epochs, approval policy and indexed receipts. Store desired mount configuration here. OpenBao’s actual mount table, tokens, policies and leases belong to its core.
Tenant OpenBao objectThe upstream physical layout holds barrier-protected logical records, KV history, Transit key rings and mount state. Keep adapter commit generations, idempotency and audit/outbox records in a private host namespace. For a ForgeGraph mutation fence the epoch and journal the request ID, expected version and stable path before dispatch. Use upstream KV CAS, store a private per-mutation marker with a managed document and reconcile the committed version on a lost response. Emit the receipt after verifying that version. Ordinary OpenBao clients retain their upstream retry semantics. D1 indexes follow by replay.
Existing Llavero vaultKeep the current envelope reader, provider-identity slots and private delivery/step-up operations for their enrolled scopes. Move a legacy value to an OpenBao mount only via a scoped, reconciled migration. Switch the writer at an epoch. Only the authoritative backend serves the active version.
Hardware boundaryA non-exportable install root protects the stored unseal material for each tenant. The upstream barrier protects engine data. Record immutable hardware key and wrap versions. Separate application encryption, signing, fingerprinting and provider-authenticator purposes. The seal adapter’s workload identity must bootstrap independently of the ForgeGraph and Llavero stores.
Device and executorPhone-held factors stay under the device policy. The approved recipient holds its own private identity. Any transient plaintext remains within the vault, authorized client, private executor or intended destination for that operation.

The root-provider contract

New KV documents and Transit key rings use OpenBao’s barrier and storage format. Implement its auto-seal wrapping interface through the private hardware authority. Keep the existing Llavero envelope reader, associated data and version fingerprints for migration and rollback. A source envelope must be opened under its original policy and re-entered as a logical write through the target engine. Retain the authenticated source-to-target version mapping and recovery evidence.

wrap(material, context), unwrap(envelope, expectedContext) and rewrap(envelope, nextRootVersion) belong to the private seal boundary. Authenticate the install, tenant, key purpose, format and immutable root identifier/version with each hardware wrap. A tenant barrier can span multiple stages, so enforce stage access in the core’s mount and path policies. Use the host wrapper metadata the upstream auto-seal supports and prove it survives restore. Rewrap may use an authenticated backend operation or a bounded unwrap/wrap inside private custody.

A non-exportable hardware root protects unsealing. A warm, unsealed core holds operational key material in its Wasm memory. A compromised authorized Worker could read that memory or misuse its unwrap capability. Bootstrap through a private administrative ceremony and deliver the initial root token and recovery material directly to the authorized operators. Revoke the bootstrap token after installing scoped policies. Keep bootstrap, recovery, debug and raw storage routes off the public client endpoint. Applications that require each signature or decryption to execute inside hardware need a separately advertised key class.

Selection spike, seal and disaster recovery
  • Exercise an owner-operated HSM behind an authenticated private service and a managed HSM-backed service. Test non-exportability and hardware provenance, credential bootstrap, tenant/context separation, replay, denied identities, actual wrap algorithms, quotas, regional loss, operator access, recovery authority and audit export. Compare p50/p95/p99, error rate and cost at measured ForgeGraph concurrency, including cold starts and failover.
  • Provision independent recovery authority and a supported hardware backup, replica or quorum. Prove recovery after losing a device, a root endpoint and the primary region. A software recovery kit may restore a fixture. A production restore may only resume through the approved hardware root or its authorized hardware recovery path. Separate recovery officers and checkpoint signing from the serving workload.
  • Root rotation writes a new wrap alongside the old one, checks the full organization and personal inventory, verifies an isolated restore, and only then changes the active root. Before admitting production payloads, prove that neither live envelopes nor recoverable copies of their keys have a usable software-root wrap. Safely migrate or generate a fresh tenant key hierarchy wherever legacy wraps would defeat that property.
  • Fence every serving object on seal, invalidate handles, and exercise rejection from a warm instance. Auto-unseal by itself leaves an already-running core able to use its keys. To enforce the proposed fail-closed outage policy, require the seal authority to confirm each protected use and refuse when it, current authorization or required audit is unavailable. Measure that dependency in the HSM comparison. Restore D1 and object recovery points against an external, append-only audit checkpoint. Reconcile tombstones, destroyed versions, revoked grants, policy epochs and in-flight effects in quarantine before serving.

The OpenBao client contract

Expose the pinned upstream HTTP handler through a dedicated TLS endpoint with /v1/ routes. Pin each consuming client binary or SDK version, mount aliases, authentication, policy capabilities, key type and options in a compatibility manifest. Replay the same dummy client workflow against the native release and the deployed Wasm port. ForgeGraph keeps its own protocol. [KV v2 API · Transit API]

Initial profileWire and storage behavior to prove
Client bootstrapExisting bao CLI and Go API client, configured service address, TLS trust, X-Vault-Token, token lookup/renew/revoke where used and KV mount discovery via sys/internal/ui/mounts. Mount the upstream authentication method the caller uses. The core issues and validates its own scoped tokens and enforces TTL and path capabilities. Inventory AppRole/JWT/Kubernetes and agent renewal before advertising a profile.
KV v2Exercise upstream GET/POST /v1/{mount}/data/{path}, reads by version, metadata and hierarchical list (LIST and supported list query), soft delete, undelete and destroy. Cover patch, metadata/config and retention settings that named clients use. Preserve arbitrary JSON types, nulls, nested maps, field names and exact integer behavior from the reference server. The engine owns the path-to-version mapping.
Concurrent writesCheck expected version at the authoritative object. OpenBao CAS zero creates an absent key, a positive CAS must match current version, and omission follows mount/path policy. Soft deletion retains the version history. Match missing/deleted/destroyed reads, creation versus update privileges, list separators, precise error status and envelope against golden results.
Transit encryptionNamed AES-256-GCM key rings with encrypt, decrypt, rewrap and key rotation. Match base64 input/output, versioned ciphertext format, key-version selection and minimum allowed versions. Rewrap decrypts and encrypts inside custody without returning plaintext. Application payloads pass through transiently. The caller owns storage of ciphertext.
Signing and data keysProposed next profile is named Transit sign/verify and public key metadata, using the consuming application's exact algorithm, hash, prehash option and signature encoding. Add wrapped data-key generation and approved machine-only plaintext data-key delivery when exercised by a named client. Grant each capability independently. Keep provider passkeys and vault wrapping keys outside the Transit namespace.

For the first repeatable conformance suite, use bao kv put/get/list, CAS updates, version reads, delete/undelete/destroy and bao write Transit encrypt/decrypt/rewrap across a key rotation. Exercise the same operations with the Go SDK. Compare nested JSON, public metadata, headers, status codes, errors, lease semantics and policy denials, normalizing only documented randomness and timestamps. A five-minute Llavero injection ticket is a separate object from an OpenBao renewable dynamic-secret or service-token lease. [CLI mount discovery · OpenBao Go SDK · Lease lifecycle]

Expose only explicitly mounted credential classes through KV. Make provider sign-in identities, bootstrap authorities, upstream OAuth tokens and personal namespaces unreachable through client mount aliases. Evaluate listing separately from reading and isolate tenants at discovery. A KV read returns the whole document, so give a client a path only when it may read every field stored there. Use separate documents or private broker operations for narrower field grants. The strict-profile agent’s OAuth credential is invalid on the value API. Unsupported operations return explicit protocol errors.

Existing ciphertext, destruction and limits

Changing the URL does not make old ciphertext decryptable. Inventory every existing Transit key/version, historical ciphertext family, signing public key and verifier. Prefer retaining a tightly scoped legacy decrypt/verify authority until old data is migrated inside a private workload. Where an approved import is possible, prove interoperability on known fixture vectors. Export-disabled keys stay with their owner. Preserve public verification keys for old signatures.

Make the old/new ciphertext provenance unambiguous before allowing writes. The same vault:v1: prefix can belong to distinct keys. Allocate separate mounts or a verified, collision-free version map and retain the association in the consuming store. Do not trial-decrypt across tenants. Rollback must handle ciphertext already written under new keys. Rehearse reverse migration or route old and new versions to their respective owners.

The existing custody core has a 16 KiB value limit. Measure legitimate KV documents and Transit payloads before setting limits or cutover. Reject oversized values explicitly. Make KV destroy terminal in live storage, document backup retention, keep a destruction ledger across restores and use per-version key erasure when the advertised profile promises cryptographic destruction. A destroy receipt cannot claim that retained backups have already expired.

Replace the ForgeGraph secrets store

Allocate a private KV v2 mount for ForgeGraph-managed entries with one document per immutable stage, scope and name. Keep the ForgeGraph row ID and description in its metadata mapping. Only its dedicated store adapter may write that mount. It resolves the scope and submits an upstream logical operation under that stage’s identity. It strips the private mutation marker from consumer projections and reconciles ambiguous writes before accepting another mutation for the same entry. Named OpenBao clients use separately granted mounts.

Keep ForgeGraph as the authority for workspaces, apps, stages, node assignments and deployments. Its secret service resolves those relationships and exchanges its own authenticated service identity for the exact Llavero operation. Llavero independently checks the registered mapping. A migrated entry is identified by workspace, immutable app and stage IDs, scope, scope key and secret name. A deploy additionally pins the deployment, recipient and version set.

  1. Capture the current contract. Run the existing Go forge secret commands for set via stdin, list, get, pull, rotate/sync and removal, plus the UI's tRPC operations. Preserve IDs, timestamps, descriptions, source and aliases where the caller uses them. Development pulls overlay a selected developer's values on shared defaults. Other stages use shared scope. A deployment's node reads only the authorized app/stage shared set. Treat deliberate CLI get/pull/export as a private plaintext client path.
  2. Introduce a single custody interface. Route the public HTTP and tRPC surfaces and internal consumers through it. Inventory deploy and auto-deploy, CI/verification, capability provisioning, database/Redis/object-store rotation, Worker reconciliation and app/stage teardown. Test every direct read and write of the legacy value column. Keep the existing opt-in Forgejo Actions sync and alias behavior with per-sink results. Store acceptance never triggers a deploy implicitly.
  3. Remove the delivery loop. Today Llavero's stage destination posts a value to ForgeGraph. For migrated scopes, resolve that destination into a pinned Llavero binding and notify ForgeGraph with reference/version metadata. ForgeGraph's custody write calls the private store port exactly once. It never calls an outbound delivery plan. Keep the legacy adapter for scopes whose authoritative writer is still ForgeGraph.
  4. Reconcile in shadow. Use a private migration job for one scope. Inventory metadata, freeze or fence writers at an epoch, transfer values directly from the old authority into hardware-backed custody for production, then compare keyed digests inside the job. Do not persist low-entropy value hashes or export value maps. Preserve stable row mappings and a checkpoint per entry. Shadow reads compare counts, metadata and effective values without changing what serves traffic.
  5. Flip one writer. Change the routing epoch with CAS after writes drain. Retain ForgeGraph rows read-only during the rollback window. For missing required versions or custody outage, block a new deployment and keep the active revision serving. The current node route can skip undecryptable values. Treat blocking incomplete required bundles as an explicit cutover behavior change and test it.
  6. Prove rollback before expansion. Freeze the scope again and reconcile post-cutover writes, deletes, scope overrides and sink changes inside the private bridge. Verify that the reverse target meets the stage’s hardware custody requirement and can serve the current effective set before switching its writer epoch. An application rollback may keep Llavero as the authoritative store. After the agreed window, remove old value material and expire covered backups. Advance by stage only after every consumer has demonstrated uptake.

First fixture. Create one shared development value and a same-name developer override from the existing CLI. Verify both pulls, a staging deployment's shared-only read, an unrelated node denial, a partial sink failure, a rotation acknowledged by the running revision and rollback after a post-flip write. Disable access to migrated legacy value rows and repeat the successful deployment.

How an agent sends and receives a secret

The agent requests an exchange by credential reference, approved operation and recipient ID. It receives a non-redeemable request ID, status, expiry and receipt ID. The human or producer supplies the value over a separately authenticated channel. Only the enrolled sink can redeem the delivery. A transcript reader with the entire MCP exchange must be unable to retrieve, replace or redirect a credential.

IntentWhat the agent doesWhere the bytes go
Send to custodyUse credential_require or intake_open with a reference. Display a link that requires owner authentication or a request ID an enrolled producer can claim.The owner types in their private app or browser. A registered producer may submit via its own identity and request-bound proof. The vault validates field set, version precondition and expiry, then returns a storage receipt. A shared chat form, clipboard or browser session cannot be the input surface.
Use a credentialCall operation_run with a reviewed operation ID and bounded parameters. Writes require approval of the exact operation or standing policy digest.The broker authenticates directly to the declared provider endpoint. A response decoder constructs a result from an allowlist of safe fields. Credentials, unsolicited provider JSON, headers and errors never form model input.
Deliver to a workloadPropose the source version/field and named deployment or recipient. Check plan_status or run_get for the outcome.A bound service or executor authenticates and proves possession of its registered key. It receives a recipient-encrypted envelope or a direct authenticated stream. A receipt identifies the version and target. The consumer supplies independent runtime uptake evidence.
Use locallyChoose a reviewed operation and an enrolled helper ID. An example result is {"state":"delivered","requestId":"req_demo","receiptId":"rcpt_demo"}.The helper receives a private job and runs the pinned executable under its isolated identity. An approved structured result or fixed exit category is the only output released to the agent.

Handoff and replay

Create the operation before issuing any delivery. Bind tenant, actor/grant, policy revision, credential/field/version, operation digest, recipient key, expiry and a nonce. The recipient initiates its own mutually authenticated channel and proves possession over the request. Reserve a one-use redemption with a guarded transition. Fence release and revocation with an authorization epoch at the authoritative tenant object. Acknowledge revocation only after the fence is durable. A revocation prevents future release and cannot recall a value already accepted by the destination. An authenticated retry gets the recorded receipt or a reconciliation state. A lost reply after transmission is an uncertain delivery. A retry never silently opens a second release.

Today's MCP credential_lease and owner-input card response return a one-use claim. Redemption also requires an allowed identity, but the claim is sensitive. Introduce a versioned strict exchange contract. Deliver claims privately to the enrolled recipient, remove claims and sensitive URLs from every MCP projection, and test older clients through a compatibility window. Disable legacy claim-bearing tools and direct value retrieval for strict-profile agent principals at cutover. Existing opt-in HTTP retrieval, personal CLI export and general lease-exec have different disclosure contracts. Audit their use independently and deny privilege crossover. For compatible MCP hosts, URL elicitation can open an authenticated owner interaction. The URL alone conveys no authority. [MCP elicitation]

Protected local helper contract

Enroll a helper identity from an owner-controlled surface. Pin the executable digest, dependencies or signed image, argument schema, intended destination and permitted network access in a policy approved by the owner. Launch from a protected service account or VM with an immutable working directory, read-only code, no agent-accessible debugging or filesystem, no inherited environment and no interactive terminal. Pinning an interpreter while permitting arbitrary scripts, flags, plugins or working-directory code would give the caller access to the value.

Connect via an authenticated private file descriptor, pipe or keystore API. Keep transient buffers within the isolated process tree. Close inherited descriptors, disable core dumps, shell tracing and crash uploads, contain descendants and enforce cleanup and timeouts. Intercept stdout and stderr at the private boundary, discard arbitrary bytes and publish a fixed-schema receipt. Enforce an egress allowlist. If the agent controls the same privileged account, executable or output sink, offer a remote enrolled runner for the strict operation. An agent that can already read a value in its own context has exceeded the trace boundary before MCP is called.

The phone as approver and authenticator

Keep three identities separate. The owner's WebAuthn credential signs in to Llavero. The paired phone key signs decisions about an action. The provider passkey signs a challenge for the provider's relying party (RP). An approval signature never substitutes for a provider assertion. The current mobile app stores its pairing key in Expo SecureStore and loads it into JavaScript for signing after local authentication. That does not establish a hardware-resident, non-exportable provider passkey.

Today an owner-entered code travels in the decision request over TLS and the service uses a time-limited factor slot in a Durable Object. The proposed phone-to-executor envelope moves decryption to the registered recipient. Carry the envelope on the private exchange and keep the signed, model-visible decision metadata free of the code and its hash.

Account policyEnrollment and useOffline, loss and recovery
Phone-held passkey · defaultEnroll a new credential at the actual provider RP using iOS AuthenticationServices or Android Credential Manager. To act as a password manager for third-party RPs, ship an iOS AutoFill credential-provider extension and Android Credential Provider service, with OS-mediated origin/caller checks, user verification and device-protected private keys. Metadata in Llavero records RP ID, public credential identifier and custody class.If the phone is absent, the run waits and eventually expires. Enroll a second approved authenticator or use the provider's recovery flow. A device-bound credential is re-enrolled after loss. Existing OS-managed or synced passkeys follow their provider's own recovery rules.
Phone-held TOTP · defaultEnroll the seed privately on the phone. Use protected platform storage and native code for generation. Alternatively, accept an owner-entered code from their own authenticator. Show provider, account, action, destination, client and expiry. After local confirmation, seal just the current code to the registered executor key, binding the request, digest and recipient. The service may hold only this opaque envelope until consumption or expiry.Respect the provider's algorithm, digits, period and clock skew. Use the earlier of remaining code lifetime and request expiry, reject near-expiry codes and atomically spend the local approval once. The provider sets its own replay policy: TOTP itself has no cryptographic origin or operation binding. After loss, use another enrolled factor or reseed at the provider.
Vault-held automation · explicit opt-inEnroll each provider identity and each permitted factor after fresh owner verification. Reuse vault identity slots and the registered executor's signed requests. Grant only approved account, RP, playbook and run. Audit before signing or generating a code. Record who accepted that Llavero can operate these factors unattended.Phone-offline runs proceed only within the enrolled policy and provider rules. A new consent, CAPTCHA or required user verification pauses the run. Revocation stops new uses locally and queues provider-side removal or seed rotation. Prove removal independently.

What “passkey passthrough” can deliver

A local OS credential provider can answer a genuine RP ceremony on the device. Standard cross-device passkeys use proximity. A phone push does not establish proximity to a Cloudflare browser or give Llavero access to third-party passkeys in the OS store. For a remote run, prefer the provider's supported OAuth/device authorization or a documented transaction continuation. Complete the RP ceremony on the phone, and resume only if the provider binds the result to the intended transaction. If it offers no continuation, finish that task in an owner-only provider session and return a receipt, or report owner-required. A successful phone login alone does not authenticate a separate browser session. [WebAuthn · FIDO cross-device authentication · Apple credential provider · Android credential provider]

Push carries only the request ID and wakes the app. The phone fetches canonical details over its enrolled channel and signs the exact action, nonce, challenge reference, recipient and expiry. A denied, revoked or expired request cannot auto-prompt again. Keep provider sessions, assertions, seeds, QR enrollment data and codes out of notifications, app snapshots, analytics, crash reports, clipboard and backups. Enable each native platform's credential provider and each remote continuation only after a real-device and dummy-RP test. [TOTP specification]

Workers AI and Cloudflare Browser Run

Use the provider's API or a registered consent callback when available. For a reviewed browser playbook, a private Worker owns one isolated Browser Run session and an ephemeral provider session per job. Workers AI chooses among the allowed next step IDs. A deterministic runner rechecks the current state, caller, target, origin and policy before executing. Model output and provider page text carry no authority to change the plan.

Data flow for a browser-assisted runAllowed step IDsApproved actionOne bound decisionApproved originPrivate captureReceipt IDWorkers AIPlaybook runnerIsolated BrowserRun sessionPaired phoneProviderVaultAgent
The model receives playbook state. The browser sends captured material only into private custody. The agent receives the run outcome.
Diagram source
flowchart TB
    ai["Workers AI"] <-->|"Allowed step IDs"| runner["Playbook runner"]
    runner -->|"Approved action"| browser["Isolated Browser Run session"]
    phone["Paired phone"] -->|"One bound decision"| runner
    browser <-->|"Approved origin"| rp["Provider"]
    browser -->|"Private capture"| vault["Vault"]
    runner -->|"Receipt ID"| agent["Agent"]
  1. Navigation. Project only approved playbook state and finite public observations to the model. Unknown UI or free text yields a pause. Existing redacted accessibility trees and token-pattern checks are defense in depth. Arbitrary DOM, screenshots, URLs with queries and form values are unsuitable as model input for a secrets workflow.
  2. Authentication, generation and reveal. Run fixed, release-pinned code privately with inference, screenshots, snapshots, recordings, debugging attachments and body capture disabled. Exchange values directly with the vault or authorized provider. Cover subresources, redirects, frames, new tabs, downloads and WebSockets in the egress policy. The existing adapter's main-frame origin check is a starting point. Refuse a sensitive playbook if the required isolation cannot be enforced.
  3. Finish. Blank sensitive page state, dispose the context and session on success, cancellation and timeout, and reconcile an uncertain external change before opening another run. Feed only a fixed outcome and receipt to the agent. Use an owner-only provider session for required human steps. The privileged browser and the intended provider are trusted recipients of the values they consume.

Set Browser Run recording off at launch and restrict live-view/DevTools/session permissions. Disable Gateway prompt and response collection and caching for the lane, and apply restrictive account defaults. Verify actual Gateway, browser, tail/logpush and observability settings per deployment. Cloudflare recordings can include DOM, console and network data. A setting on the app logger alone cannot establish trace isolation. [Browser Run recordings · AI Gateway logging · Workers AI data usage]

Access, rotation and retirement

The owner approves a canonical policy over principal, org/project/stage, provider account, allowed operation, credential field, destination, verification method, overlap and retirement authority. An agent can propose or resume within that scope. Recheck grant, policy revision and account identity before each effect and after each wait. Drift or changed custody requires fresh approval.

Issue → deliver → verify uptake → overlap → retire. Reuse the rotation package's checkpointed state machine. Persist an intent and fencing sequence before external work. On ambiguous issuance or retirement, stop in reconciliation-required and query by a provider-supported idempotency marker or resource ID. An HTTP write receipt proves the destination accepted a value. Runtime evidence identifies the deployment/revision, exact binding and expected version through an authenticated challenge or a trusted, version-specific health probe. A generic green health check is insufficient.

Purpose and failure handling differ across rotation types. Provider rotation replaces a credential and eventually retires the old provider resource. Transit rotation creates a key-ring version for new writes and keeps authorized historical decrypt/verify access. Hardware root rotation rewraps stored unseal material. OpenBao barrier-key rotation has its own lifecycle. Passkey or TOTP replacement requires enrollment and revocation at the provider. Retain the working predecessor through its applicable overlap and recovery test.

Threats, audit and verification

What the trace guarantee covers. Every Llavero-controlled model input, tool call/result/error, log, trace, metric, replay, notification, receipt and helper output contains only allowlisted metadata. Audit actor, action, reference/version, recipient, policy digest, run ID, outcome and time. Free-form error bodies, ciphertext payloads, challenge responses, bearer grants, claims, signed redemption links and low-entropy fingerprints are excluded. Secret-bearing routes have static route names, body/header capture disabled, private no-store responses, and no sensitive data in URLs. Emit audit intent before sensitive reads, release, signing or external effects. Refuse the use if durable intent cannot be recorded. Send periodic signed chain heads to an independent retention-controlled store to detect truncation.

The upstream audit device and the Go host are part of that boundary. Install a device that projects a fixed field allowlist inside custody before serialization. Restrict audit configuration, raw request logging, debugging, profiling, memory dumps and the Go runtime’s stdout/stderr. Exercise Wasm traps, panic paths, seal failures and upstream errors with canaries. The operator evidence contains build IDs, timings and outcome codes. A dumped heap or a captured request body could contain plaintext.

Authorized value clients and intended providers necessarily receive plaintext for KV reads or credential use. An instrumented OpenBao client, an owner exporting a file, a compromised phone, an administrator able to replace trusted code, or an external provider's own logging lies outside the managed trace guarantee. Record trusted endpoints, vendor retention evidence and their operators for each enabled route. Where the surfaces cannot be inspected or supported by provider guarantees, keep that route outside the strict profile.

Release gatePass condition with dummy credentials
Execution provenanceReproduce the linked Wasm from the pinned source and patch set and match its digest to the deployed Worker bundle. Run the KV and Transit fixtures locally in workerd and on a disposable Workers deployment. Disable remote core egress. On a negative-control deployment keep the same gateway and storage but disable invocation of the Wasm entry point. Verify both engine requests fail. Record native-reference results, cold recovery and actual Cloudflare resource usage.
LeakageSeed unique ordinary-looking values, OTPs, key material and redemption capabilities. Scan raw/base64/URL-encoded and split values in the recorded MCP transcript, model inputs, stdout/stderr, OTLP collector, Worker tails, Sentry, PostHog, Gateway logs/cache, browser artifacts, queue/dead-letter payloads, push, audit and backups. Test success, timeout, cancellation, exceptions and provider echo. Verify forbidden artifacts were never collected. Replay every transcript-visible ID from an unrelated client and get denial.
Authorization and local isolationCross tenants, stages, RP IDs, grants, epochs and recipient keys. Revoke between approval and release. Attempt a second concurrent redemption and a digest/argument change. Run a dummy executable that emits the secret, attempts a file write, spawns a child and tries unapproved egress. No value, file or stream becomes available to the agent.
Wire compatibilityPin stock OpenBao and the actual client versions. Differentially test success, denial, CAS conflicts, list/metadata, version lifecycle, malformed inputs and Transit old ciphertext/signatures. Exercise discovery, authentication and renewal used by each named client. Publish an operation-by-operation conformance manifest.
Mobile and browserReal iOS and Android with a dummy RP and test seed. Prove same-RP enrollment and use, wrong origin/challenge rejection, user verification, offline expiry, denied/revoked device, clock drift, private code delivery and unsupported cloud-session handoff. Run a disposable Cloudflare session and inspect actual sinks for canaries before enabling each playbook.
Rotation, migration and recoveryLose the reply after issuance, after vault commit and after delivery. Race concurrent writers. Verify one committed version, independent per-sink receipts, no duplicate issue, no premature retirement, and a safe partial-delivery state. Restore D1, vault, external audit head and hardware root in isolation. Prove revoked access stays denied, destroyed versions stay unreadable and rollback serves every acknowledged post-flip mutation.
OperationsMeasure ForgeGraph peak bundle size, concurrency, deployment latency and restore/outage tolerance. Exercise two times measured peak as a proposed load test. Record numerical SLO, RPO and RTO with the operator, compare both HSM options, simulate regional isolation, and serve traffic only after the chosen route meets those targets. Alert on overdue rotation, hardware failures, audit gaps, uncertain delivery and missing uptake using IDs and codes only.

Delivery sequence and ownership

Phase 0 establishes whether Llavero can run OpenBao on the intended platform. ForgeGraph can inventory callers and prepare synthetic migration data immediately. Its first port-backed integration depends on Phase 0. Production also requires hardware recovery, named-client conformance, a trace scan and a rehearsed rollback. Mobile and browser fixture work can proceed independently. The implementation plan assigns each work package to an owner and identifies its files and acceptance tests. OpenBao on Workers implementation plan

Phase 0 · Execute upstream OpenBao in Workers

TaskFilesVerificationStatus
Port the release’s host-dependent imports and link the core, HTTP handler, KV and Transit into Wasm.tools/openbao-worker/, the upstream SHA, platform patch and generated bundle manifest.Rebuild by SHA, review the platform diff and instantiate the same module in workerd. Verify that the upstream core handles a denied and an allowed operation.Verified in workerd and Cloudflare
Bind SQLite physical storage, a fixture seal, a private audit device and durable deadlines. Deploy the fixture to Workers.Custody Worker bootstrap, physical adapter, seal adapter and Wrangler configuration.Unmodified CLI and SDK complete the KV and Transit sequence in the deployed isolate, repeat after eviction, and pass the resource and execution-provenance gates.Cloud recovery verified · audit and expiry pending

Phase 1 · Contracts and hardware

TaskFilesVerificationStatus
Llavero and ForgeGraph owners pin clients, operations, sizes, SLOs and trace surfaces.ForgeGraph CLI/routes and Llavero credential contractsReference server transcripts with fixtures and an inventory of direct value readers/writers.Proposed
Custody owners connect OpenBao auto-unseal to each hardware candidate.Private custody seal adapter, legacy envelope migration, install/CLI recovery.Hardware recovery after loss, audited on-policy unwrap, and refusal to admit production under software custody.Proposed

Phase 2 · KV v2, Transit and private exchange

TaskFilesVerificationStatus
Qualify the port’s named client profiles, token lifecycle, historical ciphertext and upgrades.Upstream built-ins, Worker request bridge, conformance manifest and fixture clients.Unmodified CLI and SDK pass the selected KV and Transit profiles against the deployed port and its native reference.Proposed
Move bearer claims to recipient channels and enroll the isolated helper.mcp-tools.ts, standin.ts, packages/cli/, executor protocolTrace replay is powerless. Pinned foreground and failing child tasks disclose only a receipt.Proposed

Phase 3 · ForgeGraph stage cutover

TaskFilesVerificationStatus
ForgeGraph routes all secret callers through the scoped store and migration bridge. Llavero resolves managed destination bindings internally.ForgeGraph packages/api/src/{lib/secret-store,routers/secret}.ts, deploy/CI paths and HTTP routes. Llavero packages/destinations/ and binding registry.Fixture overlay and redeploy, no legacy value access after flip, no recursion, verified rollback. Then one owner-approved hardware-backed production stage.Proposed

Phase 4 · Phone and browser-assisted rotation

TaskFilesVerificationStatus
Implement device-held factors and native credential-provider integrations. Exercise private Browser Run and Workers AI playbooks.apps/mobile/, packages/{stepup,browser-runtime,rotation}/, apps/executor/ and Worker bindingsDummy provider completes an attended rotation with no trace exposure. A separately enrolled automation account runs within its standing approval. Failure to confirm uptake preserves the old credential.Proposed

Open questions and evidence to collect

Kanbanger backlog proposal

Proposed title · Run upstream OpenBao in a Cloudflare Worker isolate and migrate ForgeGraph stage secrets.

Outcome and evidence · Existing ForgeGraph callers and named OpenBao clients keep their workflows. The current TypeScript vault and native-only dependencies in the upstream core leave the isolate requirement unmet. Software-root custody and claim-bearing MCP replies also need changes before the production cutover.

Owners and acceptance · Llavero backlog item LLAV-35 tracks the proposal. Llavero owns the upstream port, hardware seal, MCP, mobile and executor. ForgeGraph owns the store integration and deployment proof. Track a deployed KV/Transit proof after restart, hardware recovery, strict exchange canaries and a reversible ForgeGraph staging cutover. Hardware vendor selection and the first provider’s remote sign-in support remain open.