# "Quickstart: Codex"

Install the dsail package, register the stdio proxy with Codex CLI, and let Codex compile and check a policy from the repository.

For Codex CLI in a repository. Turn a written policy into rules a program can check; the rules live in the repo and every check runs on the hosted service.

## 1. Install and register

```bash
pip install dsail
dsail init
```

`dsail init` writes the `AGENTS.md` stanza Codex reads and a `.mcp.json` entry.
Codex CLI registers MCP servers in its own configuration, so add the proxy
there once:

```toml
# ~/.codex/config.toml
[mcp_servers.dsail]
command = "dsail"
args = ["mcp"]
```

The package name `dsail` is reserved on PyPI. Until the public release ships,
install from the distribution Jaxon gives you (`pip install ./dsail-*.whl`).

## 2. One command

```bash
codex "Encode our records-retention policy as rules a program can check: \
       customer files are kept seven years after account closure, and nothing \
       tagged legal-hold is deleted."
```

Codex reads the stanza, follows the skill's authoring sequence — English summary,
your confirmation, then DSAIL — and compiles through the `dsail_compile` tool.
An evaluation credential is obtained automatically on the first call.

## 3. A result

```bash
dsail check policies/retention.dsail --claims claims.json --summary
```

```text
kept_seven_years   TRUE
legal_hold_kept    UNKNOWN   (legal_hold submitted as unknown)
```

The second line is the point: a fact the document did not settle is reported
as `UNKNOWN`, not guessed either way. Unknown is an answer, not a guess.

## Notes specific to Codex

- Codex does not render MCP Apps, so review happens at the localhost link
  `dsail serve policies/retention.dsail` prints. Approval there is recorded on
  the service against the exact hash.
- Codex carries your account-level connectors into a session. If a `dsail`
  connector is already configured at the account level, the repository entry is
  redundant but harmless.

Every error carries a `docs` URL ([Errors](../reference/errors.md)). Next:
[Quickstart: REST](rest.md).
