Policy Engine & Reference
Interactive Policy Engine and PolicyConfig specification for Opacus.
PolicyConfig Specification
Pass a policy configuration object into withOpacusGuard() to enforce financial transaction boundaries:
| Property | Type | Description |
|---|---|---|
maxRefundPerTxUsdc |
number | Hard limit per refund transaction. Executions exceeding this are BLOCKED. |
maxDailyVelocityUsdc |
number | Cumulative 24-hour spending limit across all agent actions. |
humanApprovalThresholdUsdc |
number | Transactions exceeding this amount trigger a human-in-the-loop review webhook. |
withOpacusGuard() API
import { withOpacusGuard } from "@opacus/guard"
const guardedAgent = withOpacusGuard(agentInstance, {
maxRefundPerTxUsdc: 500,
maxDailyVelocityUsdc: 2000,
humanApprovalThresholdUsdc: 1000
});