Repository navigation
Proposal: AMEP evidence extension (signed effect receipts for tool calls) - #31
stafordtituss wants to merge 3 commits into
Conversation
vendrell46
left a comment
There was a problem hiding this comment.
Reviewing from the payments side, since the Motivation and the 20 Nov call both name financial services as an early audience. Checked against 46e3c72 and AMEP at 2e89e84.
1. A financial receipt can't say how much was paid. The receipt's executed block has no amount, and the proposal doesn't say where one goes. AMEP's payment vectors (interop/approval-path-attacks) carry it in x-args, with the payee as the resource, and that README asks (question 3) whether a monetary threshold should be a profile. I think a payments server needs that answered before it can use the extension, for two reasons:
- Without an approval, nothing in the evidence bounds the amount. I rebuilt the packet of
small-payment-within-budget-needs-no-approvalwith the amount changed from 84.10 to 840000.00 EUR, and AMEP's Python verifier still sayspreserved. The other way round, two payments of 0.50 EUR under the samebudget: 100come outviolated(I2), like the suite's 2 × 600.00 split, because each irreversible payment costs 60 points whatever it moves. x-argscan't carry a limit. Spec §16 says extensions MUST NOT change outcomes, and each server picks its own member names inside it. So two servers' receipts for the same payment can't be compared, which is the problem the Motivation sets out to fix.
What would close it: for financial effects, one defined member with the amount as a decimal string and its asset (an ISO 4217 code, or a CAIP-19 id for a token), keeping the payee in resource. A mandate could then carry a cap in that asset, per call and per period, and I2 could keep a running total the way §9.2 does for points. Whether that lives in this extension or in an AMEP profile it points to is your call, but the extension should say where a payments server puts the amount.
2. Amounts as strings. Requirement 4 keeps numbers inside the I-JSON safe range but leaves out AMEP §12.1's advice that amounts SHOULD be strings. It's worth carrying over: a server that writes a token amount in base units as a JSON number passes 2^53 at about 0.009 of an 18-decimal token, and the verifier then marks every invocation in the packet unresolved (I7; checked with 10 tokens).
If useful, I can add must-reject vectors in the suite's format once the shape is settled: payments that each fit a per-call cap but together cross a period cap, one payment over the cap with no approval, and an amount with no asset, which should come out unresolved rather than preserved.
AI use: Claude Code wrote this comment on my behalf from the proposal and the AMEP repo, and ran the checks above with AMEP's Python verifier.
|
@stafordtituss thanks for putting this in the open. I run ops for Zambo, where every tool call through our MCP endpoint produces an AER-1 execution receipt in production (158K+ public receipts so far), so this is the design space I work in daily. Three points from that running system, aimed at the questions an evidence extension has to answer:
On verification: our receipts are checked by recomputing SHA-256 over the record's served canonical bytes and comparing against the record's output hash. Anyone can repeat that with a hash tool, no account and nothing from the vendor: https://zambo.dev/run/5497d6a7-49db-46ee-873f-54fdb28604ff is a live example (606 canonical bytes, recomputed digest matches the commitment exactly). Whatever signature scheme AMEP settles on, I would argue the verification story should be equally presentable: the auditor recomputes something from bytes they hold, rather than trusting that a signature was checked correctly upstream. |
…pt recovery, payment amounts Addresses the review comments on this PR: amounts on financial effects as exact decimal strings with limits defined in AMEP, a signed call statement per call, receipts bound to the exact signed invocation, argument digests on both sides, write-ahead storage with recovery via resources/read, and the minting rule.
|
@vendrell46 thank you, this was exactly the review this needed. I re-ran your cases against the Python verifier and they reproduced: 840000.00 EUR came out Revision 0.3 is now in this PR, with AMEP v0.3 on the repository's
The 0.50 EUR case is unchanged on purpose. The risk budget bounds autonomy across effects that have no common unit, so The suite has 24 vectors on amounts and limits, including:
I'd gladly take you up on the must-reject vectors, now that the shape is fixed. The set doesn't yet cover fees pushing a payment over a cap, or currency conversion on the debit side, and those would be especially welcome. The suite format is in |
|
Thanks @zambodotdev, these came straight from a running system, and they changed the design. Revision 0.3 is in this PR, with AMEP v0.3 on Outcome states. Absent was already
Lost responses are recoverable: servers store the evidence before replying, and the client fetches it with Binding. Receipts and statements carry Minting at execution time. This is now a requirement: receipts are produced on the execution path, before the result returns, and a receipt reconstructed from logs claims at most L1. Verification you can repeat. I agree it has to be checkable with bytes you hold and standard tools. The recipe in AER-1 → AMEP. I built an import adapter (
The adapter also reports what AMEP needs that AER-1 doesn't carry:
Would you be up for reviewing the profile, or running it against more of your receipts? An RFC 8785 input layout seems like the smallest change that would let the two formats compose. |
|
@stafordtituss yes, up for both. I read the aer1 profile in packages/conformance before replying, and its gap list is accurate about our receipts, including the two hard ones:
The call statement design also goes past what I asked for in a good way: args_digest on both sides turning an in-transit change into violated, and recovery through resources/read, close the lost-response case instead of just naming it. Where do you want the profile review: comments on this PR, or issues on the AMEP repo? Either way I will run the profile against a wider set of our receipts, across tools and provenance classes, and post what it reports, including any receipt where its checks and ours disagree. |
|
@zambodotdev thank you, that's a generous read, and good to have the L1 cap and the gap list confirmed from your side. Issues on the AMEP repository would be best, so this PR stays on the MCP extension:
On the input layout: when an RFC 8785 layout is available on your side, I'll add a test to the profile that binds a receipt to a signed invocation by digest alone, and report the result back here. |
This adds a draft Extensions Track proposal for
io.github.stafordtituss/amep-evidence, an optional extension that lets tool servers return signed receipts of the effects they actually executed, in thetools/callresult's_meta. An auditor can then verify afterwards, without trusting the agent or its host, whether each effect stayed within the authority the user delegated._meta: no new methods, no change to result content. Off unless both sides opt in.initialize, and2026-07-28withserver/discoverand per-request capabilities.#agents-wg.The TypeScript implementation follows in a separate PR to
packages/, ported to the{ id, setup(ctx) }extension API from modelcontextprotocol/typescript-sdk#2820 once that's released.Feedback is very welcome, especially on the open questions at the end of the proposal.
Update (revision 0.3). Following the review comments here:
completed,not_executedorfailed_after_effects, with an effect count);resources/read.The TypeScript reference implementation and AMEP v0.3 verifiers are on the AMEP repository's
mainbranch.