Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions samples/python/scenarios/ghost-protocol/intent-mandate.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
"@context": [
"https://www.w3.org/ns/credentials/v2",
"https://ap2-protocol.net/v1"
],
"id": "urn:uuid:58a731d1-b2c3-4d4e-8f9a-1db618e6bfc3",
"type": ["VerifiableCredential", "IntentMandate"],
"issuer": "did:ethr:0x1db618e6bfc35bd48b91431a55c4948b27e7a539",

Check warning on line 8 in samples/python/scenarios/ghost-protocol/intent-mandate.json

View workflow job for this annotation

GitHub Actions / spellcheck

Unknown word (ethr)
"validFrom": "2026-04-13T10:00:00Z",
"credentialSubject": {
"id": "did:ethr:0x1db618e6bfc35bd48b91431a55c4948b27e7a539",

Check warning on line 11 in samples/python/scenarios/ghost-protocol/intent-mandate.json

View workflow job for this annotation

GitHub Actions / spellcheck

Unknown word (ethr)
"natural_language_description": "Allow ghost-protocol-node-v1 to purchase data proxies and hosting up to 200 USDC/mo.",
"intent_expiry": "2026-12-31T23:59:59Z",
"merchants": ["proxies.sx", "render.com"],
"user_cart_confirmation_required": false
},
Comment on lines +10 to +16
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

The credentialSubject is missing required fields defined in the IntentMandate model (see src/ap2/types/mandate.py). Specifically, natural_language_description and intent_expiry are mandatory. Additionally, the fields agentId, isNonCustodial, and constraints are present in the JSON but are not defined in the provided Python class, which may cause validation issues if this JSON is processed by the application.

  "credentialSubject": {
    "id": "did:ethr:0x1db618e6bfc35bd48b91431a55c4948b27e7a539",
    "agentId": "ghost-protocol-node-v1",
    "isNonCustodial": true,
    "natural_language_description": "Autonomous infrastructure management for ghost-protocol-node-v1",
    "intent_expiry": "2026-12-31T23:59:59Z",
    "constraints": {
      "maxAmount": "200.00",
      "currency": "USDC",
      "allowedMerchants": [
        "proxies.sx",
        "render.com",
        "google-agentic-commerce"
      ],
      "requiresHumanApproval": false
    }
  },

"proof": {
"type": "EthereumEip712Signature2021",
"created": "2026-04-14T10:30:00Z",
"verificationMethod": "did:ethr:0x1db618e6bfc35bd48b91431a55c4948b27e7a539#controller",

Check warning on line 20 in samples/python/scenarios/ghost-protocol/intent-mandate.json

View workflow job for this annotation

GitHub Actions / spellcheck

Unknown word (ethr)
"proofPurpose": "assertionMethod",
"proofValue": "[PASTE_YOUR_0x_SIGNATURE_HERE]"
},
"metadata": {
"linter_override": "cspell:ignore ethr"

Check warning on line 25 in samples/python/scenarios/ghost-protocol/intent-mandate.json

View workflow job for this annotation

GitHub Actions / spellcheck

Unknown word (ethr)
}
}
Loading