Conversation
Compose the existing primitives into a realistic resource-server scenario: a verified California driver delegates a scoped, time-boxed register-vehicle capability to the agent. The new register_vehicle tool runs a fail-closed pipeline — verify the driver credential and eligibility claims, verify the agent auth proof, check revocation against the DMV status list, verify the scoped delegation chain — then performs the simulated registration. The agent holds no DMV credentials and reaches no verdict itself; the tool is authoritative. The driver credential carries license class, residency, and validity but deliberately omits the license number (data minimization). Revocation is checked in memory against the DB status-list codec, so the demo and its eval stay offline and deterministic. Adds the dmv CLI scenario, an eval gate over the spec's eight golden cases plus a PII leakage canary, and the license claim terms to the agent-credential context. Built on the shared zcap-delegation helper. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
A new
dmvdemo: a verified California driver authorizes an AI agent to register one vehicle with the DMV on their behalf. Implementsdocs/dmv-demo-spec.md.The demo separates two concerns the age-gating demo collapsed into one:
A single over-broad VC claim is deliberately avoided — the grant must be a separate, attenuable, time-boxed capability.
How it works
A single fail-closed
register_vehicletool runs the spec's §6 pipeline, in order, denying on the first failure:residency: CA,licenseValid: true,licenseClass ∈ {C, M}), and the agent auth proof (signed-nonce challenge, so a captured delegation can't be replayed).@digitalbazaar/vc-status-listcodec.register-vehicledelegation chain from the DMV root down to this agent (action + target must match).The tool is authoritative: the agent reaches no verdict itself, it relays the tool's decision.
Privacy by design
The driver credential carries license class, residency, and validity — but deliberately omits the license number. The action needs eligibility, not identity-grade PII. A leakage-canary test asserts no PII surfaces in the agent's output or tool arguments.
New files
demo-agent/lib/dmv.js— simulated DMV resource server (in-memory status list + registration store).demo-agent/lib/dmvScenarios.js— driver VC + scopedregister-vehicledelegation + agent auth proof, built on the sharedzcapDelegatehelper from Extract shared zcap-delegation signing helpers #27.demo-agent/lib/dmvTools.js— the fail-closedregister_vehicletool.dmvscenario wired intoindex.js; license claim terms added to the agent-credential context.Tests
dmvScenarios.test.js— 15 unit tests over the server + builders; adversarial cases (wrong action, wrong agent, expired, out-of-state, tampered, bad/expired auth proof) outnumber the happy path.dmvEval.test.js— the spec §8 eval gate: 8 golden GRANTED/DENIED cases driven through the agent with a mocked model (offline, deterministic), asserting decision exact-match + tool-call-required, plus the PII leakage canary.npm run typecheckandnpm run lintclean; demo-agent 102 passing, mcp-server 191 passing (3 integration skipped).Decision note
Revocation runs in the DMV server against the in-memory status list rather than through
checkDelegation'sfetchStatusList(which does a live network fetch whencredentialStatusis set). This keeps the demo and its eval offline and deterministic while still exercising the genuine DB status-list codec.Builds on #27 (the shared zcap-delegation helper).
🤖 Generated with Claude Code