> ## Documentation Index
> Fetch the complete documentation index at: https://docs.barndoor.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Provider lockdown and client policies

> Optionally make Claude and Codex run only through Barndoor on managed machines: block direct provider APIs, install the Claude and Codex policies, hold Codex Desktop updates, and lock Claude Desktop's configuration.

This page is for IT admins who want Claude and Codex to run only through Barndoor on managed Macs. By default Bridge governs the sessions it launches and nothing else: someone can still open Claude or Codex directly. The controls below close those paths. All of them are optional except the Codex policy, which the updater installs unless you opt out. Most are switched on when you [render the MDM profiles](https://docs.barndoor.ai/how-tos/barndoor-bridge/install-with-mdm.md#1-render-the-profiles).

| Control | What it does | Default |
| - | - | - |
| [Provider lockdown](#provider-lockdown) | Blocks direct access to LLM provider APIs, and installs the Claude policy so Claude runs only through Barndoor. | Off |
| [Codex policy](#codex-policy) | Turns on **Launch Codex Desktop**, and makes Codex run only through Barndoor. | On |
| [Hold Codex Desktop updates](#hold-codex-desktop-updates) | Stops Codex Desktop updating past the versions Barndoor supports. | Off |
| [Claude Desktop managed profile](#claude-desktop-managed-profile) | Makes Claude Desktop's Barndoor configuration impossible to change. | Off |
| [Santa rules](#santa-rules) | Blocks unapproved AI desktop apps. | Off |

The steps below are for macOS. On Windows, the Codex policy works as it does on macOS, and provider lockdown isn't available, though you can record that a secure web gateway already blocks the provider APIs; see [Install on Windows](https://docs.barndoor.ai/how-tos/barndoor-bridge/install-on-windows.md).

## Provider lockdown

> [!WARNING]
>
> If Bridge governs [MCP only](https://docs.barndoor.ai/how-tos/barndoor-bridge/mcp-only.md), leave provider lockdown off. Models then run on each person's own Claude or OpenAI sign-in, which lockdown blocks. The Codex policy can stay.

Provider lockdown is one switch, set when you render the MDM profiles. With it on:

* **Direct LLM provider APIs are blocked**, so traffic can't skip the gateway: `api.anthropic.com`, `api.openai.com`, Gemini, Vertex AI, Bedrock runtime, Azure OpenAI and AI Services, Mistral, Groq, Together, OpenRouter, DeepSeek, xAI, Cohere, Perplexity, Hugging Face inference, Fireworks, Cerebras, and Replicate, plus the public DNS-over-HTTPS resolvers that would get around the block. The providers' sign-in hosts (`claude.ai`, `console.anthropic.com`, `auth.openai.com`), Barndoor's hosts, and your gateway stay reachable.
* **Claude runs only through Barndoor.** The updater installs the Claude policy (Claude Code managed settings plus a fallback Claude Desktop profile). A `claude` started from a terminal has every prompt refused with a message pointing at `barndoor run claude` and the Bridge app, and Claude Desktop opened directly shows a profile named **Barndoor (open Claude Desktop from Bridge)** that can't reach Claude.

Lockdown doesn't stop the providers' websites, such as `chatgpt.com` and `gemini.google.com`, in a browser: DNS can't tell those apart from the sign-in flows Bridge needs.

Pick one of two ways to block the provider APIs:

| You have | Render with | What it does |
| - | - | - |
| No web filtering today | `--dns --resolver nextdns --nextdns-profile <id>` or `--dns --resolver cloudflare --doh-url <url>`. With NextDNS, add `--mdm jamf` or `--mdm intune` to label each Mac in the resolver's logs. | Renders `dns-inference-block.mobileconfig`, which pins the Mac's DNS to your resolver over HTTPS and stops the user turning it off. Load the blocklist into the resolver first: `./render.sh --print-resolver-policy nextdns` (or `cloudflare`) prints it, with your gateway host added when you pass `--backend-url`. |
| A secure web gateway that already blocks these hosts | `--dns-control-source external_swg` | No DNS profile. Records that your gateway does the blocking, so the Claude policy still installs. |

Either way, the next run of `install-latest.sh` installs the Claude policy and keeps it current. Re-render without lockdown and the next run removes it, along with nothing it didn't write.

> [!NOTE]
>
> If a Mac already has a `/Library/Application Support/ClaudeCode/managed-settings.json` of your own, the updater doesn't overwrite it and reports a failure instead. Merge the output of `barndoor claude-policy print` into your file.

To check a Mac, run `barndoor doctor`. With lockdown on, expect:

```text theme={null}
Direct inference egress ... Result: blocked: provider hosts are unreachable and the gateway is reachable
Claude policy ... Claude Code managed settings (/Library/Application Support/ClaudeCode/managed-settings.json): ok ... Claude Desktop fallback profile: ok
```

`present but NOT blocked` means lockdown is on but a provider host is still reachable: check the resolver policy or your secure web gateway's rules.

## Codex policy

The Codex policy is Codex's system requirements file, `/etc/codex/requirements.toml`. The updater installs it on **every** managed Mac, whether or not provider lockdown is on, and keeps it current.

With the policy on a Mac:

* **Launch Codex Desktop** appears in Bridge when Codex Desktop is installed at `/Applications/ChatGPT.app`. Without the policy, Bridge shows no button.
* `codex` in a terminal, and Codex in the ChatGPT app opened directly, refuse to run outside Barndoor. `barndoor run codex` and **Launch Codex Desktop** work. Tell people before you roll it out.

Things to know:

* **It replaces a requirements file of your own** on every run. If your fleet ships its own Codex requirements, opt out.
* **Don't ship a copy of the file through your MDM.** A Bridge release can change the policy, and launches refuse an out-of-date one. Let the updater install it.
* **The behaviour is in the script.** MDM consoles run the script text you pasted, so a fleet gets the always-on Codex policy only once you paste the current `install-latest.sh`.
* If one policy fails to install, the updater still installs the others, then exits non-zero so your MDM reports it.

To opt a fleet out, run the updater with `--no-codex-desktop-policy`, or set `BARNDOOR_MDM_CODEX_DESKTOP_POLICY=0` in its environment. That removes only a file Barndoor wrote, and **Launch Codex Desktop** is no longer offered.

On a Mac without the policy, `barndoor codex-desktop-policy verify` says what's missing:

![Terminal output. barndoor codex-desktop-policy builds: Codex Desktop 26.903.71938 (build 8576), bundled codex-cli 0.153.4, Status: supported, and the list of supported bundled CLIs. barndoor codex-desktop-policy verify: Error: the Codex requirements file /etc/codex/requirements.toml is missing; your organization's device management installs it (the Barndoor MDM kit installs it on every managed device), and an administrator can install it by hand with barndoor codex-desktop-policy install with sudo](https://mintcdn.com/barndoor/0bFGCBNQXYdMP58U/images/barndoor-bridge/codex-desktop-policy-builds.png?fit=max\&auto=format\&n=0bFGCBNQXYdMP58U\&q=85\&s=8f2004a5bf72fa9974dad1595ac0d7bf)

On a single Mac outside MDM, install it with `sudo barndoor codex-desktop-policy install` and remove it with `sudo barndoor codex-desktop-policy remove`.

## Hold Codex Desktop updates

Codex Desktop updates itself. Barndoor supports the Codex Desktop versions it has reviewed, normally the current one and a few before it, and adds new ones in later Bridge releases. Until then, a Mac that updated early fails to launch with "newer than this Barndoor supports".

To hold Codex Desktop at the version you deploy, render with `--hold-codex-desktop-updates` and deploy `codex-desktop-updates.mobileconfig` like the other profiles. It turns off Codex Desktop's automatic update checks and downloads, with or without provider lockdown.

* **It must be a managed profile.** Codex Desktop rewrites its own update settings at launch, so `defaults write` doesn't stick.
* **Check for Updates… in the ChatGPT menu still works.** Where people don't have administrator rights and the app is owned by root, macOS asks for an administrator password.
* **Homebrew can still replace the app.** `brew upgrade --greedy`, or `brew upgrade --cask chatgpt`, installs a new ChatGPT.app regardless. Leave `chatgpt` out of greedy upgrades on these Macs.

To release a new version, install it on one test Mac and run `barndoor codex-desktop-policy builds`. Once it reports `Status: supported`, deploy that version to the fleet. The command exits non-zero only when a launch would refuse the installed version, so it also works as an MDM audit. To stop holding updates, remove the profile.

## Claude Desktop managed profile

With the Claude policy, Claude Desktop opened directly gets a fallback profile that can't reach a model. That profile is a file people can edit or delete, though the next updater run puts it back. To make it tamper-proof, deploy Claude Desktop's Barndoor configuration as a managed profile instead. People then can't change where Claude Desktop sends requests or which MCP servers it has, or switch it to a personal claude.ai account.

1. Render with `--claude-desktop-managed <capabilities.json>`, a file with the capabilities Claude Desktop gets on every Mac in the group. `render.sh` uses the Barndoor CLI on the rendering Mac to produce `claude-desktop.mobileconfig`, and turns the setting on in the managed settings profile.
2. Deploy **both** `claude-desktop.mobileconfig` and the new managed settings profile to the same devices, at device scope.
3. On a Mac, `barndoor doctor` reports `Claude Desktop managed profile: ok`.

Things to know:

* **Deploy and remove the two profiles together.** If a Mac has only one of them, Bridge refuses to launch Claude Desktop, and `barndoor doctor` reports a `DISAGREEMENT:` or `missing` line.
* **The profile is a ceiling.** If someone's client settings allow more than the profile, the launch runs limited by the profile. If their client settings are stricter than the profile, the launch is refused, because Claude Desktop's chat and Cowork can't be narrowed per session.
* **One governed Claude Desktop per Mac,** on a fixed local port (47566 unless you render with `--claude-desktop-port`).
* **Claude Desktop applies a changed profile when it relaunches,** which it forces within 24 hours.
* **Roll it out to a small group first**, as with any profile that changes how Claude Desktop starts.

The MDM kit's README has the full flag list, including the folders and network hosts Cowork may use.

## Santa rules

The MDM kit includes optional [Santa](https://northpole.dev) rules in `santa/` that block unapproved AI desktop apps, such as Cursor and the ChatGPT chat app, while allowing Barndoor, Claude, and Codex. Deploy the monitor rules first, then switch to the deny rules once you've seen what they would block. The kit's `guides/` folder covers delivery for each MDM.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.