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

> Usage and flags for oz0 egress learn.

For: Operators and developers looking up a command.

Reads the requests the egress proxy refused a job and its child jobs (each target once, at most 20 per job) and proposes the narrowest entry that would allow each: for the agent's or its plugin's egress list, or for the tenant's, with the `oz0 tenant egress` command that sets it. It applies nothing: a person decides.

An internal address (the node, its network, a metadata service) is proposed only for the tenant's list, by address, and left out of its command; a private network (RFC 1918, carrier-grade NAT, unique local IPv6) is proposed for the tenant's list and its command, since only the tenant's entries reach one.

Refusals that no entry should change are listed for review: a TLS server name other than the tunnel's host (domain fronting), a Host header other than the URL's, a deny entry. A proposed entry that reaches a host serving files anyone can publish (a code host's raw files, a package registry, an object store) says so, as a reason to look before adding it.

--apply asks for the tenant's list with the proposed entries (never an internal address): a widening, so it is a change request a tenant admin approves (--approve approves it at once after printing its delta, when the tenant's review-widening lets you).

## Usage

```bash
oz0 egress learn <job> [flags]
```

## Flags

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

<tbody>
  <tr>
    <td>
      <code>
        --apply
      </code>
    </td>
    
    <td>
      bool
    </td>
    
    <td>
      
    </td>
    
    <td>
      ask for the tenant's list with the proposed entries: a change request
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        --approve
      </code>
    </td>
    
    <td>
      bool
    </td>
    
    <td>
      
    </td>
    
    <td>
      with --apply, approve the change request at once after printing its delta
    </td>
  </tr>
  
  <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>
        --json
      </code>
    </td>
    
    <td>
      bool
    </td>
    
    <td>
      
    </td>
    
    <td>
      print JSON instead of a table
    </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>
      the job's 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.
