# Codex (/docs/agents/codex)

[Codex](https://developers.openai.com/codex/cli) connects to conciv as an MCP server. In the panel it chats
inside its own sandbox.

## Connect Codex [#connect-codex]

Run this once, in any folder:

```bash title="Terminal"
npx @conciv/cli mcp connect codex
```

It adds conciv's MCP server, named conciv-hub, to Codex. Under the hood it runs `codex mcp add`. On success it
prints:

```json title="Output"
{"ok": true, "data": {"connected": "codex"}}
```

Then drive the tab you have open from Codex in your terminal. The walkthrough, from the first prompt to
picking a tab and troubleshooting, is in [Outside agent](/docs/usage/outside-agent).

## What conciv runs in the chat [#what-conciv-runs-in-the-chat]

When Codex is the session's harness, conciv runs the Codex CLI on your machine, in your project, with your own login:

```text title="What conciv passes Codex"
sandbox          workspace-write    <- Codex can write only inside your project
approval policy  never              <- Codex never asks, so no Permission card shows
model            your default       <- the model in your Codex config.toml, unless you pick one
```

The model menu lists the models in Codex's own model cache. A picked effort level reaches Codex as its reasoning
effort. Past Codex sessions in this project show in the session list.

## Disconnect [#disconnect]

```bash title="Terminal"
npx @conciv/cli mcp disconnect codex
```

This stops conciv answering Codex. It removes `conciv-hub` from its config.

<Accordions type="single">
  <Accordion title="The chat says Codex is not logged in">
    conciv checks the Codex login before a turn. Log in to Codex in a terminal, then send the message again.
  </Accordion>
  <Accordion title="Codex never asks before it acts">
    conciv runs it with the never approval policy. Its sandbox limits what it can touch instead. Pick Claude Code or
    Gemini CLI for a harness that asks with cards.
  </Accordion>
</Accordions>

## Next steps [#next-steps]

- **[Harnesses](/docs/harnesses):** compare what each harness can do.
- **[Approvals](/docs/usage/approvals):** what asks before the agent acts.
- **[Gemini CLI](/docs/agents/gemini-cli):** the same for Gemini CLI.
