# Outbound restrictions

> For the complete documentation index, see [llms.txt](https://docs-stg.ringleader.dev/llms.txt).


> An egress policy limits where a workstation connects, and Ringleader enforces it outside the workstation.


An egress policy limits where a workstation connects, and Ringleader enforces it outside the
workstation. Nothing running on the workstation can undo it, including its own root user. By
default a workstation reaches anything your network routes, including the computers on your local
network and anything your VPN routes to. An `egress` block narrows the workstation to an allowlist
of destinations, or lets it reach everything except a deny list.

## The enforcement setting

`enforcement` is required and has no default, so you always choose how strictly the policy is
held. Choose `strict` to find out when you apply the workstation
whether its provider can hold the policy. Choose `bestEffort` to have the workstation set up
either way, with any shortfall reported on its `EgressEnforced` condition. `audit` records what
a workstation reaches, as [Workstation reach audit](https://docs-stg.ringleader.dev/security/outbound/reach-audit/)
describes, and `open` allows everything except a deny list.
[Outbound connection restrictions](https://docs-stg.ringleader.dev/reference/resources/workstationconfig/#outbound-connection-restrictions)
defines the four values.

Ringleader enforces the policy in your cloud's firewall, in an edge instance, or in a network
process on your computer, depending on the provider. [Enforcement points](https://docs-stg.ringleader.dev/security/outbound/enforcement/)
says which.

## Destinations Ringleader adds

You never list the infrastructure a workstation needs to come up and stay managed. Ringleader
adds those destinations to every policy, so a policy cannot cut the workstation off from
Ringleader itself.

Ringleader also adds an attached Integration's endpoint, a host that receives an injected
credential, and an MCP server's host. It adds each one only on the ports it needs. An
`inspect: true` rule is different: it checks a host that the policy already allows, and does not
add that host to the allowlist. `rl workstation describe` names the Integration beside each
destination it added.

## Layers and the Policy limit

A Policy limit is a restriction that an administrator writes in a Policy, which a member cannot
widen. Configuration layers can make a policy stricter and never weaker. A higher-priority layer that
says `bestEffort` or `open` does not undo a team layer's `strict`. A layer cannot take away a
destination or deny entry that another layer adds.
[Layer combination](https://docs-stg.ringleader.dev/reference/resources/workstationconfig/#layer-combination) lists the two rules.

Layers cannot set a limit. Configuration layers merge by adding destinations together, which
only widens. A member can always write a higher-priority layer over their own workstation and add
whatever they like, so a restriction written as a layer is not a restriction. A limit has to live
where a member cannot write, and that is a Policy. An administrator writes an
`egressDestinations` rule, and a member cannot widen it.
[Egress destination entries](https://docs-stg.ringleader.dev/reference/resources/policy/#egress-destination-entries) says how
entries are matched.

## Allow only some destinations

To restrict a workstation to the destinations it needs, declare a `strict` policy that lists them.
This example allows GitHub, the npm registry and one database:

```yaml
spec:
  egress:
    enforcement: strict
    destinations:
      - host: github.com
      - host: registry.npmjs.org
      - cidr: 203.0.113.7
        ports: [5432]
```

1. Add the `egress` block to the workstation's file, or to a WorkstationConfig the workstation
   uses. A local workstation does not have to name its provider, as
   [Checks when you apply a policy](https://docs-stg.ringleader.dev/security/outbound/enforcement/#checks-when-you-apply-a-policy)
   describes.
2. Apply the file:

   ```bash
   rl apply -f my-box.yaml
   ```

   Ringleader refuses the workstation here if its provider cannot hold the policy.
3. Check what is enforced:

   ```bash
   rl workstation describe my-box
   ```

   The `EgressEnforced` condition reads `True` with reason `Enforced`. If it reads `False`,
   [Enforcement points](https://docs-stg.ringleader.dev/security/outbound/enforcement/) says how to fix it.
   A `host` destination on a cloud needs an Edge, so on a cloud a namespace administrator must
   declare one first. See [Edge management](https://docs-stg.ringleader.dev/security/outbound/edge-management/).

If you don't know which destinations the workstation needs, record them first, as
[Workstation reach audit](https://docs-stg.ringleader.dev/security/outbound/reach-audit/) shows.
A `host` destination defaults to port 443. Add `ports: [80, 443]` for plain HTTP. No other port
is possible for a name, as [Filtering behavior](https://docs-stg.ringleader.dev/security/outbound/filtering/)
explains.

## Keep a workstation off your local network

A local workstation with no `egress` block reaches the computers on your local network. That
includes your router, a NAS, the office network over your VPN and your Tailscale peers.
Ringleader leaves that open because developers often reach internal services over their VPN. To
close it and still reach the internet, add a deny list that refuses the private ranges:

```yaml
spec:
  egress:
    enforcement: open
    deny:
      - privateNetworks: true
```

1. Add the `egress` block to the workstation's file.
2. Apply the file:

   ```bash
   rl apply -f my-box.yaml
   ```

   On AWS, a namespace administrator must also declare an Edge, and `rl apply` refuses the
   workstation until one exists. See [Edge management](https://docs-stg.ringleader.dev/security/outbound/edge-management/).
3. Check what is enforced:

   ```bash
   rl workstation describe my-box
   ```

   The `EgressEnforced` condition reads `True` with reason `DenyHeld`.

The workstation now reaches public addresses. It cannot reach your router, a NAS, the office
network over your VPN, or your Tailscale peers. The destinations Ringleader needs to manage the
workstation stay reachable. If that is all you need, you are done.

[Enforcement points](https://docs-stg.ringleader.dev/security/outbound/enforcement/) says what enforces the
list on each provider, and [Filtering behavior](https://docs-stg.ringleader.dev/security/outbound/filtering/)
lists what a deny list does not stop.

## Block specific destinations

To refuse only some destinations, write a deny list with `cidr` and `host` entries. Each entry is
one of the three kinds in the
[deny entry table](https://docs-stg.ringleader.dev/reference/resources/workstationconfig/#block-destinations-with-a-deny-list).
This example refuses one network on every port, and one name on port 443 only:

```yaml
spec:
  egress:
    enforcement: open
    deny:
      - cidr: 10.20.0.0/16
      - host: "*.example.com"
        ports: [443]
```

1. Add the `deny` entries to the `egress` block in the workstation's file.
2. Apply the file with `rl apply -f my-box.yaml`.
3. Check what is enforced with `rl workstation describe my-box`. The `EgressEnforced` condition
   reads `True` with reason `DenyHeld`. On AWS, and for a `host` entry on any cloud, an Edge must
   serve the workstation first. See [Edge management](https://docs-stg.ringleader.dev/security/outbound/edge-management/).

You can add a deny list to a `strict`, `bestEffort` or `audit` policy too. There it removes
destinations from what the policy allows. When an allow entry and a deny entry both cover a
destination, the workstation cannot reach it.

## Change a deny list on a running workstation

You can change the list while the workstation runs. The new list applies without restarting the
workstation, and it ends any open connection to an address it now refuses.

1. Edit the `deny` entries in the workstation's file, then apply it with `rl apply -f my-box.yaml`.
2. Read the workstation's conditions:

   ```bash
   rl workstation describe my-box
   ```

   With an `open` policy, `EgressEnforced` reads `True` with reason `DenyHeld` once whatever
   enforces the list reports holding it. Beside another policy, the reason stays the policy's
   and the message adds a sentence about the list. `status.egress.deny` then lists what the
   workstation refuses. Until then the reason is `DenyNotServing`, and the workstation still
   reaches what the new list names. For a list that nothing can hold, the reason is
   `DenyNotHeld`.

## Next steps

- [Workstation reach audit](https://docs-stg.ringleader.dev/security/outbound/reach-audit/) records
  a workstation's connections and turns them into a `strict` policy.
- [Enforcement points](https://docs-stg.ringleader.dev/security/outbound/enforcement/) says what holds a
  policy on each provider, and what happens while an Edge is missing.
- [Filtering behavior](https://docs-stg.ringleader.dev/security/outbound/filtering/) covers names, DNS and
  denied connections.
- [Lock down Claude Code for unattended runs](https://docs-stg.ringleader.dev/guides/lock-down-claude-code/)
  combines an allowlist, keys kept off the workstation and a deadline for Claude Code that runs
  with nobody watching.
- [Outbound connection restrictions](https://docs-stg.ringleader.dev/reference/resources/workstationconfig/#outbound-connection-restrictions)
  has the `egress` fields, values and destination tables.

