lion-x402-guard
v1.0.0
Published
Drop-in safety middleware for autonomous agents on Base: wraps any token decision with LION's attested SafetyStack (honeypot + liquidity + risk + OFAC), fail-closed, keyless x402.
Maintainers
Readme
lion-x402-guard 🦁🛡️
One import to make any Base agent fail-closed on unsafe tokens. Wraps every token decision with LION's attested SafetyStack (honeypot + liquidity + risk + OFAC) in one keyless $0.012 x402 call.
import { lionGuard } from "lion-x402-guard";
const guard = lionGuard({ privateKey: process.env.PRIVATE_KEY! });
if (await guard.isSafe("0xToken")) await buy("0xToken"); // gate (fail-closed)
const safeBuy = guard.wrap((t: string) => buy(t)); // or wrap your action
await safeBuy("0xToken"); // throws GuardBlocked if unsafe- Fail-closed: any error, any BLOCK verdict, or no valid token →
go:false/ throws. Never silently proceeds. - Attested: each decision carries an Ed25519 signature you can verify offline.
- Cheap: up to 5 tokens per $0.012 call; keyless USDC on Base, no API keys.
- Pluggable logging: pass
{ log }to fan decisions to a file / Slack / pager.
Install: npm i lion-x402-guard x402-fetch viem · Discover LION: https://lionx402.com/api/mcp
