---
title: "oz0 policy apply"
description: "Usage and flags for oz0 policy apply."
canonical_url: "https://docs.oz0.ai/reference/cli/oz0/policy/apply"
---
# oz0 policy apply

> Usage and flags for oz0 policy apply.

For: Operators and developers looking up a command.

Read a policy file (as oz0 policy export writes it, or a part of one: a part it leaves out stays as it is;
its rules, when it has them, are the whole list in order) and list every change it makes, one by one: each rule
added, removed or changed, the order, and each setting, with whether it tightens or loosens the policy and why,
loosenings first.

Then it asks before it applies them (--yes when no one is at the terminal; without either it changes
nothing). The tightenings are saved at once; the loosenings go through the tenant's governance after them: they take
the reason, and where four eyes are on they wait as a change request for another admin. The server checks and decides
every change again when it saves. --dry-run lists the changes and saves nothing.

Use - to read the file from standard
input.

## Usage

```bash
oz0 policy apply -f <file> [flags]
```

## Flags

<table>
<thead>
  <tr>
    <th>
      Flag
    </th>
    
    <th>
      Type
    </th>
    
    <th>
      Default
    </th>
    
    <th>
      Description
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code>
        --decision-ref
      </code>
    </td>
    
    <td>
      string
    </td>
    
    <td>
      
    </td>
    
    <td>
      the decision or case the change follows, such as a case number (at most 200 characters)
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        --dry-run
      </code>
    </td>
    
    <td>
      bool
    </td>
    
    <td>
      
    </td>
    
    <td>
      list the changes and save nothing
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        --file
      </code>
      
       (<code>
        -f
      </code>
      
      )
    </td>
    
    <td>
      string
    </td>
    
    <td>
      
    </td>
    
    <td>
      the policy file (- for standard input)
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        --reason
      </code>
    </td>
    
    <td>
      string
    </td>
    
    <td>
      
    </td>
    
    <td>
      why, required for every governance change (at most 500 characters; default $OZ0_REASON); the audit log keeps it
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        --tenant
      </code>
    </td>
    
    <td>
      string
    </td>
    
    <td>
      <code>
        default
      </code>
    </td>
    
    <td>
      tenant
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        --yes
      </code>
    </td>
    
    <td>
      bool
    </td>
    
    <td>
      
    </td>
    
    <td>
      apply without asking
    </td>
  </tr>
</tbody>
</table>

## Inherited flags

<table>
<thead>
  <tr>
    <th>
      Flag
    </th>
    
    <th>
      Type
    </th>
    
    <th>
      Default
    </th>
    
    <th>
      Description
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code>
        --context
      </code>
    </td>
    
    <td>
      string
    </td>
    
    <td>
      <code>
        $OZ0_CONTEXT or &lt;config dir>/orchestrator-zero/context.json
      </code>
    </td>
    
    <td>
      CLI context file written by server init
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        --log-level
      </code>
    </td>
    
    <td>
      string
    </td>
    
    <td>
      <code>
        info
      </code>
    </td>
    
    <td>
      log level: debug, info, warn or error
    </td>
  </tr>
</tbody>
</table>

See [all `oz0` commands](https://docs.oz0.ai/reference/cli/oz0) and the [global flags](https://docs.oz0.ai/reference/cli/oz0#global-flags).


## Sitemap

See the full [sitemap](https://docs.oz0.ai/sitemap.md) for all pages.
