By NHI Mgmt Group Editorial TeamPublished 2026-03-02Domain: Governance & RiskSource: Token Security

TL;DR: A GitHub personal access token left in ChatGPT history remained valid for months and, with two read-only API calls, exposed admin reach across multiple organisations without showing up in the audit paths many teams trust, according to Token Security. The real control problem is not just secret detection but how quickly teams can confirm validity, scope access, and revoke before quiet reconnaissance turns into repo theft.


At a glance

What this is: A forgotten GitHub PAT in ChatGPT history stayed valid for months and could expose cross-organisation admin access through low-noise reconnaissance.

Why it matters: IAM and NHI teams need to treat AI chat history as a secret exposure surface because valid tokens can reveal effective access faster than many logging controls can detect.

👉 Read Token Security's analysis of the ChatGPT-pasted GitHub PAT attack path


Context

A GitHub personal access token is a non-human identity credential, not just a string in a chat thread. When it appears in an AI conversation history, the risk is that the token may remain valid long after the human forgets it, while the surrounding access model still reflects the owner's broader permissions. For NHI governance, that creates an exposure path that sits outside conventional code-scanning assumptions.

The article's scenario is a familiar one for teams with broad developer access and limited secret hygiene across collaboration tools. The important point is not that a token existed, but that it could be validated and mapped with minimal interaction, while audit visibility lagged behind. That is atypical only if an organisation already scans AI chat systems and can revoke credentials quickly enough to matter.


Key questions

Q: How should teams respond when a GitHub personal access token is exposed in an AI chat history?

A: Treat the token as live until proven otherwise. Identify the owner, validate whether it still works, map the repositories it can reach, and revoke or rotate it immediately. Then search the chat system for related secrets and review whether the same identity has overbroad access that would make the next leak equally dangerous.

Q: Why are GitHub audit logs not enough to detect PAT misuse?

A: Because audit coverage can miss user-level API calls and may not show the reconnaissance steps an attacker uses first. If GET /user and GET /user/repos are invisible, you can lose the earliest warning signs. Logs are only useful when they capture the exact request classes that reveal identity and access scope.

Q: What is the difference between a leaked PAT and a leaked password?

A: A leaked PAT is a reusable credential tied to an identity and its permissions, so it can immediately expose repository access and other entitlements. A password may protect a login path, but a PAT often bypasses interactive checks and maps directly to API and git operations. The response should therefore focus on revocation and blast radius, not just account reset.

Q: How can organisations reduce the risk of secrets in ChatGPT and other AI tools?

A: Extend secret scanning beyond code and tickets into AI chat systems, logs, and collaboration tools. Then pair discovery with fast ownership mapping, automated revocation, and access reviews for users who can reach sensitive repositories. If a secret can enter an AI tool, that tool is part of your NHI governance boundary.


Technical breakdown

Why a leaked GitHub PAT behaves like an identity, not a file

A classic GitHub personal access token authenticates as the user who owns it, so the token inherits the user's effective permissions across repositories and organisations. That makes it an NHI credential with real operational reach, not a passive artifact. Once an attacker has the token string, they can confirm validity, determine the authenticated identity, and enumerate accessible repositories with read, write, or admin permissions. In practice, the attack surface is defined by the owner's privilege footprint, not by where the token was found.

Practical implication: Treat every exposed PAT as a potentially live identity and map its blast radius before deciding on containment steps.

Why low-noise reconnaissance can evade standard audit expectations

The first attacker moves are often user-level API calls because they are cheap, fast, and low risk. In this case, GET /user and GET /user/repos reveal identity and access scope without modifying anything, which means defenders may see no obvious security event. GitHub audit coverage is uneven across endpoints, and that matters because visibility gaps are most dangerous when the attacker is still only enumerating access. If the platform does not log the request class you care about, your detection logic starts behind the attacker.

Practical implication: Validate which API calls are actually logged before relying on audit logs as a detection control.

Why source IP disclosure changes the defensive value of git.clone events

A git.clone event is more useful when it includes source IP, because the same clone from a corporate range and a remote residential address mean very different things. Without IP disclosure, defenders are left with weaker behavioural signals such as user agent, timing, and volume, all of which are easier to imitate. With IPs enabled, the platform can surface anomalous access patterns that are harder to blend into normal developer activity. That does not stop abuse, but it raises the cost of stealth.

Practical implication: Enable source IP disclosure and route audit events into a searchable system before you need them for triage.


Threat narrative

Attacker objective: The attacker wants to map effective repository access and clone sensitive code before defenders notice the token has been used.

  1. Entry via a GitHub classic PAT accidentally pasted into ChatGPT conversation history and left valid for months.
  2. Escalation through two read-only API calls, GET /user and GET /user/repos, to identify the authenticated account and its repository permissions.
  3. Impact through silent reconnaissance that could support repo cloning and production-code exposure without generating the audit signals many teams expect.

Read our 52 NHI Breaches Analysis report for a comprehensive view of breaches impacting Non-Human Identities including AI Agents.


NHI Mgmt Group analysis

Chat history is now a secret exposure surface, not just a collaboration artifact. AI conversations retain pasted credentials long after the moment of mistake, which means the lifecycle of a secret now extends into tooling many security teams do not monitor. That makes discovery, validation, and revocation a single governance problem instead of three separate ones. Practitioners should treat chat platforms as first-class NHI exposure points.

Identity blast radius is the right concept for leaked PATs. A token does not create privilege on its own, it inherits the human owner's entitlements across organisations, repositories, and environments. That means the security question is not whether a token leaked, but how far the owner's access extends and whether that access was ever appropriate for a reusable credential. Teams should measure blast radius before they measure token count.

Audit coverage without endpoint coverage creates false confidence. If user-level API calls are invisible and clone events are only partly captured, defenders may believe they have monitoring when they really have partial telemetry. The result is a detection model that sees loud writes but misses quiet validation and enumeration. Practitioners should test the log path against attacker workflows, not against documentation summaries.

Source IP disclosure is a control multiplier, not a nice-to-have setting. Location and network context make a clone event materially more useful for investigation, especially when the actor can otherwise hide behind a legitimate user agent and normal working hours. This does not solve credential misuse, but it gives defenders a stronger discriminator between routine developer activity and abnormal access. Teams should enable it wherever the platform supports it.

Secret rotation speed has become the decisive variable in AI-era exposure. When a credential can be used from a chat thread, a log, or an internal tool, the window to contain misuse can shrink to minutes. Detection remains necessary, but response speed now determines whether exposure becomes an incident or a near miss. Practitioners should build around rapid revocation, not retrospective cleanup.

From our research:

  • 64% of valid secrets leaked in 2022 are still valid and exploitable today, according to The State of Secrets Sprawl 2026.
  • AI-related credential leaks surged 81.5% year-over-year in 2025, with the surrounding AI infrastructure leaking 5x faster than core LLM providers.
  • That pattern reinforces the need to combine 52 NHI Breaches Analysis with rapid revocation workflows, because exposure without response becomes lasting access.

What this signals

Identity blast radius: teams should start measuring how far a single developer-owned credential can reach across organisations, repositories, and automation. The governance issue is not the existence of PATs alone, but the mismatch between reusable credentials and broad human entitlements. That is where NHI controls should focus first.

With 24,008 unique secrets exposed in MCP configuration files in 2025 alone, the larger pattern is clear: new AI-adjacent surfaces are producing credential exposure faster than many programmes can adapt. For practitioners, the next control gap will come from whichever collaboration or agentic workflow is least likely to be monitored today.

The practical response is to connect secret discovery, audit export, and revocation into one operating loop. When a credential can surface in chat, code, or tool output, the organisation needs a single path from detection to ownership to invalidation. That is the only way to keep a quiet leak from becoming a quiet breach.


For practitioners

  • Scan AI chat histories for credentials Include ChatGPT, internal copilots, and other conversational systems in secret discovery because pasted PATs can remain valid long after the original context is forgotten.
  • Confirm which GitHub API calls are logged Test whether GET /user, GET /user/repos, and other user-level endpoints appear in your audit pipeline before relying on them for detection.
  • Enable source IP disclosure in audit logs Turn on source IP disclosure so clone and access events carry network context that improves anomaly detection and incident triage.
  • Map PAT ownership to effective privilege Inventory which users own classic PATs, then compare each owner's access to production repositories, internal tooling, and cross-organisation reach.
  • Rotate exposed tokens immediately Use a rapid revocation workflow that starts with identity confirmation and ends with credential replacement before the token can be reused.

Key takeaways

  • AI chat history is now part of the secrets attack surface, because a valid token can remain useful long after the conversation that exposed it.
  • Audit logs may miss the reconnaissance steps that matter most, so coverage must be tested against attacker workflows rather than assumed from platform documentation.
  • The right control objective is rapid containment of identity blast radius, not just finding where the token first appeared.

Key terms

  • Personal Access Token (PAT): A personal access token is a reusable credential that authenticates a user or service to an API without a password. In practice, it inherits the permissions of the owning identity, which makes it a high-value non-human identity when it is exposed, copied, or left valid after the original task is complete.
  • Identity Blast Radius: Identity blast radius is the total scope of systems, data, and repositories that a compromised credential can reach. For non-human identities, it is the operational measure that matters most because one token can expose access across multiple environments even when the original leak looks minor.
  • Audit Log Coverage Gap: An audit log coverage gap exists when a platform records some actions but omits the reconnaissance or validation steps that attackers use first. For NHI governance, the gap is dangerous because defenders may miss the moment a leaked credential is confirmed and mapped, even though no visible change has occurred yet.
  • Secret Exposure Surface: The secret exposure surface is the full set of places where credentials can be accidentally revealed, stored, or replayed outside intended controls. It includes code, logs, tickets, AI conversations, and collaboration tools, and it expands as organisations add more workflow systems without equal secret governance.

👉 Token Security's full post covers the audit-log gaps, API calls, and remediation sequence in detail.

Deepen your knowledge

Chat history secret exposure and rapid NHI revocation are core topics in our NHI Foundation Level course, the industry's only accredited NHI security programme. If your team is trying to turn secret discovery into a governed response process, it is worth exploring.
NHIMG Editorial Note
Published by the NHIMG editorial team on 2026-03-02.
NHI Mgmt Group — the independent authority on Non-Human Identity, IAM, and Agentic AI security. nhimg.org