LaCrew docs
Protocol

IPolicyModule

The heart of the protocol. Modules stack on a node; first DENY wins; any ESCALATE routes upward.

interface IPolicyModule {
    function check(
        address agent,
        address target,
        uint256 value,
        bytes calldata data
    ) external view returns (Verdict);
    // Verdict: ALLOW | ESCALATE | DENY
}

Standard modules (reference contracts):

ModuleVerdict behavior
SpendCapPolicyESCALATE over per-agent / default cap
WhitelistPolicyDENY non-whitelisted targets
RateLimitPolicyESCALATE when window count ≥ max (router calls record)
TimeWindowPolicyDENY outside daily UTC window
CustomThird-party IPolicyModule implementations

PolicyStack composes modules: first DENY wins; any ESCALATE is sticky; else ALLOW.

Per-node stacks

EscalationRouter keeps a default policy plus optional policyOf[node] overrides (setNodePolicy). Propose checks the agent's stack; resolve checks the approver's stack. DeployMockOrg wires a worker stack (whitelist + spend cap + rate limit) and a manager stack (whitelist + spend cap, no rate limit).

TODO

  • TODO: Spec module registry + upgrade path via GovernanceModule
  • TODO: Publish ABI + abitype package for off-chain preflight

On this page