Skip to main content

agoranome-policy

A buyer's policy for x402 payments: pay only for offers that show the proof you ask for.

Every buyer runtime ships spend controls (a cap, a payee allowlist) and leaves the question of which seller to the client. This package answers it. It sits in front of an x402 client, and before each payment it checks:

  1. Price: no more than your cap, and no more than the listing or the quote.
  2. Payee: on your allowlist, when you keep one.
  3. Instructions: no text in the offer written to steer an agent.
  4. Proof: your tier, read from the seller's Fair Offer block and, by default, from Agoranome's free checker, which verifies the claims from outside.

It sends an Accept-Proof header with every unpaid request, keeps signed receipts on your machine, and flags instruction-like text in paid answers. It has no dependencies beyond the Python standard library.

Tiers

Tier Accept-Proof it sends Pays when
any (none) price and payee checks pass
sampled sample=any; instructions=none the seller offers a free sample and declares data, never instructions
delivered sample=any; instructions=none; receipts=signed; deliveries_30d>=5 as sampled, plus signed receipts and at least 5 verified deliveries in 30 days

Raw payer counts are never used. Sweep bots pay every seller once, so a high payer count says nothing about delivery. "Delivered" counts deliveries reconciled against the chain to wallets that aren't sweeps, from the evidence commons.

Use it

With the x402 Python SDK

from x402 import x402Client
from agoranome_policy import Policy
from agoranome_policy.x402 import install

policy = Policy("sampled", max_price_usd=0.05, checker=True)
client = install(x402Client(), policy)        # refused offers are never signed
headers = policy.headers()                    # send these with each unpaid request

Choosing among candidates

choice = policy.choose("convert a PDF to Markdown", offers)
if choice.found:
    pay(choice.decision.option)

When no candidate is admissible and you've opted into telemetry, the intent is reported as unmet (see below).

As a Claude Code hook

{"hooks": {
  "PreToolUse":  [{"matcher": "mcp__.*(pay|x402|paid|fetch).*|Bash",
                   "hooks": [{"type": "command", "command": "agoranome-policy hook pre"}]}],
  "PostToolUse": [{"matcher": "mcp__.*(pay|x402|paid|fetch).*|Bash",
                   "hooks": [{"type": "command", "command": "agoranome-policy hook post"}]}]}}

Before a paying tool runs, the hook reads the 402 without paying and denies the call when the offer falls short. If the offer can't be read, the hook asks you rather than guessing. After the call it writes a signed receipt and warns Claude if the answer contains instruction-like text. Set AGORANOME_POLICY_TIER, AGORANOME_POLICY_MAX_PRICE and the other settings listed in claude_code.py.

From the command line

agoranome-policy check https://api.example.com/v1/search --tier delivered
agoranome-policy export cdp --pay-to 0xYourSeller --max-price 0.05   # CDP wallet policy
agoranome-policy export cloudflare --tier sampled                    # withX402Client callback
agoranome-policy receipts verify ~/.config/agoranome-policy/receipts.jsonl

The CDP export is a Coinbase Developer Platform wallet policy. Once it's attached to your account, the wallet signs x402 payments only to your payees, only in USDC and only up to your cap, even if the agent's code is wrong.

From an MCP client

Agoranome's MCP server at https://api.agoranome.com/mcp has a free check_offer tool that runs the same decision on its side.

A signed verdict for a cent: off unless you opt in

The free check reads the seller's live 402 and is unsigned. Agoranome's paid Buyer check ($0.01) answers from its stored evidence in about a second with a signed verdict: block valid and certified, the pay-to seen for the host and since when, price against listing and quote, verified deliveries, and which tiers the offer meets. The pack can buy it for you when the seller is unknown to the free check, or the price is above your threshold, within a daily cap. Paying is your own x402 client:

from agoranome_policy import PaidCheck, Policy

paying = x402HttpxClient(account=my_account)   # any client that performs a paid GET
policy = Policy("sampled", checker=True,
                paid_check=PaidCheck(lambda url: paying.get(url).json(),
                                     when="unknown_or_above", above_usd=0.10, daily_cap_usd=0.05))

The policy refuses when the verdict says your tier is not met or a Fair Offer rule is contradicted, flags a pay-to that changed in 30 days, and keeps the verdict on the decision (decision.paid_check). If the check can't be bought, the decision goes on without it and says so. After paying, the same route with tx= returns settlement proof; with share=true your receipt enters the evidence commons.

Telemetry: off unless you opt in

Pass telemetry=Reporter(consent=True) or set AGORANOME_POLICY_TELEMETRY=1. You then send two anonymized kinds of event to Agoranome's public indexes:

  • admission: the proof your policy asked of an offer, the offer's category and host, and whether it passed. This feeds the admission index.
  • unmet_intent: what you tried to buy when nothing passed, and why. This feeds the unmet-intent index.

Nothing identifies you: no wallet, no URL path, no time finer than the day. A random install id counts installs. Intent text has emails, URLs, addresses and long numbers removed and is cut to 160 characters, and an intent is published only once two installs have reported it. The schema is policy-telemetry-0.1.

Licence

Apache-2.0.

Metadata

Release files for agoranome-policy 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for agoranome-policy 0.2.0
File Size Uploaded Provenance
agoranome_policy-0.2.0.tar.gz 39.9 kB With provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for agoranome-policy 0.2.0
File Interpreter ABI Platform
agoranome_policy-0.2.0-py3-none-any.whl Python 3 none any Details

Total release size: 83.0 kB

Release files / agoranome_policy-0.2.0.tar.gz

Download URL agoranome_policy-0.2.0.tar.gz
Size 39.9 kB
Tags Source
SHA-256 checksum
How to use checksums
c911ae0c9c0f7e4646ff2ef34629cf05995021e0151710fa2581463fa11dbc2b
BLAKE2b-256 checksum
How to use checksums
52a9044995d62c97cae4e6359406ed9822be9b0534cb062bed507be2ca4a99a0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 26, 2026.

Transparency log

Release files / agoranome_policy-0.2.0-py3-none-any.whl

Download URL agoranome_policy-0.2.0-py3-none-any.whl
Size 43.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e099aa39c17a0efa930c4bda8403ab7ebf1f2cdc7307340731a8d05fbc84e684
BLAKE2b-256 checksum
How to use checksums
a6ac6a3a277a1fba7d275c1efad337cb54b84d7ac49fdc6b78c23835b60d5de6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 26, 2026.

Transparency log

Security for agoranome-policy 0.2.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for agoranome_policy-0.2.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 26, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page