Frida Protocol | protocol | try it as a buyer | merchant view | developers | app | sign in


frida-protocol/1: private negotiation between agents over A2A

JSON Schema · Markdown source · developer guide

Contents

States of one negotiation task: request, offer open, then order, decline or withdrawn.

Figure 1. One negotiation is one A2A task. The black path ends in a sale. (PDF)

The reference negotiation as ten messages.

Figure 2. The reference negotiation, as in Appendix A. (PDF)

Version 1.0.1, draft, 2026-11-28 (1.0.1 adds trust tiers against probing, coarse public reason codes, product identifiers, wire hygiene and a conformance kit; see the roadmap)

Extension URI https://protocol.frida.chat/ext/frida-protocol/v1

Media type application/vnd.frida-protocol.v1+json

Transport A2A (Agent2Agent) 1.0, JSON-RPC binding

JSON Schema /ext/frida-protocol/v1/schema.json

Reference implementation the frida-protocol SDK (TypeScript, Apache-2.0), in packages/frida-protocol of the Frida repository

Formerly moma-trade/1 (extension URI https://moma-black.vercel.app/ext/moma-trade/v1). Renamed on 2026-11-30; the messages and rules are unchanged, but agents must use the new extension URI, media type and token types.

The key words MUST, MUST NOT, REQUIRED, SHOULD, SHOULD NOT, RECOMMENDED, MAY and OPTIONAL are to be read as described in RFC 2119 and RFC 8174 when, and only when, they appear in all capitals.

1. Overview

The first agentic commerce protocols solved discovery, checkout and payment authorisation. UCP (Universal Commerce Protocol) and ACP (Agentic Commerce Protocol) let an agent find a product and check out; AP2 (Agent Payments Protocol) lets it prove what its principal allowed it to spend. All three treat the price as a read-only field: an agent finds a $280 jacket and pays $280.

frida-protocol/1 is the missing step between finding and paying. A buyer's agent sends a request to one or more merchant agents. Each merchant agent answers with a signed offer, priced for this buyer, now, from its own inventory. The two agents haggle for a bounded number of rounds, and an accepted offer becomes a signed order that settles over whatever rail the merchant supports: UCP or ACP checkout, an AP2 mandate, a checkout link, or a sandbox.

Design goals:

frida-protocol/1 is an A2A profile extension: it narrows A2A messages to a data part with a known schema and maps the negotiation onto the A2A task lifecycle. It adds no JSON-RPC methods.

2. Roles

RoleRequiredDoes
Buyer agentYesActs for one person. Sends requests, counters, holds, accepts and withdrawals. Keeps the person's limit private. A2A client.
Merchant agentYesActs for one merchant. Prices from live inventory and goals, makes signed offers and orders. A2A server.
WitnessNoA neutral network that observed past transactions and signs facts about either side: buyer passports, merchant passports, funds attestations.
BookNoHolds standing orders (AP2 open mandates) and shows merchants aggregate demand. See section 11. Experimental.

A single deployment MAY play several roles. Frida plays witness and book for its demo network.

3. Discovery

3.1 Agent Card

A merchant agent MUST publish an A2A Agent Card. When one agent is served per origin it SHOULD be at /.well-known/agent-card.json; when several agents share an origin, each agent's card MUST be at {agent base URL}/.well-known/agent-card.json. A buyer given a base URL appends that path; a URL ending in .json is the card itself.

The card MUST list a JSONRPC interface with protocolVersion 1.0 in supportedInterfaces, and MUST declare the extension in capabilities.extensions:

{
  "uri": "https://protocol.frida.chat/ext/frida-protocol/v1",
  "description": "frida-protocol/1: private, bounded price negotiation with signed offers",
  "required": true,
  "params": {
    "merchant_id": "https://harbor.example/agent",
    "jwks_uri": "https://harbor.example/agent/.well-known/jwks.json",
    "currencies": ["USD"],
    "max_rounds": 4,
    "settlement": ["ucp_checkout", "continue_url"],
    "categories": ["outerwear"],
    "ships_to": ["US"],
    "witnesses": ["https://protocol.frida.chat"]
  }
}
ParamTypeRequiredMeaning
merchant_idstringYesThe id that appears as merchant.id in every offer and order. RECOMMENDED: the agent's base URL.
jwks_uriURLYesJWKS with the public keys that sign offers, orders and the card.
currenciesstring[]YesISO 4217 codes the merchant prices in.
max_roundsintegerYesMost counter rounds the merchant takes part in.
settlementstring[]YesSettlement methods, preferred first (section 10).
categoriesstring[]NoWhat the merchant sells, for directories.
ships_tostring[]NoISO 3166-1 alpha-2 countries.
witnessesURL[]NoIssuers whose credentials the merchant reads.

A merchant agent that speaks only frida-protocol/1 SHOULD set required: true. Its card SHOULD carry defaultInputModes: ["application/vnd.frida-protocol.v1+json"].

The card SHOULD be signed as A2A 1.0 section 4.4.7 describes: one entry in signatures whose protected header is {"alg":"ES256","kid":<kid>,"typ":"JOSE","jku":<jwks_uri>} and whose signature covers protected + . + base64url of the RFC 8785 canonical form of the card without signatures.

3.2 Keys

jwks_uri MUST serve {"keys": [...]} with P-256 keys of the form {"kty":"EC","crv":"P-256","x":…,"y":…,"kid":…,"alg":"ES256","use":"sig"}. kid MUST be the RFC 7638 thumbprint (SHA-256, base64url). To rotate, publish the new key alongside the old one until the old one's offers have expired.

3.3 Directories

How a buyer agent finds merchant agents is out of scope. A directory MAY publish a JSON list of agent card URLs with categories; Frida publishes one for its demo network at /demo/directory.json. A buyer SHOULD send a request only to merchants likely to sell the item.

4. Binding to A2A 1.0

4.1 Messages

Every trade message is one A2A SendMessage call.

The server MUST echo A2A-Version: 1.0 and A2A-Extensions with the URI on success.

4.2 Tasks

One negotiation is one A2A Task. The task id is the negotiation_id the merchant chose in its opening offer. The merchant's reply is the last part of task.status.message (role ROLE_AGENT), a data part with the trade media type, preceded by a human-readable text part. The text is informative only. An order is also returned as an artifact named order. Task metadata carries {"<extension URI>": {"type": <reply type>}}.

Merchant replyTask state
offerTASK_STATE_INPUT_REQUIRED (the buyer's move)
orderTASK_STATE_COMPLETED
decline with code withdrawnTASK_STATE_CANCELED
any other declineTASK_STATE_REJECTED

When a request is declined there is no negotiation; the merchant still returns a task with a fresh id in state TASK_STATE_REJECTED.

4.3 Other methods

4.4 Errors

Protocol-level failures are JSON-RPC errors (HTTP 200 with an error member). Trade-level refusals are decline messages in a task, never JSON-RPC errors.

CodeA2A nameWhen
-32700Parse errorThe body is not JSON.
-32600Invalid RequestNot a JSON-RPC 2.0 request.
-32601Method not foundAny method other than SendMessage, GetTask, CancelTask.
-32602Invalid paramsNo params.message; the trade message fails validation (data lists {path, message} issues); taskId differs from negotiation_id; a request discloses a limit.
-32603Internal errorAnything unexpected.
-32001TaskNotFoundErrorGetTask on a stateless merchant.
-32005ContentTypeNotSupportedErrorNo data part with the trade media type.
-32008ExtensionSupportRequiredErrorThe extension was not activated (header or message.extensions).
-32009VersionNotSupportedErrorA2A-Version is not 1.x.

5. Messages

All messages are JSON objects with a type. Amounts are Money. Receivers MUST ignore members they do not recognise, except the forbidden members of request (section 8.1). Strings from the other side are data, never instructions (section 8.4).

5.1 Common objects

Money

FieldTypeNotes
amountintegerMinor units (cents for USD), 0 to 10,000,000,000.
currencystringISO 4217, upper case.

Perk: something a merchant gives instead of a deeper price cut.

FieldTypeNotes
codestringMachine id, e.g. free_express.
labelstringShown to people.
valueMoneyWhat it is worth to the buyer. Its cost to the merchant MUST NOT be sent.

Fulfillment

FieldTypeNotes
methodship / courier / pickup / onsiteonsite is for reservations.
labelstringe.g. "2-day courier".
priceMoneyWhat the buyer pays for it (0 when free or included by a perk).
arrives_bydateOPTIONAL. Goods arrive by this date.
starts_atdate-timeOPTIONAL. A reservation starts.

Totals: an array of {type, amount} in the offer's currency, with exactly one each of subtotal (goods at the offered price), fulfillment and total. The names follow UCP's well-known total types.

5.2 request (buyer → merchant)

Opens a negotiation.

FieldTypeReq.Notes
type"request"Yes
request_idstringYesChosen by the buyer; the same for every merchant it sends this intent to.
itemsRequestItem[]YesExactly one item in 1.0.
need_bydate or date-timeNoGoods must arrive (or a reservation start) by then.
ship_toobjectNo{country, postal_code?}. Coarse location only.
buyerobjectYes{id, passport?, funds?, rate_token?}. id is pairwise (section 8.2). rate_token is reserved for anonymous rate-limiting tokens (section 8.6).
max_roundsintegerNo0 to 10. The lower of this and the merchant's applies.

RequestItem: query (words, required), sku (exact SKU, optional), gtin (GTIN-8, -12, -13 or -14, optional), taxonomy ({system, id} in a public taxonomy such as google or unspsc, optional), category (optional), attributes (string map such as {"size": "M"}; hard constraints), quantity (1 to 1000, required).

When a request carries a gtin and the merchant knows the SKU's GTIN, matching MUST be exact: no match is a no_match, whatever the query says. Offer lines MAY carry the gtin of what is offered. Free text is the fallback, not the contract.

{
  "type": "request",
  "request_id": "req_YFNC_PNVTx9w54kT",
  "items": [{ "query": "waterproof commuter shell", "attributes": { "size": "M" }, "quantity": 1 }],
  "need_by": "2026-12-03",
  "max_rounds": 4,
  "buyer": { "id": "byr_dDldE4tB9y1ZkCg0HyvCYw", "passport": "eyJhbGciOiJFUzI1NiIs…" }
}

5.3 offer (merchant → buyer)

A signed price for this buyer, now.

FieldTypeNotes
type"offer"
offer_idstringNew for every offer.
negotiation_idstringChosen in the opening offer; constant after. Also the A2A task id.
request_id, buyer_idstringCopied from the request.
merchant{id, name}id equals the card's merchant_id.
roundinteger0 for the opening offer, +1 for each offer that answers a counter.
max_roundsintegerThe round limit that applies.
finalbooleanBest and final: the buyer may accept, hold or withdraw.
agreedbooleanThe offer matches the buyer's last counter; accepting closes the deal.
linesOfferLine[]{sku, title, attributes?, quantity, unit_price, list_price}. list_price is the public price.
perksPerk[]Included perks.
fulfillmentFulfillment
totalsTotals
currencystring
reasonsstring[]Why the price is what it is (section 5.10).
hold{until, quantity}OPTIONAL. Stock reserved for this buyer until until.
need_bydateOPTIONAL. Echoed from the request.
counterpartyobjectWhat the merchant verified: {passport_verified, return_rate?, funds_verified?}. Echoed so a stateless merchant can resume.
settlementstring[]Methods this offer can be accepted with, preferred first.
passportstringOPTIONAL. The merchant's witness passport.
issued_at, expires_atdate-timeThe offer is void after expires_at.
notestringOPTIONAL. Human-readable.
signaturestringDetached JWS (section 7).
{
  "type": "offer",
  "offer_id": "off_xkQmVFftgg7Y4Lwy",
  "negotiation_id": "neg_zfTwK6zDYhwkpff0",
  "request_id": "req_YFNC_PNVTx9w54kT",
  "buyer_id": "byr_dDldE4tB9y1ZkCg0HyvCYw",
  "merchant": { "id": "https://harbor.example/agent", "name": "Harbor & Pine" },
  "round": 0, "max_rounds": 4, "final": false, "agreed": false,
  "lines": [{
    "sku": "HP-SHELL-NVY-M", "title": "Waterproof Commuter Shell",
    "attributes": { "size": "M", "color": "navy" }, "quantity": 1,
    "unit_price": { "amount": 23800, "currency": "USD" },
    "list_price": { "amount": 27500, "currency": "USD" }
  }],
  "perks": [],
  "fulfillment": { "method": "ship", "label": "Standard shipping", "price": { "amount": 0, "currency": "USD" }, "arrives_by": "2026-12-03" },
  "totals": [{ "type": "subtotal", "amount": 23800 }, { "type": "fulfillment", "amount": 0 }, { "type": "total", "amount": 23800 }],
  "currency": "USD",
  "reasons": ["high_cover", "aging", "season_end", "low_return_buyer"],
  "hold": { "until": "2026-11-28T17:30:00.000Z", "quantity": 1 },
  "need_by": "2026-12-03",
  "counterparty": { "passport_verified": true, "return_rate": 0.02, "orders": 14 },
  "settlement": ["continue_url"],
  "issued_at": "2026-11-28T17:00:00.000Z",
  "expires_at": "2026-11-28T17:15:00.000Z",
  "note": "opening offer",
  "signature": "<base64url header>..<base64url signature>"
}

5.4 counter (buyer → merchant)

FieldTypeReq.Notes
type"counter"Yes
negotiation_idstringYes
in_reply_toOfferYesThe merchant's latest offer, unchanged: every member as received, including signature.
priceMoneyYesProposed unit price, in the offer's currency.
notestringNoUp to 280 characters.

5.5 hold (buyer → merchant)

Asks the merchant to reserve stock at the offered terms, typically while a human approves. in_reply_to is the offer; minutes is 1 to 120. The merchant answers with the same terms re-issued as a new offer (new offer_id, same round) whose hold.until is now plus minutes and whose expires_at is no earlier than hold.until.

5.6 accept (buyer → merchant)

FieldTypeReq.Notes
type"accept"Yes
negotiation_idstringYes
in_reply_toOfferYesThe offer being accepted, unchanged.
settlementstringNoOne of the offer's settlement methods. Default: the first.
mandatestringNoAP2 mandate authorising this purchase (compact JWS or SD-JWT).

The merchant answers with an order or a decline.

5.7 withdraw (buyer → merchant)

{type: "withdraw", negotiation_id, reason?}. Ends the negotiation and releases any hold. The merchant answers with a decline whose code is withdrawn (task TASK_STATE_CANCELED). A buyer SHOULD withdraw from every negotiation it doesn't accept.

5.8 order (merchant → buyer)

A signed record of the accepted terms and how to pay.

FieldTypeNotes
type"order"
order_idstring
negotiation_id, offer_id, buyer_idstringoffer_id is the accepted offer.
merchant{id, name}
lines, perks, fulfillment, totals, currencyExactly the accepted offer's terms.
statusconfirmed / requires_paymentrequires_payment when the buyer must still complete a checkout or follow continue_url.
settlementobject{method, continue_url?, checkout?: {protocol: "ucp" or "acp", endpoint, session_id}, reference?}
issued_atdate-time
signaturestringDetached JWS.

5.9 decline (merchant → buyer)

{type: "decline", negotiation_id?, request_id?, code, message}.

CodeMeaning
no_matchNothing in the catalog matches the request.
out_of_stockIt matches, but not in that quantity, size or variant, or it sold out.
offer_expiredThe echoed offer is past expires_at. Send a new request.
invalid_offerThe echoed offer isn't this merchant's, isn't for this negotiation, or was changed.
final_offerReserved. A counter to a final offer is answered with the same offer (section 6.3).
unsupportedWrong currency, or a settlement method the offer doesn't list.
funds_requiredThe merchant needs a mandate or funds attestation to hold or accept.
passport_requiredHolds (or deeper terms) are only for buyers with a verified witness passport (section 8.5).
mandate_invalidThe mandate doesn't verify or doesn't cover the order.
withdrawnAcknowledges a withdraw.

5.10 Reason codes

Offers explain their price with codes, in two tiers. Codes are closed strings matching ^[a-z0-9][a-z0-9_.:-]{0,63}$; merchants MAY add their own, prefixed with a domain they control (example.com:clearance). Reasons MUST be truthful; a buyer agent MAY treat a merchant whose reasons don't match witnessed behaviour as less trustworthy.

Public codes are safe to send to anyone, including a competitor probing the endpoint:

CodeMeaning
promotionalPriced below list for reasons the merchant keeps private.
limited_stockLittle stock left: no discount.
time_sensitiveThe offer's value falls with time (fresh goods, a reservation).
fulfillment_adjustedDelivery price or speed adjusted to the merchant's capacity.
buyer_rewardPriced for this buyer's witnessed record.
perk_offeredSomething added instead of a deeper cut.

Detailed codes reveal inventory distress and cash pressure. A public endpoint that sends them to anyone lets a rival or data broker reconstruct the merchant's position by asking every day. A merchant SHOULD send detailed codes only to counterparties its disclosure policy trusts (by default: a verified buyer passport with a witnessed record, section 8.5) and SHOULD send each one's public code to everyone else.

Detailed codeMeaningPublic code
agingStock has been on hand long enough to cost money.promotional
high_coverMany days of stock at the current sales rate.promotional
season_endA clear-by date is near.promotional
spaceClearing warehouse space for incoming stock.promotional
cash_conversionTrading margin for immediate settlement.promotional
perishableValue falls to zero at a deadline (fresh goods, tonight's table).time_sensitive
low_coverFew days of stock left: no discount.limited_stock
packing_backlogMoving demand to slower shipping while packing is backed up.fulfillment_adjusted
low_return_buyerThe buyer's witnessed return rate is low, so expected return cost is lower.buyer_reward
perk_instead_of_cutNear the floor: adding something cheap to give instead of a deeper cut.perk_offered

6. Negotiation rules

6.1 Rounds

The opening offer is round 0. Each offer that answers a counter has round one higher than the offer it answers. The round limit is the lower of the merchant's max_rounds and the request's max_rounds (when given). A merchant MUST mark an offer final when its round reaches the limit, and MAY mark any offer final earlier, for example at its floor or when it never discounts (low_cover).

6.2 Prices only move toward agreement

Within one negotiation a merchant MUST NOT offer a higher unit price than its previous offer, and MUST NOT remove a perk it already included. A buyer SHOULD NOT counter lower than its previous counter. A counter at or above the offer's unit price is answered with an offer at no more than the previous price.

6.3 Final and agreed

6.4 Expiry

Every offer has expires_at. A merchant MUST decline with offer_expired any counter, hold or accept whose in_reply_to has expired. Fifteen minutes is RECOMMENDED for goods; perishable capacity may use less.

6.5 Holds

An offer MAY carry hold: the merchant has set aside quantity units for this buyer until until. A merchant SHOULD honour a hold for its full duration and MUST release it on withdraw or when it lapses. An offer that answers a counter keeps a hold that hasn't lapsed.

Holds are tiered, because a free hold lets a competitor or a bot lock up stock for nothing:

6.6 Perks instead of cuts (non-normative)

When a buyer pushes toward a merchant's floor, the merchant can offer something that costs it less than it is worth to the buyer: a $16 courier upgrade that costs $6, a $40 scarf that costs $8. Priced so the buyer's effective price beats their bid while the merchant still nets more than the bid, a perk moves both sides closer than a cash cut would. Section 12 gives the reference formula.

7. Signatures and verification

7.1 Signing a message

Merchants MUST sign every offer and order. Buyer messages are not signed in 1.0; buyer facts come from witness credentials.

  1. Take the message without its signature member.
  2. Serialise it with RFC 8785 (JSON Canonicalization Scheme): object members sorted by UTF-16 code units, no insignificant whitespace, ECMAScript number and string serialisation. Absent members are omitted, never null.
  3. Protected header: {"alg":"ES256","kid":"<RFC 7638 thumbprint>","typ":"frida-protocol+jws"}, base64url-encoded (B64H).
  4. Signing input: B64H + "." + base64url(canonical JSON).
  5. Sign with ECDSA P-256 and SHA-256. The signature is the 64-byte r || s (IEEE P1363), base64url-encoded (B64S).
  6. Set signature to B64H + ".." + B64S (RFC 7515 Appendix F, detached content).

This is the same construction UCP uses for ap2.merchant_authorization.

7.2 What a buyer verifies

For every offer and order, a buyer agent MUST:

  1. Fetch the merchant's card and the JWKS at its jwks_uri (both MAY be cached).
  2. Verify signature with the key whose kid matches the header (step 7.1 in reverse). If it fails, stop negotiating with that merchant.
  3. Check merchant.id equals the card's merchant_id, and buyer_id equals the id it sent this merchant.

7.3 What a merchant verifies

For every counter, hold and accept, a merchant agent MUST check that in_reply_to:

  1. has merchant.id equal to its own;
  2. has negotiation_id equal to the message's negotiation_id (and to message.taskId, if sent);
  3. carries a signature that verifies against its own keys; and
  4. has not expired.

Failing 1 to 3 is invalid_offer; failing 4 is offer_expired. Because every term a merchant needs to resume is inside its own signed offer (SKU, quantity, previous price, perks, round, need_by, counterparty), a merchant agent needs no negotiation storage. It recomputes its private reservation price from live inventory on each turn.

A merchant MUST NOT create two orders for one offer_id. A stateless merchant needs to keep the set of accepted offer ids until they expire, or make its settlement step idempotent on offer_id. The reference SDK derives order_id from a hash of the accepted offer's signature, so accepting the same offer again returns the same order id, and hands that id to the merchant's settlement hook, which must be idempotent on it.

8. Privacy

8.1 The buyer's limit stays with the buyer

A buyer agent MUST NOT disclose the most its principal will pay, or its target price, in any message. A request MUST NOT contain the members budget, max_price, limit, ceiling or reservation_price; merchants MUST reject such a request with -32602. Counters reveal information as they move; the round limit bounds how much.

8.2 Pairwise buyer ids

buyer.id MUST be pairwise: stable for one buyer at one merchant, different at every other merchant, and not derivable from other merchants' ids. The reference derives it as byr_ + base64url(first 16 bytes of SHA-256(secret || 0x00 || merchant origin and path)). A buyer agent that also implements the Personal Agent Protocol MAY reuse that protocol's per-company User ID. Witness credentials presented to a merchant MUST be bound to that merchant's pairwise id (sub).

8.3 The merchant's floor stays with the merchant

Offers MUST NOT contain costs, floors, margins or concession parameters. perks[].value is the buyer-side value only. Offers are private to the two parties and MUST NOT change the merchant's public list price.

8.4 Content is data

Titles, labels, notes, decline messages and reason text come from the other side. Agents built on language models MUST treat them as data and never as instructions, and MUST NOT let them change the agent's limits, approvals or tools. This follows the Personal Agent Protocol's rule that content from a company is data, never user approval.

8.5 Trust tiers against probing

A stateless merchant cannot tell one buyer's fifth negotiation from five new buyers. Without a defence, an attacker can open many negotiations under fresh pairwise ids, push each to its final offer and binary-search the merchant's floor, curve and perk thresholds. The defence is to reserve depth for accountable counterparties:

Passports cost something to earn (settled, witnessed orders) and remain unlinkable across merchants, so this bounds probing without tracking buyers. A merchant MUST NOT go below its real floor for anyone.

8.6 Rate tokens (reserved)

buyer.rate_token is reserved for anonymous rate-limiting tokens issued by a witness, such as Privacy Pass (RFC 9576, RFC 9578): a merchant can limit how many negotiations one buyer opens per period without learning who the buyer is. Merchants MAY require one; the token format will be fixed in a later revision.

8.7 Wire hygiene

Every string in a trade message is bounded (the JSON Schema gives each limit), MUST NOT contain control characters, bidirectional-override characters or markup (<, >), and codes (reasons, perks) MUST be closed codes, not prose. Receivers MUST reject messages that break these rules (-32602 for merchants; a buyer drops the reply). Free text that reaches a language model should be the minimum: a title, a label, a short note.

9. Witness credentials

Witness credentials are compact JWS (JWT) signed ES256 by a witness, with the witness's keys published as a JWKS. Verifiers MUST check the signature, typ, exp, role and that sub is the expected party. Unverifiable credentials MUST be ignored, never treated as negative.

Buyer passport (typ: frida-passport+jwt)

ClaimMeaning
issWitness URL.
subThe buyer's pairwise id at this merchant.
role"buyer"
ordersOrders the witness saw settle.
return_rateShare of those orders returned, 0 to 1.
disputesDisputes opened.
iat, expSeconds since the epoch. Reference lifetime: 1 hour.

Merchant passport (typ: frida-passport+jwt)

ClaimMeaning
iss, iat, expAs above. Reference lifetime: 24 hours.
subThe merchant's merchant_id.
role"merchant"
ordersOrders witnessed.
on_time_rateShare delivered by the promised date.
fit_accuracyShare not returned for fit or "not as described".
return_rateShare returned for any reason.
refund_hoursMedian hours from return to refund.

Funds attestation (typ: frida-funds+jwt)

ClaimMeaning
iss, iat, expAs above. Reference lifetime: 15 minutes.
subThe buyer's pairwise id.
currencyCurrency the buyer can settle in.
can_settletrue: the witness checked an AP2 mandate able to pay.
mandate_hashOPTIONAL. Hash of that mandate.

A funds attestation MUST NOT include the mandate's amount. When a merchant verifies a funds attestation it records counterparty.funds_verified: true in its offers.

10. Settlement and interoperability

An order hands off to a payment rail. settlement.method is one of:

MethodHand-off
ucp_checkoutsettlement.checkout names a UCP checkout session already priced at the deal.
acp_checkoutsettlement.checkout names an ACP checkout session already priced at the deal.
ap2_directThe merchant charges against the AP2 mandate sent with accept.
continue_urlAn HTTPS URL where a person completes payment at the negotiated price (human present).
sandboxNo money moves. For demos and tests.

Vendors MAY define other methods, named with a reverse domain they control.

10.1 UCP

The merchant creates the session (POST /checkout-sessions) with the order's line items at list price and expresses the negotiated difference with the discount extension (dev.ucp.shopping.discount): one entry per line in discounts.applied with title "Negotiated price", amount equal to (list − unit_price) × quantity, automatic: true, method: "each" and an allocation to that line. The session's total MUST equal the order's total. Perks appear as zero-priced line items or as a zero fulfillment total. If the platform and business negotiated dev.ucp.common.payment.ap2_mandate, the buyer completes the session with its AP2 checkout mandate as UCP specifies.

A UCP business that also speaks frida-protocol/1 MAY advertise it in its UCP profile:

{
  "ucp": {
    "version": "2026-08-25",
    "capabilities": {
      "com.frida.protocol.negotiation": [{
        "version": "2026-11-28",
        "spec": "https://protocol.frida.chat/protocol",
        "schema": "https://protocol.frida.chat/ext/frida-protocol/v1/schema.json",
        "extends": "dev.ucp.shopping.checkout",
        "config": { "agent_card": "https://harbor.example/agent/.well-known/agent-card.json" }
      }]
    }
  }
}

UCP binds a capability namespace to the host serving its schema. This name becomes final when the specification moves to a domain its publisher controls.

10.2 ACP

The merchant creates a checkout session (POST /checkout_sessions) whose line item totals carry the negotiated unit price, with the difference from list as an items_discount total. The buyer completes it with a shared payment token whose Delegated Payment allowance.max_amount covers the order total, in the order's currency (lower case, as ACP writes it), bound to that checkout_session_id.

10.3 AP2

When accept carries a mandate, the merchant SHOULD verify that the checkout mandate allows this merchant and this SKU and that the payment mandate's amount range covers the order total before charging, and decline with mandate_invalid otherwise. A buyer agent MUST NOT accept an offer above what its mandate allows; above its auto-approve limit it SHOULD hold and ask its human first.

10.4 The Personal Agent Protocol

The Personal Agent Protocol handles who the buyer is: discovery of a company, sessions with pairwise user ids, sign-in and account access. frida-protocol/1 handles price. A company MAY list its merchant agent in poppy.json under a domain-named extension, for example "extensions": {"protocol.frida.chat/frida-protocol": [{"version": "1", "endpoint": "https://harbor.example/agent/.well-known/agent-card.json"}]}, and a signed-in session MAY be used to settle an order on the user's account.

11. Standing orders and the book (experimental)

A buyer can leave a standing order: buy this item if a merchant clears it at or under a limit before a date. A standing order is an AP2 open mandate pair, signed by the buyer's agent:

A book holds standing orders and shows each merchant only aggregate demand for its own SKUs: counts in $5 bands (the limit rounded down to a multiple of 500 minor units), never identities or exact limits. A merchant sweeps the book by choosing one clearing price at or above its floor. Every standing order whose limit is at or above that price fills at that price, oldest first, up to the stock available. Buyers pay the clearing price, not their limit, and the public list price does not change.

The wire format between book, buyers and merchants is not standardised in 1.0. Frida's demo exposes it over HTTP and MCP.

12. Reference merchant policy (non-normative)

The reference SDK prices from five live signals. Any policy that respects sections 6 and 8 conforms.

All amounts are minor units. nicePrice(x) rounds to the nearest whole dollar from $20 and to the nearest $0.10 below.

  1. Velocity and days of cover. cover = on_hand / max(0.05, velocity_per_day). If cover < 7 and on_hand <= 3 (and the item isn't perishable), the price is firm: open at list (or list times 1 + scarcityPremium × (1 − cover/7)), β = 0, the opening offer is final, reason low_cover. If cover > 45, add a discount of min(0.06, 0.0015 × (cover − 45)), reason high_cover.
  2. Aging and perishability. For durable goods, add 0.05 at 45 days, 0.09 at 60, 0.15 at 90 (reason aging). For goods with a deadline expires_at, within window hours of it (3 by default) add maxDiscount × (1 − hours/window) and lower the floor to the item's variable cost (reason perishable). A clear-by date within 30 days makes the merchant concede faster (reason season_end).
  3. Unit economics. floor = max(ceil(cost / (1 − marginFloor)), round(list × (1 − maxDiscount))). open = max(floor, nicePrice(list × (1 − discount))), with discount capped at maxDiscount. soft = floor + round(0.45 × (open − floor)): below it, the agent prefers perks to cash cuts.
  4. Warehouse and cash. Congestion adds 0.04 on bulky SKUs (space). "Accelerate cash conversion" adds 0.05 (cash_conversion). A packing backlog makes express shipping dearer.
  5. Counterparty quality. With a verified buyer passport whose return rate is below the category's, the agent concedes an extra min((categoryReturnRate − return_rate) × returnCost, maxPct × list) per unit.

Concession. With β the patience (0.6 by default, 1 or more under pressure, 2 for perishable capacity) and R the round limit, the merchant's target at round r is max(floor, round(open − (r/R)^(1/β) × (open − floor) − adjustment)).

Answering a bid b with previous price p:

The reference buyer. Effective price is total − round(0.8 × Σ perk values). It opens at 86% of the opening offer (80% when the strategy is cheap, 92% for quality or fast), rounded to $5, never above its target or limit, and concedes toward its limit on the same curve (β 1, 0.7 or 1.6). It takes an offer within its limit that is final, agreed, at or under its current bid, or in the last round. Once one merchant's offer is acceptable, it asks each other merchant once to beat that effective price, then walks away. It ranks acceptable deals by value (cheapest effective price over this one's), trust (from the merchant's passport: 0.5 × on_time + 0.3 × fit + 0.2 × (1 − return_rate)) and timing (arrives by need_by).

13. Security considerations

14. Conformance checklist

A minimal merchant agent:

A merchant SHOULD also send only public reason codes to untrusted buyers (section 5.10) and give them a shallower curve and no holds (section 8.5).

The SDK ships these checks as a conformance kit you can run against any live merchant agent:

npx --package=https://protocol.frida.chat/sdk/frida-protocol-1.0.1.tgz frida-protocol verify https://merchant.example/agent --query "commuter shell" --size M

It prints PASS, FAIL or SKIP for each MUST and SHOULD (or JSON with --json) and exits non-zero if any MUST fails. Accepting creates an order, so it only runs against sandbox settlement or with --allow-orders.

A minimal buyer agent:

Appendix A. Reference transcript

The scenario from Frida's core principles: "Find me a waterproof commuter shell in Medium, delivered by Thursday, around $220." The person's limit is $240; it is never sent. Three merchant agents answer, each priced from its own stock. All amounts are unit prices in US dollars; this is the reference SDK's actual output.

MerchantStock signalRound 0BuyerRound 1BuyerRound 2Outcome
Northline Supply2 left, 1.5 sold a day$265, final (low_cover)withdraw: over the limitwalked away
Harbor & Pine34 left, 62 days old, 75 days of cover$238 with a 30-minute hold (high_cover, aging, season_end, low_return_buyer)counter $205$218 + free 2-day courier (perk_instead_of_cut)accepted
Common Thread22 left, 37 days of cover$249 (low_return_buyer)counter $215$234counter $204, "another merchant is effectively at $205.20"$227acceptable, ranked second

Harbor & Pine's floor is $182 (a 36% margin on a $116.48 cost). At round 1 its target for a low-return buyer is $211.16, the bid of $205 is below its soft floor of $207.20, so it holds at 205 + 6 + 0.7 × (16 − 6) = $218 and adds the $16 courier that costs it $6. The buyer's effective price is $218 − 0.8 × $16 = $205.20, inside its bid for that round, so it takes the offer, ranks it first (99.2% on time over 1,840 witnessed orders, arrives November 30 for a December 3 deadline), accepts, and withdraws from Common Thread. The result: the $275 shell for $218 with free 2-day delivery, and Harbor & Pine's public price is still $275.

A.1 The opening request and offer on the wire

The buyer's SendMessage to Harbor & Pine (headers A2A-Version: 1.0 and A2A-Extensions: https://protocol.frida.chat/ext/frida-protocol/v1):

{
  "jsonrpc": "2.0",
  "id": "msg_mx05hlu621z3t6j",
  "method": "SendMessage",
  "params": {
    "message": {
      "messageId": "msg_mx05hlu621z3t6j",
      "role": "ROLE_USER",
      "contextId": "ctx_FqdS9iMqkpijYPVn",
      "extensions": ["https://protocol.frida.chat/ext/frida-protocol/v1"],
      "parts": [{
        "mediaType": "application/vnd.frida-protocol.v1+json",
        "data": {
          "type": "request",
          "request_id": "req_YFNC_PNVTx9w54kT",
          "items": [{ "query": "waterproof commuter shell", "attributes": { "size": "M" }, "quantity": 1 }],
          "need_by": "2026-12-03",
          "max_rounds": 4,
          "buyer": { "id": "byr_dDldE4tB9y1ZkCg0HyvCYw", "passport": "eyJhbGciOiJFUzI1NiIs…" }
        }
      }]
    }
  }
}

The merchant's response:

{
  "jsonrpc": "2.0",
  "id": "msg_mx05hlu621z3t6j",
  "result": {
    "task": {
      "id": "neg_zfTwK6zDYhwkpff0",
      "contextId": "ctx_FqdS9iMqkpijYPVn",
      "status": {
        "state": "TASK_STATE_INPUT_REQUIRED",
        "timestamp": "2026-11-28T17:00:00.000Z",
        "message": {
          "messageId": "msg_mx05hlu85e8af3u",
          "role": "ROLE_AGENT",
          "contextId": "ctx_FqdS9iMqkpijYPVn",
          "taskId": "neg_zfTwK6zDYhwkpff0",
          "extensions": ["https://protocol.frida.chat/ext/frida-protocol/v1"],
          "parts": [
            { "text": "Opening offer: Waterproof Commuter Shell at $238 (list $275)." },
            { "mediaType": "application/vnd.frida-protocol.v1+json", "data": { "type": "offer", "offer_id": "off_xkQmVFftgg7Y4Lwy", "negotiation_id": "neg_zfTwK6zDYhwkpff0", "round": 0, "…": "the offer of section 5.3" } }
          ]
        }
      },
      "metadata": { "https://protocol.frida.chat/ext/frida-protocol/v1": { "type": "offer" } }
    }
  }
}

The buyer's next SendMessage sets message.taskId to neg_zfTwK6zDYhwkpff0 and carries {"type": "counter", "negotiation_id": "neg_zfTwK6zDYhwkpff0", "in_reply_to": <that offer, unchanged>, "price": {"amount": 20500, "currency": "USD"}}.