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

# Policy

> Versioned rules that decide the outcome for each action type.

A **policy** is a versioned set of rules that AtlaSent evaluates every action against. Each policy targets one action type, and its `rules` object says under which conditions that action may proceed.

```yaml theme={null}
action_type: production.deploy
description: Two approvals, business hours only.
rules:
  change_window:
    timezone: America/Los_Angeles
    days_of_week: [1, 2, 3, 4]
    hours: { start: "09:00", end: "17:00" }
  require_approvals:
    count: 2
    exclude_actor: true
  templates:
    - decision: allow
```

`rules` is the same rule object the runtime evaluates. Templates are checked in order and the first match decides; each template's `decision` is one of the four decision values (`allow`, `deny`, `hold`, `escalate`). See the [Glossary](/concepts/glossary).

## Fail-closed by default

If no policy is published for the action and `fail_mode` is `closed` (the default), evaluation returns `deny` with `NO_RULES`. If templates are present but none matches, evaluation returns `deny` with `NO_TEMPLATE_MATCH`. A missing or non-matching policy is never an implicit allow. See [Deny codes](/concepts/deny-codes).

## Versioning

Policies are immutable once activated. A change produces a new version; the old version remains queryable for audit. This is how AtlaSent gives you a point-in-time answer to "what policy was in effect when this agent took this action in Q2 last year?"

## Import paths

* **Policy as code:** keep policies as files in a repo and validate, test, plan, and apply them with the [`atlasent-policy` CLI](/sdks/cli).
* **Starter:** `gxp-starter` policies for 21 CFR Part 11, EU Annex 11, and ICH E6 GCP are not yet publicly available.

## Authoring a policy

See the [`atlasent-policy` CLI](/sdks/cli) for the file format, offline tests, and how to preview changes with `plan` before you `apply` them.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.