Policy Management Contracts

The Policy Management contracts handle on-chain policy enforcement for ACE-compatible contracts. The source code and full documentation are available in the policy-management package of the chainlink-ace repository (Business Source License 1.1).

Core interfaces

Interface
Description
IPolicyEngineCentral orchestrator that manages policies, extractors, and mappers for protected contracts. Receives calls from PolicyProtected targets, runs the policy chain, and returns allow/reject decisions.
IPolicyProtectedBase interface for any contract that wants policy enforcement. Provides the runPolicy modifier, the connection to a PolicyEngine, and context handling for passing off-chain data to policies.
IPolicyStandard interface for all policy contracts. Each policy implements run (read-only evaluation that returns allow/continue/reject) and optionally postRun (state changes after execution, such as updating volume counters).
IExtractorParses transaction calldata into named parameters (e.g., to and value from an ERC-20 transfer) so policies can evaluate them. One extractor is registered per function signature.
IMapperOptional interface for transforming or combining extracted parameters before they reach a policy. Only needed for advanced scenarios where a policy expects a different parameter shape than the extractor provides.

Pre-built policies

ACE provides a library of audited, ready-to-use policy implementations covering common compliance scenarios โ€” allowlists, volume limits, role-based access, pause controls, and more. See the policies source code for implementation details, or the Policy Library page for configuration and usage.

Reference token implementations

The repository includes reference token contracts that demonstrate full ACE integration:

Repository documentation

The policy-management docs folder contains detailed guides:

  • Concepts โ€” Architecture, policy flow, extractors, mappers, and context handling
  • API Guide โ€” Task-oriented guide with code examples for common operations
  • API Reference โ€” Complete interface specifications with function signatures and events
  • Custom Policies Tutorial โ€” End-to-end walkthrough for building a custom policy contract
  • Policy Ordering Guide โ€” How evaluation order affects transaction outcomes
  • Security Considerations โ€” Trust model, gas considerations, and context handling
  • Architecture โ€” How PolicyEngine contracts fit into the ACE system
  • Policy Management โ€” Conceptual overview of policy chains and evaluation
  • Policy Library โ€” Pre-built policy implementations with configuration details

Get the latest Chainlink content straight to your inbox.