By NHI Mgmt Group Editorial TeamBased on Token Security: “From a ChatGPT Slip to Full GitHub Access: The Attack Path No One Detects” (March 2, 2026)

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: Token Security shows that a leaked GitHub PAT in ChatGPT history could still authenticate, reveal access scope, and evade common audit paths even when no write action occurs.

Why it matters: IAM and NHI teams need to treat chat tools as secret-bearing surfaces, because token validity and access scope can outlive the moment of exposure and delay containment.


Context

GitHub personal access tokens are non-human identities in practice: they authenticate as the owner and inherit whatever access the owner already has. When one of those tokens is copied into a chat system, the security problem is no longer only exposure, but the gap between discovery, validation, and revocation.

This article focuses on that gap in a GitHub context. Token Security shows that a months-old token could still be live, reveal the authenticated user, and map repository permissions with minimal activity, while the expected audit trail failed to record the most important reconnaissance steps.


Key questions

Q: What breaks when a GitHub PAT is pasted into ChatGPT history?

A: The secret stops being a forgotten snippet and becomes a live credential that can still authenticate as its owner. If that owner has broad repository or organisation access, a single leaked PAT can expose a large blast radius long after the original paste. The failure is not only exposure, but delayed discovery of validity and scope.

Q: Why do audit logs miss some GitHub token reconnaissance activity?

A: Some audit paths do not record the user-level API calls that confirm token validity and enumerate repository access. That means teams can miss the first, low-noise steps of an intrusion even when they believe logging is enabled. The practical lesson is to validate exactly which GitHub events are captured, exported, and searchable.

Q: How can security teams tell whether a leaked PAT is still dangerous?

A: Start by confirming whether the token still works, then identify the user it authenticates as and the permissions that identity inherits. A PAT that remains valid is dangerous even if it has not yet been used maliciously, because reconnaissance can reveal its full reach in minutes. Validity and scope matter more than age alone.

Q: When should organisations prioritise revocation over investigation for exposed secrets?

A: When the leaked secret is still valid and tied to a user with meaningful repository or administrative access, revocation should move ahead of extended investigation. The longer the credential remains usable, the more time an attacker has to map access, clone code, or blend in. Fast containment is the decisive control.


Technical breakdown

How a leaked GitHub PAT becomes inherited access

A personal access token is not an independent privilege container. It is a credential that authenticates as a specific GitHub user and therefore inherits the user’s existing repository and organisation permissions. That means a token copied into ChatGPT history can remain operational long after the original conversation, even if the person who pasted it never intended it to be reused. The core technical risk is not just exposure, but that a single credential can instantly inherit administrative reach across multiple repositories and organisations if the owner already has broad access.

Practical implication: treat any exposed PAT as a live delegation problem, not as a static string to be searched for.

Why two harmless-looking API calls reveal the blast radius

The article’s two-call test used GET /user to confirm the token was valid and identify the authenticated user, then GET /user/repos to enumerate accessible repositories and permissions. Those calls are read-only, but together they produce a complete access picture: identity confirmation, repository visibility, and privilege scope. In incident terms, that is reconnaissance, not exploitation, which is why it can look low risk while still giving an attacker everything needed to plan later action. The issue is that effective access mapping can be done before any obvious destructive step occurs.

Practical implication: validate exposure as part of containment, because access discovery can precede any high-signal malicious activity.

Why GitHub audit logging can miss the most important signal

The visibility gap is structural. According to the article, the user-level API calls did not appear in the standard organisation audit log, and they also did not appear in GitHub Enterprise Cloud audit log streaming even with API Request Events enabled. GitHub only logs some private and internal repository activity, so user-level reconnaissance can slip past the telemetry many teams rely on for early detection. That means defenders may see no evidence of the first stage of compromise even when the token has already been exercised.

Practical implication: do not assume audit log coverage equals detection coverage for token misuse.


Threat narrative

Attacker objective: The attacker’s objective is to map effective GitHub access and prepare for repository theft or follow-on compromise without producing obvious telemetry.

  1. Entry occurred when a GitHub personal access token was pasted into ChatGPT history and remained available for months as a live credential.
  2. Credential access followed through read-only calls that confirmed the token still worked and disclosed which user and repositories it mapped to.
  3. Escalation came from using the inherited privileges of the token owner to understand admin reach across multiple organisations without changing any content.
  4. Impact would be repository reconnaissance and potential cloning of protected code and infrastructure without triggering the audit paths many teams monitor.
  • SpotBugs token leak 2025: A SpotBugs maintainer's PAT, stolen via a pull_request_target workflow in 2024, started the reviewdog and tj-actions supply chain attack.
  • Fake Dependabot commits 2023: Stolen GitHub tokens were used to push fake Dependabot commits to hundreds of repos, adding workflows that stole Actions secrets.

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 credential exposure surface, not just an information leakage surface. The article shows that a PAT pasted into ChatGPT history can remain live for months, which means chat tools now sit on the same secret-risk map as code, logs, and ticketing systems. The operational mistake is treating conversational systems as harmless storage for credentials. Practitioners need to govern them as part of the NHI secret estate.

Token validity is the first control question, not the last. The article’s two API calls demonstrate that discovery alone is not enough to understand risk. Security teams must know whether a leaked token is still usable, what identity it authenticates as, and what permissions that identity already has. That sequence defines the actual blast radius far better than mere secret presence.

Audit log completeness does not equal access visibility. GitHub’s inability to surface the relevant user-level calls in the expected audit paths exposes a governance assumption that security events will be observable when they matter. The gap is not just missing telemetry, but misplaced confidence in telemetry scope. Practitioners should assume that reconnaissance against identity endpoints can be silent unless they have explicitly validated what is and is not logged.

Ephemeral secret exposure window: The article illustrates a boundary problem where a token can be forgotten in an AI chat, remain valid for months, and still retain inherited access at the moment of discovery. That creates a persistence window that many secret management programmes do not model well. The implication is that secret governance must cover where credentials are pasted, not only where they are stored officially.

Access review does not substitute for immediate revocation capability. A PAT tied to a broad administrative user can be confirmed and mapped in seconds, while a traditional review cycle operates on a much slower cadence. This is a classic NHI control mismatch: the credential can outpace the governance process that is supposed to contain it. Practitioners should design for rapid verification and revocation, because review latency is itself exposure.

What this signals

Secret governance now has to include conversation systems. Teams that only scan code repositories and ticketing systems will miss a growing class of exposures where developers paste credentials into AI chats, collaboration tools, or internal assistants. The control objective is not just finding the string, but proving whether the credential still works and what it can reach.

Audit visibility must be tested against the attacker's first two moves. A mature programme should ask whether token validation calls, permission enumeration, and repo-cloning signals are actually retained, exported, and searchable. If not, the organisation may have a recovery process for a breach it cannot reliably observe.


For practitioners

  • Scan AI chat histories for secrets Add ChatGPT and other internal AI tools to secret discovery coverage, then treat pasted tokens as production credentials until proven otherwise.
  • Validate token activity before assuming compromise Check whether an exposed PAT is still valid, identify the authenticating user, and enumerate the permissions it inherits before deciding scope.
  • Expand audit expectations beyond the web UI Verify whether Git events, API Request Events, and source IP disclosure are enabled so that token use is searchable after the fact.
  • Reduce standing administrative reach Review who holds admin-level GitHub access across organisations and narrow those entitlements so a leaked PAT cannot inherit broad reach.
  • Shorten the revocation path for exposed PATs Build a clear handoff from secret discovery to owner confirmation and immediate token rotation so a forgotten credential does not remain usable for months.

Key takeaways

  • A GitHub PAT pasted into ChatGPT history can remain valid long enough to expose real production access, so chat tools must be treated as part of the secret estate.
  • The critical gap is not only secret detection but the speed with which teams can confirm validity, map inherited permissions, and revoke the credential.
  • Audit logging that misses user-level reconnaissance leaves defenders blind to the earliest and quietest stage of token abuse.

Standards & Framework Alignment

This section maps relevant standards and security frameworks to the operational risks and controls described in this guidance.

OWASP Non-Human Identity Top 10 and MITRE ATT&CK address the attack and risk surface, while NIST SP 800-53 Rev 5 and CSA Cloud Controls Matrix set the governance and control requirements practitioners need to meet.

FrameworkControl / ReferenceRelevance
OWASP Non-Human Identity Top 10NHI-02 — Secret LeakageThe article centers on a PAT exposed in ChatGPT history and later reused as a live credential.
NHI-05 — Overprivileged NHIThe leaked PAT inherited the owner’s broad admin reach across multiple organisations.
NHI-07 — Long-Lived SecretsThe credential remained valid for months inside an old ChatGPT conversation.
Recommendation — Scan AI chat surfaces for leaked secrets and revoke any exposed token before it is exercised. Reduce PAT scope and remove unnecessary administrative reach from GitHub users and service identities. Enforce short-lived credentials and rotate any PAT that can survive outside its intended window.
NIST SP 800-53 Rev 5IA-5 — Authenticator ManagementIA-5 directly applies to the lifecycle, rotation, and revocation of authentication secrets.
Recommendation — Apply authenticator management controls to rotate exposed PATs and invalidate stale GitHub credentials.
MITRE ATT&CKTA0006;TA0007 — Credential Access; DiscoveryThe attack path is credential validation and permission mapping before any overt abuse.
Recommendation — Map leaked PAT activity to credential access and discovery to prioritize early containment.
CSA Cloud Controls MatrixIAM — Identity and Access ManagementThe case depends on identity scope, access inheritance, and auditability in a cloud identity stack.
Recommendation — Use IAM governance to inventory high-reach GitHub identities and tighten inherited repository access.

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.
  • 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.
  • Privilege Inheritance: Privilege inheritance occurs when a system uses the permissions of the human or service identity that launched it. For agents, this means the workload can access anything the parent role can access, which makes entitlement design more important than the model’s natural-language capabilities.
  • Secrets Discovery: Secrets discovery is the process of finding credentials wherever they exist across code, infrastructure, pipelines, and collaboration tools. It turns unknown access paths into governable objects by identifying location, owner, and usage so teams can stop treating exposed secrets as hidden exceptions.

Deepen your knowledge

NHI governance, agentic AI identity, and machine identity lifecycle are core topics in our NHI Foundation Level course, the industry's only accredited NHI security programme. If you are responsible for identity security strategy or NHI governance in your organisation, it is worth exploring.
NHIMG Editorial Note
Published by the NHIMG editorial team on May 30, 2026.
Updated on October 6, 2026.
NHI Mgmt Group, the independent authority on Non-Human Identity, IAM, and Agentic AI security. nhimg.org