Skip to main content

What you will learn

  • How the PolicyEngine evaluates TxIntents against configurable rules
  • Available policy fields and their effects
  • How to configure policies for different risk profiles
  • How risk scoring interacts with policy decisions

Overview

The PolicyEngine is the gatekeeper of Domain B. Every TxIntent must pass policy evaluation before it can be built, simulated, or signed. The engine evaluates a fixed set of rules in order and produces one of three decisions:

Evaluation order

Rules are evaluated in this order. The first deny stops evaluation:

PolicyConfig Fields

The default policy has maxValueWei: "0", which denies ALL value-bearing transactions. This is fail-closed by design — you must explicitly configure limits.

Allowlist behavior

Empty allowlists ([]) are permissive — they allow all values:
This applies to contractAllowlist, tokenAllowlist, and recipientAllowlist.

Value extraction per action type

The policy engine extracts different fields depending on the action type:

Example policies

Small value limit, specific tokens only, Base chain only, low rate limit:

Risk scoring

The PreflightService computes a 7-factor risk score (0-100): When the computed risk score exceeds maxRiskScore, the policy decision escalates to require_approval.

Next steps