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

# OACB

> Apply a security baseline to a coding agent’s own configuration, and verify it holds

OACB is the **Open Autonomous Coding-agent Baseline** — a set of tiers you apply to a coding agent's own configuration, so the agent is constrained before Unbound policies ever see a command.

It is a separate layer from your Unbound policies. Policies decide what an agent may do across your organization; OACB hardens the agent on one machine. You can run either alone, and most teams run both.

> [!NOTE]
>
> Read [the framework](https://github.com/websentry-ai/oacb) before applying `baseline` or higher. Those tiers block commands, and the point of `shadow` is to find out which ones before that happens to a developer mid-task.

## Start here

```bash theme={null}
unbound oacb check               # what is installed, and where
unbound oacb apply --tier shadow # log everything, block nothing
```

Leave `shadow` running for about two weeks, read the audit log, then move up:

```bash theme={null}
unbound oacb apply --tier baseline
unbound oacb doctor --tier baseline   # prove the hooks actually block
```

## Tiers

Five, least to most restrictive.

| Tier | What a developer experiences |
| - | - |
| `shadow` | Silent. Every command is logged, nothing is blocked |
| `receipts` | Warning banners on risky commands, which the developer can abort. **Expires after 30 days** |
| `baseline` | Blocks critical operations, asks before high-risk ones |
| `strict` | Warns on medium risk, blocks high and critical |
| `paranoid` | Blocks medium, high and critical, and disables auto mode |

Only `audit`, `apply` and `doctor` take `--tier`. On `audit` and `doctor` it defaults to `baseline`; `apply` prompts you to choose when you leave it out.

> [!WARNING]
>
> `receipts` is the only tier that expires. Thirty days after you apply it, it stops — so it suits a time-boxed rollout, not a steady state. `unbound oacb status` shows the expiry date.

## Agents

`claude-code` and `codex`. `audit`, `doctor`, `status`, `why` and `remove` default to `claude-code`; `apply` asks which agents to configure (you can pick both), and under `--yes` applies to `claude-code` only unless you pass `--agent`.

`diff` is Claude Code only, and so is the `--overrides` flag on `apply` — `apply` itself works on both. On Codex it sets `approval_policy` and `sandbox_mode` to match the tier.

| Agent | Config it writes | Hooks land in |
| - | - | - |
| `claude-code` | `settings.json` in your Claude config directory | `hooks/` beside it |
| `codex` | `~/.codex/config.toml` | `~/.codex/hooks/` |

For Claude Code the config directory follows `CLAUDE_CONFIG_DIR` when you have set it, so OACB installs where Claude Code actually reads.

## Commands

| Command | What it does | Flags |
| - | - | - |
| `unbound oacb check` | Pre-flight — which agents are installed, their versions, and current OACB state | none |
| `unbound oacb apply` | Download hooks and write the agent's config | `--agent` · `--tier` · `--overrides <path>` · `--dry-run` · `--preview-only` · `--yes` · `--print-policy` |
| `unbound oacb audit` | Score the agent's current settings against a tier and report gaps by rule ID | `--agent` · `--tier` · `--format <table\|json>` |
| `unbound oacb doctor` | Run the conformance suite against installed hooks to prove enforcement works | `--agent` · `--tier` · `--format <table\|json>` · `--verbose` |
| `unbound oacb diff` | Show the settings delta between two tiers — **Claude Code only** | `--from <tier>` · `--to <tier>` |
| `unbound oacb why` | Explain the most recent block or warn from the audit log | `--agent` |
| `unbound oacb rules` | Browse the rule registry | `--risk <low\|medium\|high\|critical>` · `--search <term>` |
| `unbound oacb status` | Current tier, expiry, and the last 7 days of audit counts | `--agent` |
| `unbound oacb remove` | Strip OACB from the agent's config and delete the installed hooks | `--agent` · `--dry-run` |

`--from` on `diff` is auto-detected from your settings when you omit it. Every subcommand exits `1` on failure.

### Applying safely

`apply` and `remove` are the two that write to a developer's machine. Both take `--dry-run`, and it is worth using:

```bash theme={null}
unbound oacb apply --tier strict --dry-run    # every step, no files written
unbound oacb apply --tier strict --preview-only # print the policy, install nothing
unbound oacb apply --tier strict --print-policy # resolved policy JSON on stdout
```

For CI or an MDM rollout, `--yes` makes `apply` non-interactive. It still writes a consent record, so there is a trail of what was applied and when. With `--yes` and no `--tier`, `apply` installs `shadow` (log only).

`apply` backs up the existing `settings.json` before it writes, and `remove` restores the rules you had before OACB from that backup — your own settings survive both.

### Understanding a block

These commands report on **OACB only**. If a policy of yours is not blocking something it should, that is a policy question rather than an OACB one — see [A Policy Is Not Blocking](https://docs.getunbound.ai/support/troubleshooting/policy-not-blocking.md).

When a developer hits a block, `why` is the fastest route to the reason:

```bash theme={null}
unbound oacb why                       # the most recent block or warn, explained
unbound oacb rules --risk critical     # everything that blocks at this level
unbound oacb rules --search docker     # find a rule by ID or description
```

> [!TIP]
>
> If a developer reports "Unbound blocked my command" and nothing shows in your policy logs, check OACB. The two enforce separately, and an OACB block never reaches your Unbound policy history.

## Verify it is working

`audit` and `doctor` answer different questions, and you want both.

* **`audit`** reads the configuration and scores it against a tier. It tells you whether the settings are right.
* **`doctor`** runs real commands through the installed hooks. It tells you whether enforcement actually happens.

Settings can score clean without the tier actually blocking, so `doctor` is the one that proves it is real:

```bash theme={null}
unbound oacb audit  --tier baseline --format json
unbound oacb doctor --tier baseline --verbose
```

Both accept `--format json` for scripting.

## Removing it

```bash theme={null}
unbound oacb remove --dry-run   # list what would go
unbound oacb remove
```

Rules you had before OACB are restored from the backup taken at apply time.

> [!NOTE]
>
> `--local-hooks` and `--local-managed-settings` on `apply` load hooks and settings from a local directory instead of downloading them. They exist for developing OACB itself and have no place in a normal install or an MDM rollout.


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