OpenAI ChatGPT Enterprise High Codex MCP Tool Diversity
Description
Detects a ChatGPT Enterprise Codex user invoking a high number of distinct MCP tools across multiple connectors within a 30-minute bucket. Broad tool and connector diversity in a short window can indicate compromised-account recon, unauthorized multi-system collection, or an agent rapidly enumerating organizational data sources.
Query · esql
from logs-openai_chatgpt_enterprise.codex_log-*
| where
data_stream.dataset == "openai_chatgpt_enterprise.codex_log" and
event.action == "app_mcp_call" and
user.email is not null and
organization.id is not null and
gen_ai.tool.name is not null
| eval Esql.time_bucket = date_trunc(30 minutes, @timestamp)
| stats
Esql.gen_ai_tool_name_count_distinct = count_distinct(gen_ai.tool.name),
Esql.connector_id_count_distinct = count_distinct(openai_chatgpt_enterprise.codex_log.event_details.tool_meta.connector_id),
Esql.event_count = count(*),
Esql.gen_ai_tool_name_values = values(gen_ai.tool.name),
Esql.connector_id_values = values(openai_chatgpt_enterprise.codex_log.event_details.tool_meta.connector_id),
Esql.timestamp_first_seen = min(@timestamp),
Esql.timestamp_last_seen = max(@timestamp)
by
user.email,
organization.id,
Esql.time_bucket
| where
Esql.gen_ai_tool_name_count_distinct >= 10 and
Esql.connector_id_count_distinct >= 3
| keep
user.email,
organization.id,
Esql.time_bucket,
Esql.gen_ai_tool_name_count_distinct,
Esql.connector_id_count_distinct,
Esql.event_count,
Esql.gen_ai_tool_name_values,
Esql.connector_id_values,
Esql.timestamp_first_seen,
Esql.timestamp_last_seen
Investigation fields
Pivot points the source recommends for triage.
user.emailorganization.idEsql.time_bucketEsql.gen_ai_tool_name_count_distinctEsql.connector_id_count_distinctEsql.event_countEsql.gen_ai_tool_name_valuesEsql.connector_id_valuesEsql.timestamp_first_seenEsql.timestamp_last_seen
Implementation guide
This rule requires the OpenAI ChatGPT Enterprise integration to collect Codex compliance logs into Elasticsearch,
including app_mcp_call events. Tune the distinct-tool and distinct-connector thresholds above your normal Codex
baseline before broad enablement.
https://www.elastic.co/docs/reference/integrations/openai_chatgpt_enterprise
Known false positives
- Power users and legitimate multi-connector Codex workflows (for example Slack + GitHub + Google Drive in one session) can approach these thresholds. Raise `Esql.gen_ai_tool_name_count_distinct` or `Esql.connector_id_count_distinct` above your baseline before broad enablement.
Analyst notes
Investigating OpenAI ChatGPT Enterprise High Codex MCP Tool Diversity
One user invoked many distinct Codex MCP tools across multiple connectors in a 30-minute bucket. That pattern can indicate compromised-account reconnaissance, unauthorized multi-system collection, or an agent rapidly enumerating connected data sources.
Escalate when the tool set spans unexpected connectors, the actor is unusual for those systems, or nearby events show credential exposure, access-token creation, or bulk downloads. Close as a false positive for known power-user or approved automation baselines.
Possible investigation steps
- Review
Esql.gen_ai_tool_name_values,Esql.connector_id_values,Esql.event_count, and the time bucket. - Confirm whether the connectors are approved for that user and whether the session aligns with a known project.
- Pivot to nearby
app_mcp_result, prompt, share, and download events for the sameuser.email. - Compare against the user's normal Codex MCP diversity over prior days.
False positive analysis
- Engineers using several approved connectors in one Codex session commonly produce multi-tool bursts.
- Raise the distinct-tool or distinct-connector thresholds above your normal 30-minute Codex baseline if approved power users remain noisy.
Response and remediation
- Disable unauthorized connectors, revoke related OAuth links or Codex access tokens, and review data returned into the session.
- If account compromise is suspected, reset sessions and hunt for follow-on exfiltration.