> ## Documentation Index
> Fetch the complete documentation index at: https://docs.befailproof.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Policies

> Observe, guide, or block agent actions before a known failure repeats.

A policy evaluates an agent hook event and returns one of three decisions:

* `allow` lets the action continue.
* `instruct` gives the agent corrective guidance.
* `deny` blocks the action with a reason.

## Use the three policy surfaces

<Tabs>
  <Tab title="Dashboard">
    1. Go to **Observe → policy** to filter and inspect policy decisions from sessions.
    2. Go to **Admin → policy editor** to compose, validate, publish, disable, or inspect immutable versions.
    3. Go to **Admin → enforcement** to assign versions and effects to machines.

    Use the Policy page to understand what is already matching before authoring or changing enforcement.

    <img src="https://mintcdn.com/exosphere/WgPwQzedeDNwJBTy/images/dashboard/policy-observe.png?fit=max&auto=format&n=WgPwQzedeDNwJBTy&q=85&s=13535ad27c8bddac6589f9d1560916cb" alt="The Policy page showing decision totals and local and Cloud-managed policy mappings." width="2372" height="1548" data-path="images/dashboard/policy-observe.png" />

    The editor is where you turn a failure condition into source, validate it, and publish an immutable version.

    <img src="https://mintcdn.com/exosphere/WgPwQzedeDNwJBTy/images/dashboard/policy-editor.png?fit=max&auto=format&n=WgPwQzedeDNwJBTy&q=85&s=7c01c862f4ec601d0535a6969eb619ce" alt="The Policy editor used to compose and publish an immutable policy version." width="2938" height="1608" data-path="images/dashboard/policy-editor.png" />

    Enforcement then assigns that published version and its observe or enforce effect to machines.

    <img src="https://mintcdn.com/exosphere/WgPwQzedeDNwJBTy/images/dashboard/enforcement-fleet.png?fit=max&auto=format&n=WgPwQzedeDNwJBTy&q=85&s=96be13256ef7e3fa89eeefcc4f1b7f10" alt="The Enforcement fleet showing machine coverage and assigned policy versions." width="2938" height="1600" data-path="images/dashboard/enforcement-fleet.png" />

    Verify decisions back on the Policy page after deployment so the authoring and fleet views are tied to real agent activity.
  </Tab>

  <Tab title="CLI">
    Use `failproofai` for local policy installation and validation:

    ```bash theme={null}
    failproofai policies
    failproofai policy add block-rm-rf --scope project
    failproofai config --status
    ```

    Use `fp` to find the Cloud sessions and events containing policy decisions. Cloud authoring and fleet deployment remain dashboard workflows.
  </Tab>
</Tabs>

Policies have three distinct surfaces in Failproof AI:

1. **Analyze decisions** in sessions, dashboards, and audits.
2. **Author versions** with builtin rules, code, or the policy editor.
3. **Deploy and enforce** versions across selected machines.

Start from a confirmed failure mode. Define the smallest event and tool match that identifies it, test legitimate and unsafe examples, then observe before enforcing.

<Columns cols={2}>
  <Card title="Use a builtin policy" icon="library" href="/policies/builtin">
    Enable a reviewed rule for common secret, shell, Git, cloud, and workflow risks.
  </Card>

  <Card title="Write a custom policy" icon="code-2" href="/policies/custom">
    Express a workflow-specific decision in JavaScript or TypeScript.
  </Card>
</Columns>
