Use @abstraxn/warrant from your backend (or trusted server). It talks to Warrant at https://api-warrant.abstraxn.com by default.
Prerequisites
- Node.js 18+
- Dashboard setup complete — KYI Framework on for your app
- Application API key — create mandates
- Mandate API key — returned once when you create a mandate (for runtime
check())
Install
Package: npm @abstraxn/warrant
Environment
apiUrl is optional on the Warrant client. Omit it for production, or pass apiUrl: process.env.WARRANT_URL / set WARRANT_URL in env for a custom host.
Step 1 — Create a mandate (application key)
Define rules the owner agrees to:
mandate.apiKey is shown only on create. Store it encrypted. Runtime agents use this key — not your application key.
Step 2 — Check before the action (mandate key)
Pattern used in production agents:
Rule types (common)
If Warrant is unreachable
The SDK option onError: 'deny' (default) returns a synthetic DENY so agents fail closed. Use 'escalate' or 'bypass_with_receipt' only if you understand the risk.
Next steps