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

# Codex

> Connect the Codex CLI to a GitAudience project, install its two custom sub-agents and its skill, allow network access for public pages and start the enrichment.

You end with the Codex CLI connected to the MCP server of one project, two custom sub-agents and a project skill installed, and a prompt that enriches the project's stargazers.

> [!WARNING]
>
> Codex sub-agents run without strict tool isolation. Unlike Claude Code sub-agents, they inherit the MCP servers, the sandbox and the local tools of the session; the crawler, which reads public pages, has them too. Launch Codex from an empty dedicated folder with no source code or secrets, and keep tool confirmations on. The server checks stay the same as for any client: a token reaches one project, each sub-agent's capability opens only its own tools for one stargazer, and no email leaves through MCP. See [Privacy and data](https://www.gitaudience.com/docs/features/privacy.md).

## Before you start

- The Codex CLI installed on your computer.
- A project whose setup is finished, with a published configuration. See [Add a project](https://www.gitaudience.com/docs/guides/add-a-project.md).
- The owner role on the instance, to create the token and to switch the project's client. See [Users](https://www.gitaudience.com/docs/features/users.md).
- Your instance reachable from your computer at its `PUBLIC_URL`, such as `https://gitaudience.example.com`.
- An empty folder to run Codex from.

While you add a project, step 2 asks which AI tool you use, step 6, **MCP agent**, shows the same configuration and files, and step 7 gives the first prompt. This page follows Settings › **MCP agent**, where you find them once the project is set up.

### 1. Choose Codex

Open the project, then Settings › **MCP agent**. At step 1, **Choose your agent**, pick **Codex** and confirm **Switch to Codex**.

Switching saves Codex for this project and resets the crawler and decider models and effort of your configuration draft to Codex's defaults. Your facts, instructions, target profiles and parallelism stay. Publish the draft in Settings › **Agent instructions** so the generated files follow it.

![Settings › MCP agent for the orbit project with Codex chosen at step 1: the warning that sub-agents run without strict tool isolation, and step 3 showing the config.toml block](https://www.gitaudience.com/docs/assets/screenshots/codex-mcp-agent-steps.png)

### 2. Create an agent token

At step 2, **Create an agent token**, type a name for the token and click **Create agent token**. The token shows once, and the configuration of the next step already contains it.

### 3. Register the MCP server

Step 3, **Register the MCP server in Codex**, gives a block to add to `~/.codex/config.toml`. For a project whose slug is `orbit`:

```toml ~/.codex/config.toml
[mcp_servers.gitaudience-orbit]
url = "https://gitaudience.example.com/mcp"
http_headers = { "Authorization" = "Bearer <YOUR_TOKEN>" }
```

Click **Copy config**, add the block to the file, then restart Codex.

To keep the token out of the file, open **Alternative: store the token in an environment variable** instead. It exports the token and registers the server with `codex mcp add`:

```bash
export GITAUDIENCE_ORBIT_TOKEN="<YOUR_TOKEN>"
codex mcp add gitaudience-orbit --url https://gitaudience.example.com/mcp --bearer-token-env-var GITAUDIENCE_ORBIT_TOKEN
```

### Allow network access

The crawler reads public pages with `curl` inside the Codex sandbox. Step 3 reminds you to allow network access in `~/.codex/config.toml`:

```toml ~/.codex/config.toml
[sandbox_workspace_write]
network_access = true
```

Or leave it off and approve the requests manually. The crawler reads at most 5 pages per stargazer, never LinkedIn and never a search engine.

### 4. Install the two sub-agents and the skill

At step 4, **Install the two sub-agents**, click **Copy install command** and run it in a terminal. It writes three files:

| File                                             | What it is                                                                           |
| ------------------------------------------------ | ------------------------------------------------------------------------------------ |
| `~/.codex/agents/gitaudience-orbit-crawler.toml` | Research agent: reads the public pages about one stargazer and saves a dossier       |
| `~/.codex/agents/gitaudience-orbit-decider.toml` | Evaluation agent: reads that dossier and returns the facts and target profile scores |
| `~/.agents/skills/gitaudience-orbit/SKILL.md`    | The skill that runs the enrichment of this project with the two sub-agents           |

**Inspect install command** shows the command first, and a **Download** button gives each file. The files contain no token and no text from your configuration: only the server name, the project slug, and the model and reasoning effort of each sub-agent.

### 5. Start the enrichment

Start Codex from your empty folder. Step 5, **Start the enrichment**, gives the prompt, which calls the project's skill:

```text
$gitaudience-orbit Enrich my GitAudience stargazers for project "orbit".
```

Codex takes the stargazers in batches. For each one it starts the crawler, then the decider, and saves the result. It goes from one batch to the next without asking you, until no stargazer is left or the server tells it to stop.

Run the prompt again when new stargazers arrive.

## Check that it works

In Settings › **MCP agent**:

- **Your agent is connected, waiting for its first stargazer** as soon as the token has been used.
- **Your agent is connected** once both sub-agents have called their MCP tools on the same stargazer. Step 4 then shows **MCP tools verified** with the date. This says the tools were called; it doesn't prove the sub-agents were isolated.

The project's **Enrichment** page shows the stargazers being processed. See [Enrichment](https://www.gitaudience.com/docs/features/enrichment.md).

## Sub-agent models

Each sub-agent has its own model and reasoning effort, set in Settings › **Agent instructions**, in the sub-agents card. They are written to `model` and `model_reasoning_effort` in each `.toml` file. For Codex:

|         | Default model | Default effort |
| ------- | ------------- | -------------- |
| Crawler | `gpt-6-luna`  | `low`          |
| Decider | `gpt-6.2-sol` | `medium`       |

The console offers `gpt-6-luna`, `gpt-6.1-terra`, `gpt-6.2-sol`, `gpt-6.2-astra`, `gpt-6.1-sol`, `gpt-6-sol` and `gpt-6-astra`, with the efforts `low`, `medium`, `high`, `xhigh` and `max`.

After you publish a change to these settings, run the install command of step 4 again.

## Read-only access

To let Codex read the reports of a project without enriching it, create a **Read only** token from the **Tokens** card of Settings › **MCP agent**. Its banner gives **Copy connection command** and **Copy read-only prompt**. No sub-agent file or skill is needed. See [MCP server](https://www.gitaudience.com/docs/features/mcp-server.md#read-only-tokens).

## If something goes wrong

| What you see                                                                  | What to do                                                                                                                                                             |
| ----------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **The sub-agents cannot reach their tools**, or Codex reports `tools_missing` | Check that the name in `[mcp_servers.…]` is the MCP server name shown under **Advanced**, install the files of step 4 again, restart Codex, then run the prompt again. |
| The crawler reads no page                                                     | The crawler needs network access for `curl`. See [Allow network access](#allow-network-access).                                                                        |
| `contract_changed`                                                            | Your sub-agent files come from an older version of GitAudience. Run the install command of step 4 again.                                                               |
| The enrichment stops with `limit_reached`                                     | The project has used its 500 free places. See [Licence](https://www.gitaudience.com/docs/self-hosting/licence.md).                                                     |

After you rename the MCP server, redo steps 3 and 4: update the block in `~/.codex/config.toml` and install the files again under their new names.

## Next steps

- [Calibrate the enrichment](https://www.gitaudience.com/docs/guides/calibrate-enrichment.md) on a first batch of stargazers.
- [Agent instructions](https://www.gitaudience.com/docs/features/agent-instructions.md) to change what the sub-agents look for.
- [Claude Code](https://www.gitaudience.com/docs/integrations/claude-code.md), the client that isolates each sub-agent's tools.
