@moneolabs/guard

The part that says no,
before anything is signed.

An agent's mistakes are cheap right up until it can move money. The guard is the boundary: it evaluates every intent against policy you declared, returns a verdict with a reason, and writes both to a ledger you can hand to a finance team.

import { createGuard } from "@moneolabs/guard";
 
const guard = createGuard({
perTransaction: { max: "$250" },
rolling24h: { max: "$2,000" },
velocity: { max: 20, per: "1m" },
counterparties: "allowlist-only",
allow: ["x402:*", "0x9f3c…a71b", "stripe:acct_1Nz"],
deny: ["mixer:*"],
escalate: { above: "$500" },
});
 
// Hand it to a wallet and it runs before every signature.
const wallet = await createWallet({ agent, signer, rail, guard });
Policies are versioned. Every verdict records which version produced it.
Primitives

Six primitives, composed however your risk team wants.

Caps

A ceiling per transaction, per counterparty, per asset class. The smallest useful policy is one line and stops the worst outcome.

Budgets

Rolling windows rather than calendar months: an hour, a day, a week. A stuck retry loop burns the budget, then stops, instead of the balance.

Allowlists

Counterparties by address, domain, x402 endpoint, or merchant ID. Deny by default is the sane setting when the caller is a language model.

Velocity

Rate limits on money, not requests. Ten payments a minute to the same address is a bug signature, whatever the amounts look like.

Escalation

Above a threshold, the action pauses and a human approves it in Slack, email, or your own webhook. The agent gets a pending handle, not a failure.

Simulation

Replay a proposed policy against last month's ledger before shipping it. See what would have been blocked, and what it would have cost you.

Ledger

Every attempt, verdict included.

Blocked attempts are kept, not discarded. They are the record of what your agents tried to do, the most useful thing you own when tuning a policy.

Decision ledger

research-01pay · x402 market data$0.04Allowunder micro-payment floor
research-01pay · x402 market data$0.04Allow142 calls today · $5.68 of $50 cap
ops-03trade · USDG → $TSLAx$1,500.00Allowtwap 30m · slippage 0.11% · venue verified
ops-03transfer · 0x9f3c…a71b$8,200.00Blockexceeds $2,000 rolling 24h budget · nothing signed
growth-02subscribe · vendor invoice$99.00Holdnew counterparty · awaiting human approval
ops-03trade · USDG → $AAPLx$240.00Blockcounterparty not on allowlist · unverified contract

Guarded execution, all the way to the fill.

The Trading SDK routes every order through this same policy engine.

Trading SDK