DEV Community

Cover image for Enforcement you can recompute (instead of taking on faith)
Lars
Lars

Posted on

Enforcement you can recompute (instead of taking on faith)

Two things happened this summer. Coinbase pushed $100M through x402 and agents started paying USDC on AWS with no human in the approval loop. And Zscaler and Unit 42 documented the other side of that coin: agents talked into sending crypto to attacker wallets, or slipping a gift card into a cart, by a hidden sentence on a web page. No exploit, no stolen key — the agent just did what it read.
So: real money, real rails, and an attacker's cheapest move is a well-placed string. What stops an agent from spending outside its mandate?
The common answer right now is a provider who checks, and asks you to trust that they checked. Here's the other one.
moltrust-enforce evaluates one transaction against a signed mandate, before the agent acts. Runs in your runtime, no proxy.

from moltrust_enforce import EnforceClient

client = EnforceClient(base_url="https://api.moltrust.ch", api_key="mt_...")

# check(): ask the server
result = client.check(mandate, transaction)
print(result.verdict)          # PERMIT | DENY | PENDING

# verify(): recompute the same verdict locally, from the inputs alone
audit = client.verify(result, mandate, transaction)
print(audit.ok)                # False if the answer doesn't follow from the inputs
Enter fullscreen mode Exit fullscreen mode

The verdict is a pure function of the mandate and the transaction. No server state, no clock, no DB. Which is what makes verify() more than a formality: a server that hands back a wrong verdict with a digest that's consistent with itself but not with the inputs sails through check() and gets caught by verify(). check() saves you the computation. verify() means you never had to trust us for it.
Fail-closed all the way down. Unreachable server, error status, unreadable body — DENY. Nothing turns a failed check into a yes.

pip install moltrust-enforce
Enter fullscreen mode Exit fullscreen mode

Free key one signup away, same auth as the rest of the API. Full quickstart on the developers page.
A mandate an agent can't exceed isn't new — several projects ship a version, which is healthy. The claim worth making is the recompute: enforcement you can check without trusting the enforcer. A provider can't give you that and remain the thing you trust.

Top comments (0)