Skip to main content

merona-guard

Check an x402 seller before your agent pays it. One call, in your buy loop: check → decide → pay. Backed by merona, the independent x402 settlement index. Free, no key, no signup.

pip install merona-guard

Zero runtime dependencies (stdlib only). The framework adapters below pull in LangChain / CrewAI only if you use them.

The buy loop

from merona_guard import Guard

guard = Guard()                                  # free, no key

r = guard.check(seller_wallet, chain="base")
if r.allow:
    pay(seller_wallet, amount)                    # merona: PASS
elif r.review:
    log(r.explain()); maybe_ask_a_human()         # merona: UNCERTAIN
else:
    skip(r.explain())                             # merona: FAIL

Prefer it to raise? Gate the payment directly:

from merona_guard import Guard, MeronaBlocked

guard = Guard()
try:
    guard.require(seller_wallet)                   # raises unless ALLOW
    pay(seller_wallet, amount)
except MeronaBlocked as e:
    skip(str(e))                                   # e.g. "merona: DENY — a paid
                                                    # probe recorded a settled
                                                    # payment with no content…"

The one decision that's yours: UNCERTAIN

merona answers PASS, FAIL, or UNCERTAIN — and it returns UNCERTAIN honestly when it has no evidence, rather than inventing a score. What your agent does with UNCERTAIN is a risk call only you can make:

from merona_guard import Guard, Policy, DENY, ALLOW

# fail-closed: only ever pay sellers merona has verified
Guard(policy=Policy(on_uncertain=DENY))

# fail-open: pay unless merona actively says FAIL
Guard(policy=Policy(on_uncertain=ALLOW))

# default: REVIEW — hand it back to you / the agent to decide
Guard()

If merona itself is unreachable, the result is an UNCERTAIN flagged available=False; by default it follows your UNCERTAIN stance, and never silently flips to ALLOW. A provider hiccup will not crash your buy loop and will not quietly wave a payment through:

Guard(policy=Policy(on_uncertain=ALLOW, on_unavailable=DENY))
# fail-open on real UNCERTAIN, but fail-closed if merona is down

LangChain

from merona_guard import as_langchain_tool
tool = as_langchain_tool()          # a StructuredTool your agent can call
agent = create_react_agent(llm, [tool, ...])

CrewAI

from merona_guard import as_crewai_tool
agent = Agent(role="buyer", tools=[as_crewai_tool()], ...)

Both adapters wrap the same Guard, so they share your policy and cache. The tool returns merona's recorded-fact reason, so a model reasoning over it reads "a paid probe recorded a settled payment with no content returned" — never a slur about the seller.

MCP

merona already runs an MCP server, so an MCP-native agent doesn't need this package at all — point your MCP client at merona's endpoint and call the trust_score / payto_check tools directly:

https://api.merona.io/mcp        # streamable-HTTP MCP; four tools, all free

Use merona-guard when you want the check wrapped in a policy and cache inside a Python buy loop; use the MCP tools when the agent orchestrates its own calls.

What it does and doesn't do

  • Caches each verdict for its TTL (merona issues ~6h), so a tight loop hitting the same seller doesn't re-call. Unreachable results are never cached — they're retried.
  • Never fabricates a verdict and never raises into your buy loop on a network error (that becomes an UNCERTAIN your policy decides on).
  • Phones nothing home beyond the /v1/trust/evaluate call you ask for. No key, no account, no telemetry.
  • merona is an independent index — it runs no payment rails and holds no seller relationships. Its verdicts are signed and recomputable from public on-chain data.

Contact / issues: hello@merona.io · https://merona.io

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

merona_guard-0.1.0.tar.gz (8.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

merona_guard-0.1.0-py3-none-any.whl (9.4 kB view details)

Uploaded Python 3

File details

Details for the file merona_guard-0.1.0.tar.gz.

File metadata

  • Download URL: merona_guard-0.1.0.tar.gz
  • Upload date:
  • Size: 8.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.12.3

File hashes

Hashes for merona_guard-0.1.0.tar.gz
Algorithm Hash digest
SHA256 55880a04f089188be27621505d07a3b6e1e5a1d05006dba7b98cf4a51b8da134
MD5 c3a739f68ed285c57b69ea4ce0d5a91f
BLAKE2b-256 0363b74536b4823bd3a78efdf37f463961c08dccfb915c352ddc4c2ddc488c05

See more details on using hashes here.

File details

Details for the file merona_guard-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: merona_guard-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 9.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.12.3

File hashes

Hashes for merona_guard-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 8ebcad1170f4fdb265ba4f61190b8fc30cc970e32268f5d094d76345b79c6346
MD5 fe95f43d4bb8f4367386702f3538e915
BLAKE2b-256 67fac47db7c363dcbe6488faef24a40349de85c592106bd1380b6cadb1d5f913

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 files

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