Proposal: sample agent — mandate-bounded spending authority (gate before irreversible payment)
Maintainers usually reply within 7 days
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 35/100
- Issue type
- Feature
- Clarity
- Mostly clear
- Activity status
- Active
- Tech stack
- python
- Domain
- backend-api-design
Research direction
Start by reviewing the existing Python agent samples in samples/python/agents/ and the A2A Python SDK patterns they use; then compare the proposed mandate semantics with the linked MMF-v0.1 spec. Done means a sample demonstrates deterministic allow, deny, and revocation decisions, with mock settlement and a hash-chained evidence log returned as a task artifact.
Written by the indexing model from the issue text.
Description
I'd like to propose a Python sample agent in samples/python/agents/, built on the A2A Python SDK like the other samples.
What it demonstrates
A shopping agent receives purchase tasks over A2A. Before any payment is attempted, every proposed transaction passes through a mandate gate: a principal grants the agent bounded spending authority (amount cap, payee allowlist, expiry, velocity limit, cumulative budget). The gate evaluates the proposal deterministically and the verdict drives the A2A task state:
- ALLOW → task completes; the sample settles against a mock rail only — no real payment exists.
- DENY → task fails with a machine-readable reason (
payee not in allowed set,amount exceeds cap,mandate expired,velocity limit reached,cumulative budget exceeded). - REVOKED → demonstrates remote revocation: the principal revokes mid-session and the next attempt is denied at the gate.
- Every decision — allowances and denials — is appended to a hash-chained evidence log returned as a task artifact, demonstrating tamper-evident auditability.
Why here
Existing samples cover tool use, streaming, and multi-agent flows; #735 proposes a verdict-based correctness check before payment. Neither covers the complementary question: is the agent authorized to spend at all? Agent-initiated payments (x402, agentic commerce) increasingly need a deterministic authorization layer between probabilistic agent intent and irreversible settlement — this sample demonstrates that pattern end-to-end on A2A task states.
The mandate semantics used are defined in an open spec (MMF-v0.1) with an Apache-2.0 reference implementation (mandata) — the sample would double as a second implementation surface for the pattern. Related research framing: survey of agentic-payment safeguards.
Disclosure: I maintain the Mandata library and authored the linked survey. Happy to adjust scope — a self-contained version with no external dependency is equally fine.
- Dominant language
- Jupyter Notebook
- Stars
- 1.8k
- Forks
- 777
- Avg merge
- 9d 18h
- Merged PRs (30d)
- 21
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from a2aproject/a2a-samples
-
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
a2aproject/a2a-samples#696 ·
Maintainers usually reply within 7 days
-
Difficulty 1/5 Under an hour Newbie friendliness 90/100
a2aproject/a2a-samples#597 ·
Maintainers usually reply within 7 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
a2aproject/a2a-samples#551 · 1 comment ·
Maintainers usually reply within 7 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
a2aproject/a2a-samples#529 · 2 comments · 1 reaction ·
Maintainers usually reply within 7 days
-
AG2 sample uses OpenAI by default, inconsistent with other samplesMay be free again A pull request for this issue was closed without being merged. Open
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
a2aproject/a2a-samples#454 ·
Maintainers usually reply within 7 days
All issues in a2aproject/a2a-samples
Similar issues
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
internetee/registry#2984 ·
Maintainers usually reply within 6 days
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
apache/skywalking#14239 ·
Maintainers usually reply within 1 day
-
documentation
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
Maintainers usually reply within 1 day
-
Redis Lua error `@user_script:52: ERR value is not an integer or out of range` when `window_size` is configuredPossibly taken @mimosa claimed this today. Openbug
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
Maintainers usually reply within 1 day
-
ssa: wait errors drop the kstatus message, so health check failures don't say whyPossibly taken @schdief claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Maintainers usually reply within 1 day