Skip to content

Reject duplicate agent policies and malformed x402 JSON - #783

Closed
Abdulwasiu45 wants to merge 1 commit into
Vellar-Wallet:devfrom
Abdulwasiu45:fix/agent-mint-x402-json-shape
Closed

Abdulwasiu45 wants to merge 1 commit into
Vellar-Wallet:devfrom
Abdulwasiu45:fix/agent-mint-x402-json-shape

Conversation

@Abdulwasiu45

Copy link
Copy Markdown
Contributor

Summary

  • Reject duplicate policy contract IDs within a single agent grant while allowing reuse across grants for different tokens.
  • Reject agent expirations at or before the current time before passkey resume or mint.
  • Reject valid JSON values that are not objects in PAYMENT-REQUIRED headers with a named error before consumers access payload fields.
  • Add regression coverage and preserve the x402 control-character vectors as reviewable text.

Fixes #762
Fixes #763
Fixes #668

Validation

  • Focused tests: npx vitest run src/agents-facade.test.ts src/x402-untrusted.test.ts src/x402-guards.test.ts (138 passed).
  • git diff --check passes.
  • Repository-wide typecheck and tests currently fail on unrelated existing errors in other files/contrib suites.

@github-actions

Copy link
Copy Markdown

Thanks for the contribution — but contributor PRs may only change files inside contrib/.

This PR touches file(s) outside that folder:

  • .gitattributes
  • src/agents-facade.test.ts
  • src/agents-facade.ts
  • src/x402-guards.ts
  • src/x402-untrusted-vectors.ts
  • src/x402-untrusted.test.ts

Please open a new PR with your changes scoped to contrib/ only, targeting dev. See CONTRIBUTING.md and contrib/README.md. If your assigned issue genuinely needs changes elsewhere, say so on the issue first — don't open a PR outside contrib/.

Questions? Ask in the Telegram group.

@github-actions github-actions Bot closed this Oct 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant