AgentSpaces Commerce defines the mandates and orders a trading group keeps in
its commerce space, and the check a member runs before it acts on a mandate.
A reader trusts Mandates.verify to tell it whether a credential chain holds,
so that check carries part of the trust in a trade. The library inherits the
security model of the AgentSpaces core (signed, self-certifying peers and
agents; the threat model in the AgentSpaces specification, SPEC §11).
Please report vulnerabilities privately via GitHub's security advisories:
https://github.com/badmonkeyai/agentspaces-commerce/security/advisories/new
A vulnerability in the space API, the wire codec, peering, or signatures belongs in the core repository's advisories: https://github.com/badmonkeyai/agentspaces/security/advisories/new
Do not open public issues for suspected vulnerabilities, and do not include exploit details in public discussions until we release a fix.
We will acknowledge your report within five business days, keep you informed of progress, credit you in the advisory unless you prefer otherwise, and coordinate the disclosure timeline with you. There is currently no bug bounty program.
Questions can be sent to oss [at] badmonkey.ai
Mandates.verify(mandate, trustedIssuers, now) checks one mandate's AP2
credential chain:
- the cart's items add up to its total;
- the issuer-signed JWT is ES256 and verifies under the key its
kidnames in the caller's trust map; - its
vctis an AP2 mandate type that matches the mandate's kind, and it has not expired atnow; - a closed checkout mandate's
checkout_hashis the digest of thecheckout_jwtit carries, and that JWT verifies under a trusted merchant; - a closed payment mandate's
transaction_idis the digest of the checkout JWT the credential carries, and itspayment_amountis the cart's total and currency; - a key-binding JWT verifies under the
cnf.jwkkey, and itssd_hashis the digest of the presentation.
docs/verification.md lists each check in order.
- No policy. It does not decide whether a trade is allowed, whether a shopper's mandate needs a basis, or whether an amount is within a limit.
- No network. It fetches no key, profile, status list, or revocation record, and it calls no merchant or payment network.
- No key storage. It holds no private key and signs nothing.
Jose.signtakes a key the caller holds. - Trust is the caller's map of kids. A key in
trustedIssuersis trusted for every role. The library does not tie akidto a role, a peer, or a domain, so a caller that must keep a merchant's key from signing as a user builds a separate map for each check. - No replay state. It remembers no mandate it has seen, and it does not
check a key-binding JWT's
aud,nonce, oriat.
In scope: anything in this repository that makes Mandates.verify return a
valid verdict for a chain that one of its checks should refuse, or that makes
a record carry what it must not. For example:
- a JWT that verifies under a key other than the one its
kidnames in the trust map, or under an algorithm other than ES256; - a closed checkout mandate whose
checkout_hashdoes not bind the checkout JWT it carries, and that still verifies; - a payment mandate whose amount or currency differs from the cart's, and that still verifies;
- a key-binding JWT that verifies under a key other than
cnf.jwk, or with ansd_hashover another presentation; - a
Jose.fromJwkthat accepts a key outside P-256, or a point off the curve; - bytes that decode into a record its constructor refuses.
Out of scope: the parties that sign and pay, which live in their own projects,
and the policy a caller applies to a valid verdict. Who may join a group and
write to its commerce space is the group's admission policy, which the core
enforces.
During 0.x, only the latest minor release receives security fixes.