# Osty policy reference

Docs. Breadcrumb: [Home](https://osty.dev/) / [Docs](https://osty.dev/docs) / Policy reference

`.osty/policy.yaml` is one strict YAML document with `apiVersion: osty.io/v1` and `kind: FleetPolicy`. Six sections are required and `releaseGates` is optional. Unknown keys, quoted booleans and a second document are rejected, and LLM code edits can never exceed `VERIFIED_PR`. Check a file with `osty policy validate` before you commit it.

Table: Top-level keys of a `FleetPolicy` document

| Key | Required | Governs |
| --- | --- | --- |
| `apiVersion`, `kind` | Yes | Must be `osty.io/v1` and `FleetPolicy`. |
| `supplyChain` | Yes | Cooldowns, blocked verdicts, licenses, proxy failure modes and private packages. |
| `cadence` | Yes | The maintenance train and which severities skip it. |
| `ciGovernor` | Yes | Concurrent campaign runs and CI budget shares. |
| `autonomy` | Yes | The default autonomy level, per-tier caps and canary gates. |
| `patchVerifier` | Yes | Agentic migrations, forbidden paths and dependency rules. |
| `killSwitch` | Yes | Freezes, rollback and dual control. |
| `releaseGates` | No | Freeze windows and ServiceNow, Jira or webhook approvals. |

Validate the policy before you commit it:

```bash
osty policy validate .osty/policy.yaml
```

## What does a complete policy look like?

This is the fleet policy the Osty test suite pins. It caps `TIER_0` at `VERIFIED_PR`, lets `TIER_1` auto-merge deterministic changes and lets `TIER_2` roll out behind a canary gate.

`.osty/policy.yaml`:

```yaml
apiVersion: osty.io/v1
kind: FleetPolicy

supplyChain:
  defaultCooldownHours: 48
  fastTrackVerifiedKEV: true
  blockVerdicts:
    - CONFIRMED_MALICIOUS
    - QUARANTINED_HIGH_RISK
  blockLicenseChanges: true
  allowedLicenses: [MIT, Apache-2.0, BSD-2-Clause, BSD-3-Clause, ISC, MPL-2.0]
  proxyFailureMode:
    prodCI: FAIL_CLOSED
    devLaptop: FAIL_OPEN_WITH_CACHE

cadence:
  maintenanceTrain:
    schedule: "every Tuesday 09:00 UTC"
    coalesceSeverities: [MEDIUM, LOW]
  fastTrackSeverities: [CRITICAL, HIGH]

ciGovernor:
  maxConcurrentCampaignRuns: 10
  routineBudgetPercent: 20
  kevBurstBudgetPercent: 60
  flakeControlRerun: true

autonomy:
  defaultTier: VERIFIED_PR
  canaryDefaults:
    soakMinutes: 30
    maxErrorRateDeltaPct: 1.0
    maxP99DeltaPct: 20
    zeroOOMKills: true
  tiers:
    TIER_0:
      maxAutonomy: VERIFIED_PR
      requireObservabilityGate: true
    TIER_1:
      maxAutonomy: AUTO_MERGE_SAFE
      allowStaleMainAutoRedeploy: false
      requireObservabilityGate: true
      canarySoakMinutes: 15
      canaryMaxErrorRateDeltaPct: 0.5
      canaryMaxP99DeltaPct: 15
      canaryZeroOOMKills: true
    TIER_2:
      maxAutonomy: CANARY_ROLLOUT
      allowStaleMainAutoRedeploy: true

patchVerifier:
  allowAgenticCodeMigrations: true
  agenticMigrationMaxAutonomy: VERIFIED_PR
  forbiddenPaths:
    - ".github/workflows/**"
    - ".circleci/**"
    - "**/Makefile"
    - "**/auth/**"
    - "**/iam/**"
  forbidUnlistedDependencies: true
  forbidNewShellOrNetworkPrimitives: true

killSwitch:
  autoFreezeProxyOnConfirmedMalicious: true
  autoRollbackStatelessWorkloads: true
  statefulMigrationAction: CONTAIN_AND_FORWARD_REBUILD
  requireDualControlForBroadRollback: true
```

Validate it:

```bash
osty policy validate .osty/policy.yaml
```

Output, exit 0:

```text
valid osty.io/v1 FleetPolicy digest=sha256:87433aefdeae2d0b8d61cfe0ed7523a82977299520fed2aaa72b1f74b1942fe7
```

The digest is the `sha256` of the file bytes. `osty-edge` records it when it pins the policy, so any edit, including whitespace, produces a new digest.

## What is the smallest safe starting policy?

Every required key still has to be present. This version opens no pull requests (`OBSERVE`), fails closed on every origin and keeps agentic migrations off. `tiers: {}` means every tier uses `defaultTier`.

Observe-only `.osty/policy.yaml`:

```yaml
apiVersion: osty.io/v1
kind: FleetPolicy

supplyChain:
  defaultCooldownHours: 24
  fastTrackVerifiedKEV: true
  blockVerdicts: [CONFIRMED_MALICIOUS, QUARANTINED_HIGH_RISK]
  blockLicenseChanges: false
  allowedLicenses: []
  proxyFailureMode:
    prodCI: FAIL_CLOSED
    devLaptop: FAIL_CLOSED

cadence:
  maintenanceTrain:
    schedule: "every Monday 08:00 UTC"
    coalesceSeverities: [MEDIUM, LOW]
  fastTrackSeverities: [CRITICAL, HIGH]

ciGovernor:
  maxConcurrentCampaignRuns: 2
  routineBudgetPercent: 10
  kevBurstBudgetPercent: 30
  flakeControlRerun: false

autonomy:
  defaultTier: OBSERVE
  tiers: {}

patchVerifier:
  allowAgenticCodeMigrations: false
  agenticMigrationMaxAutonomy: OBSERVE
  forbiddenPaths: []
  forbidUnlistedDependencies: true
  forbidNewShellOrNetworkPrimitives: true

killSwitch:
  autoFreezeProxyOnConfirmedMalicious: true
  autoRollbackStatelessWorkloads: false
  statefulMigrationAction: CONTAIN_ONLY
  requireDualControlForBroadRollback: true
```

## What do the autonomy levels allow?

Table: `AutonomyLevel` values, lowest to highest

| Level | What Osty may do | Extra requirement |
| --- | --- | --- |
| `OBSERVE` | Report findings. Opens no pull requests. | None. |
| `VERIFIED_PR` | Open verified pull requests that a person merges. | None. The ceiling for LLM-generated code edits. |
| `AUTO_MERGE_SAFE` | Merge deterministic changes on green CI: lockfiles, `@sha256` base-image pins and mechanical compiler AST codemods. | With `allowStaleMainAutoRedeploy: true`, also redeploy, which needs the observability gate and a canary gate. |
| `CANARY_ROLLOUT` | Merge and roll out behind the canary gate, rolling back on regression. | `requireObservabilityGate: true` and a canary gate from the tier or `autonomy.canaryDefaults`. |

- A tier that is not listed under `autonomy.tiers` uses `defaultTier` with the observability gate required.
- When no observability gate is wired, `CANARY_ROLLOUT` and stale-main redeploys fall back to `VERIFIED_PR` at run time. `AUTO_MERGE_SAFE` without redeploy is unaffected.
- `autonomy.canaryDefaults` is required as soon as any tier, or `defaultTier`, permits automated rollout.

## How is LLM-generated code capped at VERIFIED_PR?

`patchVerifier.agenticMigrationMaxAutonomy` accepts only `OBSERVE` or `VERIFIED_PR`. The parser rejects a higher value in the fleet policy, in an overlay and in the merged result, so a person always reviews and merges probabilistic code edits.

`agenticMigrationMaxAutonomy: AUTO_MERGE_SAFE` is rejected, exit 1:

```text
osty policy: policy has 1 validation issue(s):
  patchVerifier.agenticMigrationMaxAutonomy: AUTO_MERGE_SAFE exceeds VERIFIED_PR: probabilistic LLM-generated code edits are hard-capped at VERIFIED_PR and always require human review; only deterministic changes (lockfiles, @sha256 base-image pins, mechanical compiler AST codemods) may reach AUTO_MERGE_SAFE or CANARY_ROLLOUT
```

## Which keys does each section accept?

Booleans must be YAML `true` or `false`, enum values are case-sensitive, and list entries must be unique. A key marked required must be present even when it holds the default you want.

### supplyChain

Table: Keys under `supplyChain`

| Key | Type | Required | Rule |
| --- | --- | --- | --- |
| `defaultCooldownHours` | integer | Yes | 0 to 8760 hours a new version waits before it is pulled. |
| `fastTrackVerifiedKEV` | boolean | Yes | Lets verified fixes for known-exploited CVEs skip the cooldown. |
| `blockVerdicts` | list | Yes | `CLEAN`, `ANOMALOUS_REVIEW`, `QUARANTINED_HIGH_RISK` or `CONFIRMED_MALICIOUS`. |
| `blockLicenseChanges` | boolean | Yes | Blocks versions whose license changed. |
| `allowedLicenses` | list | Yes | SPDX identifiers. `[]` turns the allowlist off. |
| `proxyFailureMode.prodCI` | enum | Yes | `FAIL_CLOSED` or `FAIL_OPEN_WITH_CACHE` for pulls without a verdict from CI. |
| `proxyFailureMode.devLaptop` | enum | Yes | The same choice for developer laptops. |
| `privatePackageAllowlist` | list | No | Entries with `ecosystem`, `name`, `allowedDomains` and an optional `reason`. Domains must be concrete, with no wildcards or schemes. |

### cadence

Table: Keys under `cadence`

| Key | Type | Required | Rule |
| --- | --- | --- | --- |
| `maintenanceTrain.schedule` | string | Yes | `every <Weekday> <HH:MM> UTC` or a five-field cron expression. |
| `maintenanceTrain.coalesceSeverities` | list | Yes | Severities batched onto the train. |
| `fastTrackSeverities` | list | Yes | Severities that skip the train. Together with `coalesceSeverities` they must cover `CRITICAL`, `HIGH`, `MEDIUM` and `LOW` exactly once. |

### ciGovernor

Table: Keys under `ciGovernor`

| Key | Type | Required | Rule |
| --- | --- | --- | --- |
| `maxConcurrentCampaignRuns` | integer | Yes | At least 1. |
| `routineBudgetPercent` | integer | Yes | 0 to 100 percent of CI capacity for routine bumps. |
| `kevBurstBudgetPercent` | integer | Yes | 0 to 100 percent of CI capacity for known-exploited fixes. |
| `flakeControlRerun` | boolean | Yes | Reruns failing checks on the base commit to separate flakes from regressions. |
| `safeVerifyWorkflows` | list | No | Workflows Osty may run to verify its branches even when the CI classifier marks them `SIDE_EFFECT_POSSIBLE`. |

### autonomy

Table: Keys under `autonomy`

| Key | Type | Required | Rule |
| --- | --- | --- | --- |
| `defaultTier` | autonomy level | Yes | Level for every tier not listed under `tiers`. |
| `canaryDefaults` | map | When rollout is permitted | `soakMinutes` (1 to 43200), `maxErrorRateDeltaPct` (0 to 100), `maxP99DeltaPct` (0 or more) and optional `zeroOOMKills` (default true). |
| `tiers` | map | Yes | Keys `TIER_0` to `TIER_3`. `{}` is allowed. |
| `tiers.<tier>.maxAutonomy` | autonomy level | Yes | Highest level for the tier. |
| `tiers.<tier>.requireObservabilityGate` | boolean | No | Defaults to true. Must be true when the tier permits automated rollout. |
| `tiers.<tier>.allowStaleMainAutoRedeploy` | boolean | No | Defaults to false. Lets Osty redeploy a stale workload from `main` once the fix is merged. |
| `tiers.<tier>.canarySoakMinutes` | integer | No | Overrides `canaryDefaults.soakMinutes`. |
| `tiers.<tier>.canaryMaxErrorRateDeltaPct` | number | No | Overrides `canaryDefaults.maxErrorRateDeltaPct`. |
| `tiers.<tier>.canaryMaxP99DeltaPct` | number | No | Overrides `canaryDefaults.maxP99DeltaPct`. |
| `tiers.<tier>.canaryZeroOOMKills` | boolean | No | Overrides `canaryDefaults.zeroOOMKills`. |

### patchVerifier

Table: Keys under `patchVerifier`

| Key | Type | Required | Rule |
| --- | --- | --- | --- |
| `allowAgenticCodeMigrations` | boolean | Yes | Allows LLM code migrations in zero-network sandboxes. |
| `agenticMigrationMaxAutonomy` | autonomy level | Yes | `OBSERVE` or `VERIFIED_PR` only. |
| `forbiddenPaths` | list | Yes | Repository-relative globs no patch may touch. `.gitlab-ci.yml`, `.gitlab/ci/**` and `**/*.gitlab-ci.yml` are always forbidden. |
| `forbidUnlistedDependencies` | boolean | Yes | Rejects patches that add dependencies outside the campaign's authorized dependency set. |
| `forbidNewShellOrNetworkPrimitives` | boolean | Yes | Rejects patches that add shell or network calls. |

### killSwitch

Table: Keys under `killSwitch`

| Key | Type | Required | Rule |
| --- | --- | --- | --- |
| `autoFreezeProxyOnConfirmedMalicious` | boolean | Yes | Freezes a `CONFIRMED_MALICIOUS` artifact in every proxy. |
| `autoRollbackStatelessWorkloads` | boolean | Yes | Rolls back stateless workloads that run a `CONFIRMED_MALICIOUS` artifact. |
| `statefulMigrationAction` | enum | Yes | `CONTAIN_AND_FORWARD_REBUILD` or `CONTAIN_ONLY`. |
| `requireDualControlForBroadRollback` | boolean | Yes | Broad rollbacks need two operator signatures from `osty dual-control sign`. |

### releaseGates

Table: Keys under `releaseGates`

| Key | Type | Required | Rule |
| --- | --- | --- | --- |
| `freezeWindows[].name` | slug | Yes | Lowercase letters, digits and hyphens, at most 63 characters, unique. |
| `freezeWindows[].start, end` | RFC3339 | One-off windows | `end` must be after `start`. |
| `freezeWindows[].schedule, durationMinutes` | cron, integer | Recurring windows | Duration 1 to 44640 minutes. Cannot be combined with `start` and `end`. |
| `freezeWindows[].appliesToTiers` | list | No | Omit to cover every tier. |
| `freezeWindows[].allowKEVOverride` | boolean | No | Lets known-exploited fixes through. Defaults to false. |
| `freezeWindows[].reason` | string | Yes | Must not be blank. |
| `externalApprovalGates[].provider` | enum | Yes | `SERVICENOW`, `JIRA` or `WEBHOOK`. |
| `externalApprovalGates[].appliesToActions` | list | Yes | `OPEN_PR`, `MERGE_PR` or `REDEPLOY`. |
| `externalApprovalGates[].appliesToTiers` | list | No | Omit to cover every tier. |
| `externalApprovalGates[].failClosed` | boolean | Yes | Must be true. |
| `externalApprovalGates[].maxSignalAgeMinutes` | integer | Yes | 1 to 10080. Older approvals do not count. |

A `releaseGates` section to append to the complete policy:

```yaml
releaseGates:
  freezeWindows:
    - name: year-end-freeze
      start: "2026-12-19T00:00:00Z"
      end: "2027-01-04T00:00:00Z"
      appliesToTiers: [TIER_0, TIER_1]
      allowKEVOverride: true
      reason: "Year-end change freeze"
    - name: weekend-freeze
      schedule: "0 18 * * FRI"
      durationMinutes: 3840
      appliesToTiers: [TIER_0]
      reason: "No weekend production changes"
  externalApprovalGates:
    - name: servicenow-cab
      provider: SERVICENOW
      appliesToTiers: [TIER_0]
      appliesToActions: [MERGE_PR, REDEPLOY]
      failClosed: true
      maxSignalAgeMinutes: 240
```

## What does the parser reject?

- Unknown keys at any depth, so a typo such as `supplyChian` fails instead of being ignored.
- Quoted booleans such as `"true"`, and numbers where a boolean is expected.
- More than one YAML document, an empty file or a file over 1 MiB.
- A missing required key, even when its value would be the default.
- A tier that permits automated rollout with `requireObservabilityGate: false`, or with no canary gate.
- An external approval gate with `failClosed: false`, which would let a missing or forged approval through.

Three of those failures, each exit 1:

```text
osty policy: malformed policy document: line 6: "true" is not a boolean; use true or false
osty policy: malformed policy document: yaml: unmarshal errors:
  line 27: field maxRetries not found in type policy.ciGovernorDocument
osty policy: policy has 1 validation issue(s):
  autonomy.tiers.TIER_2.requireObservabilityGate: must be true because maxAutonomy CANARY_ROLLOUT with allowStaleMainAutoRedeploy true permits automated production rollout
```

## How do repository overlays tighten the fleet policy?

The fleet policy is the complete document `osty-edge` pins with `--policy`. A repository can add an overlay, listed as `policyOverlayPath` under `repositories` in the edge runtime config. An overlay is a partial `FleetPolicy` document. It is merged with the fleet policy before every command, and a merge that loosens any value is rejected.

Table: Tighten-only merge rules for repository overlays

| Key | An overlay may |
| --- | --- |
| `autonomy` levels and `agenticMigrationMaxAutonomy` | Lower them, never raise them. |
| `defaultCooldownHours`, canary soak | Lengthen them. |
| Canary error-rate and p99 tolerances | Lower them. |
| `proxyFailureMode` | Move from `FAIL_OPEN_WITH_CACHE` to `FAIL_CLOSED`, never back. |
| `blockVerdicts`, `forbiddenPaths` | Add entries. The result is the union. |
| `allowedLicenses` | Narrow the list. An empty intersection is rejected. |
| `blockLicenseChanges`, `requireObservabilityGate`, `zeroOOMKills`, `forbid*` rules, `autoFreezeProxyOnConfirmedMalicious`, `requireDualControlForBroadRollback` | Turn them on, never off. |
| `fastTrackVerifiedKEV`, `allowStaleMainAutoRedeploy`, `allowAgenticCodeMigrations` | Turn them off, never on. |
| `privatePackageAllowlist`, `safeVerifyWorkflows` | Keep a subset of the fleet entries. |
| `cadence`, `ciGovernor` budgets, `autoRollbackStatelessWorkloads`, `statefulMigrationAction` | Match the fleet value exactly. |

`osty policy validate` checks complete documents only. With `--control-url` and `--runtime-config`, `osty-edge serve` merges every overlay with the pinned fleet policy at startup and refuses to start if one loosens it.

## Frequently asked questions

### Is fleet-policy.yaml a different format?

No. There is one schema, `kind: FleetPolicy`. The fleet policy is the complete document the edge pins, wherever you store it. `.osty/policy.yaml` is the conventional path in a repository.

### Can a repository raise its own autonomy?

No. Overlays may only tighten. A higher autonomy level, a weaker failure mode or a dropped gate is rejected with the key path that loosened.

### Can LLM code changes ever auto-merge?

No. `agenticMigrationMaxAutonomy` is capped at `VERIFIED_PR` by the parser, by overlay validation and by the merge itself.

### Is the policy file executable?

No. It is data only. Release gates use declared providers such as `SERVICENOW` rather than shell hooks.

## Related pages

- [Policy and Ledger](https://osty.dev/policy-ledger): Git-pinned, non-executable `.osty/policy.yaml` enforced by `osty-edge` on every mutating command, tighten-only overlays, release gates and the hash-chained Ed25519 Evidence Ledger.
- [CLI reference](https://osty.dev/docs/cli): Every `osty` command, flag, exit code and `--json` output.
- [Policy builder](https://osty.dev/tools/policy-builder): Build a `.osty/policy.yaml` in the browser.
- [Vanta, Drata and ServiceNow](https://osty.dev/integrations/vanta-drata-servicenow): Release gates with ServiceNow or Jira approvals.

## See your fleet in 10 minutes

Connect a read-only GitHub App and cloud role. Osty installs nothing in your environment and writes nothing to your repositories, and the report shows false positives, stale deploys and unowned workloads.

Get a free X-Ray: https://osty.dev/xray

Written by Osty Engineering. Published 2026-11-29. Updated 2026-11-29.

Canonical: https://osty.dev/docs/policy
