OpenAI ChatGPT Enterprise Codex Access Token Created
Description
Detects ChatGPT Enterprise Codex events that create an access token. Codex access tokens enable automated CLI or
environment access and can be abused for persistence or lateral automation after account compromise. Treat tokens with
a missing expires_at as higher priority during triage.
Query · esql
from logs-openai_chatgpt_enterprise.codex_log-* metadata _id, _version, _index
| where
data_stream.dataset == "openai_chatgpt_enterprise.codex_log" and
event.action == "access_token_created"
| keep
_id, _version, _index, @timestamp, event.action, user.id, user.email,
openai_chatgpt_enterprise.codex_log.client_id,
openai_chatgpt_enterprise.codex_log.event_details.access_token_id,
openai_chatgpt_enterprise.codex_log.event_details.access_token_name,
openai_chatgpt_enterprise.codex_log.event_details.created_by_user_id,
openai_chatgpt_enterprise.codex_log.event_details.expires_at,
data_stream.*
Investigation fields
Pivot points the source recommends for triage.
@timestampuser.iduser.emailopenai_chatgpt_enterprise.codex_log.event_details.access_token_nameopenai_chatgpt_enterprise.codex_log.event_details.access_token_idopenai_chatgpt_enterprise.codex_log.client_id
Implementation guide
This rule requires the OpenAI ChatGPT Enterprise integration to collect compliance logs into Elasticsearch.
https://www.elastic.co/docs/reference/integrations/openai_chatgpt_enterprise
Known false positives
- Developers create Codex tokens for CI runners and local environments.
Analyst notes
Investigating OpenAI ChatGPT Enterprise Codex Access Token Created
A Codex access token was created. These tokens enable automated CLI or environment access and can be abused for persistence or automation after account compromise.
Escalate when the token owner or purpose is unclear, the creator is unexpected, or tool and MCP activity follows immediately. Close as a false positive for documented CI or local development token creation.
Possible investigation steps
- Identify the creator (
user.email/user.id) and token-related fields on the alert. - Confirm the intended automation use and whether a ticket or runbook covers the token.
- Review subsequent Codex tool calls, MCP activity, or security-scan changes from the same user or client.
- Inventory other active Codex tokens for the same user.
False positive analysis
- Developers create Codex tokens for CI runners and local development environments as part of normal workflows.
Response and remediation
- Revoke unauthorized tokens and review subsequent Codex tool and MCP activity.
- Rotate related credentials if the token may have been exposed.