OpenAI ChatGPT Enterprise Conversation Message Containing Credentials


Description

Detects ChatGPT Enterprise conversation messages whose text matches known credential patterns (cloud keys, GitHub tokens, private keys, Slack/SendGrid tokens, Stripe/OpenAI/Anthropic keys, Vault/Docker tokens, JWTs, or Azure storage keys). Secrets pasted into chats can be retained in compliance logs and model context.

Query · esql

from logs-openai_chatgpt_enterprise.conversation_message-* metadata _id, _version, _index
| eval Esql.message_text = coalesce(message, "")
| where
    data_stream.dataset == "openai_chatgpt_enterprise.conversation_message" and
    Esql.message_text is not null and
    Esql.message_text != "" and
    not Esql.message_text like "*AKIAIOSFODNN7EXAMPLE*" and
    not Esql.message_text like "*ASIAIOSFODNN7EXAMPLE*" and
    not Esql.message_text like "*ghp_example*" and
    not Esql.message_text like "*sk-ant-api03-test*" and
    (
        Esql.message_text rlike """.*(AKIA|ASIA)[A-Z0-9]{16}.*""" or
        Esql.message_text rlike """.*gh[pousr]_[A-Za-z0-9]{36}.*""" or
        Esql.message_text rlike """.*github_pat_[A-Za-z0-9_]+.*""" or
        Esql.message_text rlike """.*-----BEGIN [A-Z ]*PRIVATE KEY-----.*""" or
        Esql.message_text rlike """.*xox[baprs]-[0-9]+-[0-9]+-[A-Za-z0-9]+.*""" or
        Esql.message_text rlike """.*sk_live_[A-Za-z0-9]+.*""" or
        Esql.message_text rlike """.*AIza[-A-Za-z0-9_]+.*""" or
        Esql.message_text rlike """.*npm_[A-Za-z0-9]{36}.*""" or
        Esql.message_text rlike """.*sk-ant-[A-Za-z0-9-]+.*""" or
        Esql.message_text rlike """.*sk-[A-Za-z0-9]{20,}.*""" or
        Esql.message_text rlike """.*hvs[.][A-Za-z0-9]+.*""" or
        Esql.message_text rlike """.*dckr_pat_[-A-Za-z0-9_]+.*""" or
        Esql.message_text rlike """.*SG[.][-A-Za-z0-9_]+[.][-A-Za-z0-9_]+.*""" or
        Esql.message_text rlike """.*(AccountKey=|SharedAccessKey=)[-A-Za-z0-9+/=]+.*""" or
        Esql.message_text rlike """.*eyJ[-A-Za-z0-9_]+[.]eyJ[-A-Za-z0-9_]+[.][-A-Za-z0-9_]+.*"""
    )
| keep
    _id, _version, _index, @timestamp, message, user.id, user.email,
    openai_chatgpt_enterprise.conversation_message.conversation.id,
    openai_chatgpt_enterprise.conversation_message.conversation.title,
    openai_chatgpt_enterprise.conversation_message.message.author.type,
    openai_chatgpt_enterprise.conversation_message.message.id,
    data_stream.*

Investigation fields

Pivot points the source recommends for triage.

  • @timestamp
  • user.id
  • user.email
  • message
  • openai_chatgpt_enterprise.conversation_message.conversation.id
  • openai_chatgpt_enterprise.conversation_message.conversation.title

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

  • Documentation samples and example keys can match token patterns. Confirm the value is live before rotating it.
  • Approved prompt-security or DLP validation tests may intentionally submit synthetic secrets.

Analyst notes

Investigating OpenAI ChatGPT Enterprise Conversation Message Containing Credentials

A conversation message matched a known credential pattern. Secrets pasted into ChatGPT can be retained in compliance logs and model context, and may later appear in shares or exports.

Escalate when the value appears live, when the conversation is shared externally, or when downloads follow the message. Close as a false positive for clearly synthetic or documentation examples.

Possible investigation steps

  • Read message on the alert and decide whether the match is a live secret, an example key, or incidental text.
  • Identify the user and conversation (openai_chatgpt_enterprise.conversation_message.conversation.id / title).
  • Look for nearby conversation shares, file downloads, or Codex activity from the same user.
  • Check whether the conversation was shared outside the intended audience after the message time.

False positive analysis

  • Documentation samples and intentional prompt-security tests can match token patterns. Confirm the value is live before rotating it.

Response and remediation

  • If the credential is live, rotate or revoke it and remove residual copies from shared conversations where possible.
  • Review subsequent shares and downloads for the same conversation.
  • Limit access to alerts and compliance logs that retain message text.
Raw source OpenAI ChatGPT Enterprise Conversation Message Containing Credentials · Elastic TOML
Esc
Published by elastic/detection-rules ↗, licensed under Elastic License 2.0 ↗. Reproduced here unmodified.
[metadata]
creation_date = "2026/10/06"
integration = ["openai_chatgpt_enterprise"]
maturity = "production"
updated_date = "2026/10/16"

[rule]
author = ["Elastic"]
description = """
Detects ChatGPT Enterprise conversation messages whose text matches known credential patterns (cloud keys, GitHub
tokens, private keys, Slack/SendGrid tokens, Stripe/OpenAI/Anthropic keys, Vault/Docker tokens, JWTs, or Azure storage
keys). Secrets pasted into chats can be retained in compliance logs and model context.
"""
false_positives = [
    "Documentation samples and example keys can match token patterns. Confirm the value is live before rotating it.",
    "Approved prompt-security or DLP validation tests may intentionally submit synthetic secrets.",
]
from = "now-9m"
language = "esql"
license = "Elastic License v2"
name = "OpenAI ChatGPT Enterprise Conversation Message Containing Credentials"
note = """## Triage and analysis

### Investigating OpenAI ChatGPT Enterprise Conversation Message Containing Credentials

A conversation message matched a known credential pattern. Secrets pasted into ChatGPT can be retained in compliance logs and model context, and may later appear in shares or exports.

Escalate when the value appears live, when the conversation is shared externally, or when downloads follow the message. Close as a false positive for clearly synthetic or documentation examples.

#### Possible investigation steps

- Read `message` on the alert and decide whether the match is a live secret, an example key, or incidental text.
- Identify the user and conversation (`openai_chatgpt_enterprise.conversation_message.conversation.id` / title).
- Look for nearby conversation shares, file downloads, or Codex activity from the same user.
- Check whether the conversation was shared outside the intended audience after the message time.

### False positive analysis

- Documentation samples and intentional prompt-security tests can match token patterns. Confirm the value is live before rotating it.

### Response and remediation

- If the credential is live, rotate or revoke it and remove residual copies from shared conversations where possible.
- Review subsequent shares and downloads for the same conversation.
- Limit access to alerts and compliance logs that retain message text.
"""
references = [
    "https://www.elastic.co/docs/reference/integrations/openai_chatgpt_enterprise",
    "https://platform.openai.com/docs/compliance",
]
risk_score = 73
rule_id = "231c2ade-69c8-4415-b710-0c56f5f07e95"
setup = """## Setup

This rule requires the OpenAI ChatGPT Enterprise integration to collect compliance logs into Elasticsearch.

https://www.elastic.co/docs/reference/integrations/openai_chatgpt_enterprise
"""
severity = "high"
tags = [
    "Domain: GenAI",
    "Platform: OpenAI",
    "Data Source: OpenAI ChatGPT Enterprise",
    "Service: OpenAI ChatGPT Enterprise",
    "Use Case: Threat Detection",
    "Resources: Investigation Guide",
    "Rule Type: ES|QL",
    "Tactic: Credential Access",
    "Mitre Atlas: AML.T0055",
    "Mitre Atlas: AML.T0057",
]
timestamp_override = "event.ingested"
type = "esql"

query = '''
from logs-openai_chatgpt_enterprise.conversation_message-* metadata _id, _version, _index
| eval Esql.message_text = coalesce(message, "")
| where
    data_stream.dataset == "openai_chatgpt_enterprise.conversation_message" and
    Esql.message_text is not null and
    Esql.message_text != "" and
    not Esql.message_text like "*AKIAIOSFODNN7EXAMPLE*" and
    not Esql.message_text like "*ASIAIOSFODNN7EXAMPLE*" and
    not Esql.message_text like "*ghp_example*" and
    not Esql.message_text like "*sk-ant-api03-test*" and
    (
        Esql.message_text rlike """.*(AKIA|ASIA)[A-Z0-9]{16}.*""" or
        Esql.message_text rlike """.*gh[pousr]_[A-Za-z0-9]{36}.*""" or
        Esql.message_text rlike """.*github_pat_[A-Za-z0-9_]+.*""" or
        Esql.message_text rlike """.*-----BEGIN [A-Z ]*PRIVATE KEY-----.*""" or
        Esql.message_text rlike """.*xox[baprs]-[0-9]+-[0-9]+-[A-Za-z0-9]+.*""" or
        Esql.message_text rlike """.*sk_live_[A-Za-z0-9]+.*""" or
        Esql.message_text rlike """.*AIza[-A-Za-z0-9_]+.*""" or
        Esql.message_text rlike """.*npm_[A-Za-z0-9]{36}.*""" or
        Esql.message_text rlike """.*sk-ant-[A-Za-z0-9-]+.*""" or
        Esql.message_text rlike """.*sk-[A-Za-z0-9]{20,}.*""" or
        Esql.message_text rlike """.*hvs[.][A-Za-z0-9]+.*""" or
        Esql.message_text rlike """.*dckr_pat_[-A-Za-z0-9_]+.*""" or
        Esql.message_text rlike """.*SG[.][-A-Za-z0-9_]+[.][-A-Za-z0-9_]+.*""" or
        Esql.message_text rlike """.*(AccountKey=|SharedAccessKey=)[-A-Za-z0-9+/=]+.*""" or
        Esql.message_text rlike """.*eyJ[-A-Za-z0-9_]+[.]eyJ[-A-Za-z0-9_]+[.][-A-Za-z0-9_]+.*"""
    )
| keep
    _id, _version, _index, @timestamp, message, user.id, user.email,
    openai_chatgpt_enterprise.conversation_message.conversation.id,
    openai_chatgpt_enterprise.conversation_message.conversation.title,
    openai_chatgpt_enterprise.conversation_message.message.author.type,
    openai_chatgpt_enterprise.conversation_message.message.id,
    data_stream.*
'''


[[rule.threat]]
framework = "MITRE ATT&CK"
[[rule.threat.technique]]
id = "T1552"
name = "Unsecured Credentials"
reference = "https://attack.mitre.org/techniques/T1552/"


[rule.threat.tactic]
id = "TA0006"
name = "Credential Access"
reference = "https://attack.mitre.org/tactics/TA0006/"
[[rule.threat_mappings]]
framework = "MITRE ATLAS"
version = "2026.08"
[[rule.threat_mappings.threat]]
framework = "MITRE ATLAS"
[[rule.threat_mappings.threat.technique]]
id = "AML.T0057"
name = "LLM Data Leakage"
reference = "https://atlas.mitre.org/techniques/AML.T0057/"


[rule.threat_mappings.threat.tactic]
id = "AML.TA0010"
name = "Exfiltration"
reference = "https://atlas.mitre.org/tactics/AML.TA0010/"
[[rule.threat_mappings.threat]]
framework = "MITRE ATLAS"
[[rule.threat_mappings.threat.technique]]
id = "AML.T0055"
name = "Unsecured Credentials"
reference = "https://atlas.mitre.org/techniques/AML.T0055/"


[rule.threat_mappings.threat.tactic]
id = "AML.TA0013"
name = "Credential Access"
reference = "https://atlas.mitre.org/tactics/AML.TA0013/"

[rule.investigation_fields]
field_names = [
    "@timestamp",
    "user.id",
    "user.email",
    "message",
    "openai_chatgpt_enterprise.conversation_message.conversation.id",
    "openai_chatgpt_enterprise.conversation_message.conversation.title",
]

Detection rules belong to the projects that publish them and remain under their own licenses. This site indexes and links to them; it claims no rights in them.