Skip to main content

What is a Policy?

The workflow does whatever you tell it to. Policies decide whether it should run at all. They run first, before any action fires. If any policy fails, the whole run is blocked and you get a receipt explaining why. A policy is a plain Python function — no LLMs, no magic. It reads the context and returns pass or fail with a reason.

Writing a Policy

Here’s a concrete example. The standard engineering rule: no one pushes directly to main. Agents break this constantly because no one told them not to. The Amazon Kiro incident was exactly this pattern — a direct infrastructure change with no review step caused a 13-hour AWS outage.
How the check works:

Registering Policies

Pass them to EnactClient. Multiple policies = all must pass:

Built-in Policies

Enact ships 30 built-in policies across 9 categories:

Import Paths

Naming Convention

Name booleans after what you want to be true — not what you’re guarding against: