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


Build with frida-protocol/1

frida-protocol/1 is an A2A extension: a merchant agent declares it in its Agent Card, and a buyer agent sends trade messages as data parts. The reference SDK, frida-protocol, implements both sides with no dependencies, on Web Crypto, so it runs on Node 20+, Deno, Bun and Cloudflare Workers. The specification has the details.

The demo network is live: seven fictional merchant agents at /demo/directory.json. Point any buyer agent at them. Their stock and prices are made up, and nothing is ever charged.

Try it in ChatGPT or Claude

The demo is also an MCP server, with no account needed. Your assistant gets tools to negotiate, accept a deal, leave standing orders, and play the merchant. Server URL: https://protocol.frida.chat/demo/mcp

ChatGPT

  1. Open chatgpt.com/plugins, press +, then Add custom MCP server. (Custom servers may need developer mode, under Settings, Apps, Advanced.)
  2. Name it Frida demo, paste https://protocol.frida.chat/demo/mcp, and choose No authentication.
  3. In a new chat, pick Frida demo and ask: “Find me a waterproof commuter shell in Medium by Thursday, around $220, no more than $240.”

Claude

  1. Open Settings, then Connectors, and choose Add custom connector.
  2. Name it Frida demo and paste https://protocol.frida.chat/demo/mcp. There is no sign-in step.
  3. Ask Claude: “Use the Frida demo to get me dinner for two tonight, under $120.”

Then try: “Show me Harbor & Pine’s side”, “Leave a standing order for the navy overcoat at $230”, “Sweep the book as Harbor & Pine”, “Accept the deal”. Every negotiation comes back with a replay link.

Install the SDK

npm install https://protocol.frida.chat/sdk/frida-protocol-1.0.1.tgz

Or copy packages/frida-protocol from the repository. frida-protocol is the protocol; frida-protocol/node adds a small listen() for Node’s HTTP server.

Run a merchant agent

A merchant agent is a fetch handler. It serves its Agent Card, its signing keys and the A2A JSON-RPC endpoint, and keeps no negotiation state, so it runs on any serverless platform.

import { createMerchantAgent, generateSigningKey, inventoryPolicy } from 'frida-protocol';
import { listen } from 'frida-protocol/node';

const agent = createMerchantAgent({
  url: 'http://127.0.0.1:8787/agent',          // your public base URL in production
  name: 'Harbor & Pine',
  key: await generateSigningKey(),               // persist key.privateJwk to keep it
  catalog: [{
    sku: 'SHELL-NVY-M', title: 'Waterproof Commuter Shell',
    tags: ['waterproof', 'commuter', 'shell'], attributes: { size: 'M' },
    list_price: 27500, cost: 11648,              // cents
    on_hand: 34, velocity_per_day: 0.45, age_days: 62,
  }],
  policy: inventoryPolicy({
    marginFloor: 0.36,
    perks: [{ code: 'free_express', label: 'free 2-day courier', value: 1600, cost: 600 }],
  }),
  shipping: {
    standard: { code: 'std', label: 'Standard', method: 'ship', price: 0, cost: 800, days: 5 },
    express: { code: 'exp', label: '2-day courier', method: 'courier', price: 1600, cost: 600, days: 2 },
  },
});

await listen(agent.fetch, { port: 8787 });
// Agent Card: http://127.0.0.1:8787/agent/.well-known/agent-card.json

Mount agent.fetch in Hono, a Next.js route handler, Bun, Deno or a Worker instead of listen() if you prefer. The built-in inventoryPolicy reads days of cover, aging, perishability, margin floor, warehouse and cash pressure, and the buyer’s witnessed return rate (figure 3 on the home page).

Run a buyer agent

negotiate() discovers each merchant’s card and keys, sends one request without the limit, haggles in lockstep, uses the best acceptable offer as leverage against the rest, and ranks what’s left.

import { negotiate } from 'frida-protocol';

const result = await negotiate({
  merchants: [
    'https://protocol.frida.chat/demo/merchants/harbor-and-pine',
    'https://protocol.frida.chat/demo/merchants/northline',
    'https://protocol.frida.chat/demo/merchants/common-thread',
  ],
  item: { query: 'waterproof commuter shell', attributes: { size: 'M' }, quantity: 1 },
  need_by: '2026-12-03',
  limit: { amount: 24000, currency: 'USD' },   // private: never sent
  target: { amount: 22000, currency: 'USD' },  // private: shapes the opening bid
});

console.log(result.best?.merchant.name, result.best?.total, result.best?.reasons);
// const order = await result.accept();        // signed order; withdraws from the rest

To drive each step yourself, connect(url) returns a conversation whose send() verifies every reply’s signature. Build messages with counterTo(offer, cents) and acceptOf(offer).

Write a pricing policy

import { createMerchantAgent, type PricingPolicy } from 'frida-protocol';

// A policy is a function: this SKU, this buyer, now → a private quote.
const policy: PricingPolicy = ({ sku, buyer }) => ({
  open: sku.list_price,                         // opening unit price
  floor: Math.ceil((sku.cost ?? 0) / 0.6),      // never below a 40% margin
  soft: Math.round(sku.list_price * 0.85),      // below this, offer perks instead
  beta: sku.on_hand > 20 ? 1.5 : 0.6,           // concede early when overstocked
  buyer_adjustment: buyer.passport_verified ? 500 : 0,
  perks: [], reasons: [], hold_minutes: 0,
});

Everything a policy returns is private. Only the resulting offers travel, with machine-readable reasons such as aging or low_cover.

Check a merchant agent

The SDK includes a conformance kit. It runs every MUST and SHOULD you can observe from outside against any live merchant agent, yours or someone else’s, and exits non-zero if a MUST fails:

npx --package=https://protocol.frida.chat/sdk/frida-protocol-1.0.1.tgz frida-protocol verify https://protocol.frida.chat/demo/merchants/harbor-and-pine --query "commuter shell" --size M

It checks the card and keys, extension activation and error codes, that budget fields and markup are refused, offer signatures, totals and expiry, that edited echoes are refused, that prices never rise, and, with sandbox settlement or --allow-orders, that accepting twice returns one order. Add --json for a machine-readable report.

Trust tiers

A stateless merchant can’t tell one buyer’s fifth negotiation from five new buyers. So depth is reserved for accountable counterparties: a buyer whose witness passport verifies and shows a witnessed record. Trusted buyers get the real curve, detailed reason codes (aging, cash_conversion…) and holds. Everyone else gets public codes (promotional, limited_stock…), no holds, and a floor raised part of the way to the opening price with a secret jitter, so fresh ids can’t binary-search it. In the demo, untick “show my witnessed passport” to see the difference.

Talk to the demo with curl

curl https://protocol.frida.chat/demo/merchants/harbor-and-pine/.well-known/agent-card.json
curl https://protocol.frida.chat/demo/merchants/harbor-and-pine/a2a \
  -H 'Content-Type: application/json' \
  -H 'A2A-Version: 1.0' \
  -H 'A2A-Extensions: https://protocol.frida.chat/ext/frida-protocol/v1' \
  -d '{"jsonrpc":"2.0","id":1,"method":"SendMessage","params":{"message":{
        "messageId":"m1","role":"ROLE_USER","extensions":["https://protocol.frida.chat/ext/frida-protocol/v1"],
        "parts":[{"mediaType":"application/vnd.frida-protocol.v1+json","data":{
          "type":"request","request_id":"req_1",
          "items":[{"query":"waterproof commuter shell","attributes":{"size":"M"},"quantity":1}],
          "need_by":"2026-12-03","buyer":{"id":"byr_try_it"}}}]}}}'

The reply is an A2A task in TASK_STATE_INPUT_REQUIRED whose status message carries a signed offer. To counter, send {"type":"counter","negotiation_id":…,"in_reply_to":<the offer, unchanged>,"price":{"amount":20500,"currency":"USD"}} with the same taskId.

With UCP, ACP, AP2 and the Personal Agent Protocol

ProtocolWhat it doesHow frida-protocol/1 uses it
A2AAgent-to-agent transportThe carrier: Agent Card extension, SendMessage, one task per negotiation
UCPCatalog and checkoutAn order can hand off to a UCP checkout session priced at the deal; merchants can also declare com.frida.protocol.negotiation extending dev.ucp.shopping.checkout
ACPCheckout inside ChatGPT, Stripe payment tokensAn order can hand off to an ACP checkout session; the delegated payment’s max_amount covers the agreed total
AP2What an agent may payMandates ride on accept; a witness turns one into a funds attestation without revealing the amount; open mandates are the book’s standing orders
Personal Agent ProtocolWho the person is at each companyThe same idea of pairwise ids; a company’s poppy.json can point at its merchant agent; content from the other side is data, never instructions
MCPTools for assistantsHow people reach their buyer agent from ChatGPT or Claude, as in this demo

Endpoints

URLWhat
/protocolThe specification
/ext/frida-protocol/v1The extension URI: a JSON description
/ext/frida-protocol/v1/schema.jsonJSON Schema for every message
/demo/directory.jsonDemo merchant agents and their cards
/demo/merchants/{slug}/.well-known/agent-card.jsonA demo merchant’s Agent Card (signed)
/demo/merchants/{slug}/.well-known/jwks.jsonIts offer-signing keys
/demo/merchants/{slug}/a2aIts A2A JSON-RPC endpoint
/demo/mcpThe demo as an MCP server (no sign-in)
/.well-known/jwks.jsonThe witness’s keys (passports, funds attestations, mandates)