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

# Codex Agents

> See which agent in Agent Inventory each Codex tool call lands on, and where that agent comes from.

> [!NOTE]
>
> Agent Inventory is currently in limited beta. Contact Opal support to enable it for your organization.

Codex has no agent of its own in Agent Inventory. Opal files each Codex tool call under the person's ChatGPT agent, or under their OpenAI agent if they have no ChatGPT agent, so you see what Codex did on the agent that stands for that person. This page explains which agent a call lands on, where that agent comes from, and what you see.

To see and control the tool calls that Codex makes on your computers, see [Codex Setup](https://docs.opal.dev/docs/tool-call-governance-codex.md). To bring your OpenAI organization's agents and people into the inventory, see [OpenAI and ChatGPT](https://docs.opal.dev/docs/openai-chatgpt-setup.md).

## Requirements

Before you begin, you must:

* Be an Opal Admin.
* Set up the Codex hooks on your computers, so that tool calls reach Opal. See [Codex Setup](https://docs.opal.dev/docs/tool-call-governance-codex.md).

## How a Codex call reaches an agent

When a call arrives, Opal works out which person made it and then looks for that person's agent.

1. Opal matches the call to a person by the emails the computer reports. See [Tell Opal who each person is](https://docs.opal.dev/docs/tool-call-governance-codex.md#tell-opal-who-each-person-is).
2. Opal looks for the person's ChatGPT agent. If they have none, it uses their OpenAI agent.
3. The call appears on that agent.

A call never lands on the person's Claude agent, even if they also use Claude.

If a person has two ChatGPT agents, or no ChatGPT agent and two OpenAI agents, Opal can't tell which one made the call. It doesn't guess, so Opal doesn't attach those calls to either agent.

### Where the agents come from

* **ChatGPT agents** come from your OpenAI connection's ChatGPT seat sync, which creates one agent for each person with a ChatGPT seat.
* **OpenAI agents** come from the **People** tab of your OpenAI connection's sync, which you run by hand.

Both are set up on the page [OpenAI and ChatGPT](https://docs.opal.dev/docs/openai-chatgpt-setup.md).

### From a Codex call

If a person has neither agent, a Codex call can create one. This happens only when your organization has it turned on. Ask Opal support about it.

* A ChatGPT sign-in creates `<Name>'s ChatGPT`.
* An API key creates `<Name>'s OpenAI`.

Opal creates the agent only for an active person, and makes that person its accountable sponsor. It doesn't create a new agent for a person whose agent an admin deleted. When Codex's sign-in is unknown, which happens with a kit too old to report it, Opal creates nothing.

If a later sync lists the same person, the person keeps one agent. The sync adopts the agent that the call created, together with its activity.

## What you see

Go to **Inventory** > **Agents** and open the person's agent. When Codex calls are attached to it, it has a **Codex activity** tab. An agent with no Codex calls has no activity tab. The tab lists each call with **When**, **Tool**, and **Target**, and has three scopes:

* **All** shows this agent's calls together with the unattributed ones.
* **This agent** shows only the calls attributed to it.
* **Unattributed** shows calls that no agent matched.

Admins and read-only admins can see this tab.

An agent that a Codex call created starts with these values:

| Field | Value |
| - | - |
| **Harness** | ChatGPT for a ChatGPT sign-in, OpenAI for an API key |
| **Tier** | Supervised |
| **Accountable sponsor** | The person |

Its **Source** column shows a dash until a sync adopts it, because the column names the connection an agent came from.

## What isn't covered

* **Computers that send nothing.** Calls reach the inventory only from computers where the hooks are installed. Codex cloud tasks run on OpenAI's servers, so they send nothing. See [What isn't covered](https://docs.opal.dev/docs/tool-call-governance-codex.md#what-isnt-covered).
* **Who made a call.** Opal takes the person from what the computer reports. It's a label, not proof.


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