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

> Usage and flags for oz0 policy export.

For: Operators and developers looking up a command.

Write the tenant's whole tool policy as YAML (format oz0.policy/v1), to standard output or to a file with -o:
the defaults by type, the approval settings, the built-in rules' switches and every rule in order, each with its ID
and its settings as fields: allow, ask or refuse; shadow, when, callers, kinds, deciders, expires; origin and sequence
rules as YAML. Change it and apply it with oz0 policy apply -f \<file>. Takes governance.read.

## Usage

```bash
oz0 policy export [flags]
```

## Flags

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

<tbody>
  <tr>
    <td>
      <code>
        --output
      </code>
      
       (<code>
        -o
      </code>
      
      )
    </td>
    
    <td>
      string
    </td>
    
    <td>
      
    </td>
    
    <td>
      write to this file (standard output when empty or -)
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        --tenant
      </code>
    </td>
    
    <td>
      string
    </td>
    
    <td>
      <code>
        default
      </code>
    </td>
    
    <td>
      tenant
    </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.
