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/evaluatecall 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
Metadata
Release files for merona-guard 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| merona_guard-0.1.0.tar.gz | 8.2 kB | Without provenance | Details for merona_guard-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| merona_guard-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for merona_guard-0.1.0-py3-none-any.whl |
Total release size: 17.6 kB
Release files / merona_guard-0.1.0.tar.gz
| Download URL | merona_guard-0.1.0.tar.gz |
|---|---|
| Size | 8.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
55880a04f089188be27621505d07a3b6e1e5a1d05006dba7b98cf4a51b8da134
|
|
BLAKE2b-256 checksum How to use checksums |
0363b74536b4823bd3a78efdf37f463961c08dccfb915c352ddc4c2ddc488c05
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.3
|
Release files / merona_guard-0.1.0-py3-none-any.whl
| Download URL | merona_guard-0.1.0-py3-none-any.whl |
|---|---|
| Size | 9.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
8ebcad1170f4fdb265ba4f61190b8fc30cc970e32268f5d094d76345b79c6346
|
|
BLAKE2b-256 checksum How to use checksums |
67fac47db7c363dcbe6488faef24a40349de85c592106bd1380b6cadb1d5f913
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.3
|
Security for merona-guard 0.1.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.
No provenance found
None of the files in this release were uploaded with provenance metadata.
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.