# ceiling.json

The most any caller may do on one machine, whatever its grant. A call runs only when its risk class
is in the agent's grant and in this file.

**In short:** `{"risks": ["read", "write"], "roots": ["~/projects"]}` in the machine's config folder,
then restart the machine program. `cmdop control ceiling.get` shows what it enforces.

## Where it lives

The machine's config folder: `~/Library/Application Support/cmdop/ceiling.json` on macOS,
`~/.config/cmdop/ceiling.json` on Linux. The machine program reads it once, at start. No file
means every default below.

## Keys

| Key | Type | Default | Meaning |
|---|---|---|---|
| `risks` | risk classes | `["read", "write", "destructive", "exec", "network"]` | The classes any caller may ever use here. `screen` and `control` are allowed only when named. |
| `unpaired_risks` | risk classes | the same as `risks` | The classes for calls that do not come from a client paired on this machine: MCP agents, the page, your backend. Never wider than `risks`. |
| `roots` | paths | `[]`: anywhere | When not empty, the file tools work only under these folders. Absolute, or under the home folder (`~/src`, or `src`). |
| `secrets` | boolean | `false` | Let the file tools read and write the folders that hold keys and credentials ([the list](https://docs.cmdop.ai/guides/files.md#what-the-file-tools-never-reach)). Files no tool may change stay closed. |
| `apps` | object | no app | Which apps `control` may drive: `allow` and `deny`, lists of names. |

Risk classes: `read`, `write`, `destructive`, `exec`, `network`, `screen`, `control`
([what each allows](https://docs.cmdop.ai/reference/tools.md#risk-classes)).

### `apps`

```json
{ "apps": { "allow": ["Safari", "com.apple.Notes"], "deny": ["*bank*"] } }
```

- Names are matched against the app's name and its bundle id, ignoring case; `*` and `?` work.
- No `allow` entry means no app may be driven. `"*"` allows every app that is not denied.
- `deny` wins over `allow`. Password managers, Keychain Access, CMDOP's own windows and System
  Settings while a privacy or security pane is in front are denied whatever the lists say.
- A terminal app also needs `exec`: typing into it runs commands.

## Example

A build machine: agents and the page may look and run builds; a client you paired may also change
and remove files:

```json
{
  "risks": ["read", "write", "destructive", "exec", "network"],
  "unpaired_risks": ["read", "exec"],
  "roots": ["~/src"]
}
```

## Errors

- The machine program stops at start with `ceiling: <path>: <error>` when the file is not valid
  JSON or a value is not a known class. It never falls back to a wider default.
- A key it does not know is ignored, and that key's default applies.
- A call the ceiling refuses returns [`denied`](https://docs.cmdop.ai/reference/errors/denied.md).

## Related

[Set the ceiling](https://docs.cmdop.ai/guides/access/ceiling.md) · [Grants and the ceiling](https://docs.cmdop.ai/concepts/grants-and-ceiling.md) ·
[`cmdop pair`](https://docs.cmdop.ai/reference/cli.md#cmdop-pair)
