feat(PR25): human-to-agent delegation profile#41
Merged
Conversation
Extends MPCP to support human DID principals delegating bounded spending authority to AI agents via PolicyGrant. Schema / types: - PolicyGrantLike + CreatePolicyGrantInput: revocationEndpoint, allowedPurposes - BudgetScope: add TRIP for multi-day/multi-session delegations - budgetScopeSchema: add TRIP - policyGrantForVerificationSchema: add both new fields - SBA verifier: accept TRIP scope alongside SESSION New utility: - src/protocol/revocation.ts: checkRevocation() — async endpoint check with timeout; verifier stays stateless and synchronous - Exported from sdk/index.ts Demo: - examples/human-agent-trip/: Alice delegates $800 Paris trip to AI agent Shows purpose filtering, budget enforcement, post-trip audit, revocation - npm run example:human-agent-trip Tests: - test/protocol/revocation.test.ts (8 tests) - test/schema/artifact-schemas.test.ts: TRIP scope - test/protocol/policyGrant.test.ts: revocationEndpoint + allowedPurposes Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
3 tasks
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.
Summary
Extends MPCP to support human DID principals delegating bounded spending authority to AI agents.
Schema / types
PolicyGrantLike+CreatePolicyGrantInput:revocationEndpointandallowedPurposesfieldsBudgetScope: addTRIPfor multi-day/multi-session delegationsbudgetScopeSchema,policyGrantForVerificationSchema: updated accordinglysba.ts): acceptTRIPscope alongsideSESSIONNew utility
src/protocol/revocation.ts:checkRevocation(endpoint, grantId, options?)— async revocation check with configurable timeout; verifier pipeline stays stateless and synchronoussdk/index.tsDemo
examples/human-agent-trip/: Alice (DID key) delegates an $800 Paris trip budget to her AI agentallowedPurposesfilter (restaurant skipped), TRIP scope budget enforcement, 3 approved stops, post-trip audit, live revocation via mocked endpointnpm run example:human-agent-tripTests
test/protocol/revocation.test.ts(8 tests: happy path, revoked, timeout, error, URL encoding)test/schema/artifact-schemas.test.ts: TRIP scope acceptancetest/protocol/policyGrant.test.ts:revocationEndpoint+allowedPurposesflow-throughTest plan
npm run build— clean compilenpm test— 194/194 tests pass (22 test files)npm run example:human-agent-trip— full demo runs, revocation shownRelated
Spec PR:
mpcp-spec feat/spec-human-agent-profile🤖 Generated with Claude Code