Skip to content

feat(a2a): verify AP2 mandates before paid invocation - #4963

Merged
asim merged 2 commits into
masterfrom
codex/4841-ap2-paid-invocation
Sep 21, 2026
Merged

asim merged 2 commits into
masterfrom
codex/4841-ap2-paid-invocation

Conversation

@asim

@asim asim commented Sep 21, 2026

Copy link
Copy Markdown
Member

The existing AP2 foundation signs/verifies mandates and records verification on completed tasks, but embedded paid tools could not inspect the authorization before acting. Assign stable task/context IDs before invocation and expose an immutable AP2FromContext snapshot to Invoke and StreamInvoke, including verification results under the existing explicit public-key option.

Focused handler tests cover a paid-tool boundary for normal and streaming requests: valid payment authorization proceeds, while tampered signatures, wrong x402 rail references and missing verification cannot execute the paid operation. Existing mandate, task continuation and streaming tests pass, as do the repository build and lint.

This completes the mandate foundation and focused paid-path integration. It does not execute real payments, add a settlement ledger, enforce application spend/replay policy or automatically forward trust across RPC; docs explain these boundaries.

Closes #4841.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 21, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review Completed 2026-09-21T08:02:52.758728Z dce925b PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: dce925be42

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread gateway/a2a/ap2_test.go Outdated
@asim
asim merged commit 20838fc into master Sep 21, 2026
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

a2a/x402: add AP2 mandate foundation for agent payments

1 participant