By NHI Mgmt Group Editorial TeamBased on Unosecur: “You Cannot Govern What You Don't See: A Study on the GitLost Incident” (July 20, 2026)

TL;DR: Unosecur says GitLost showed that prompt injection can expose private repository content when an AI agent has cross-repository read access, and that 79% of organisations lack visibility into what their AI agents are doing, according to Microsoft Cyber Pulse data cited by Unosecur. The failure is not the prompt alone but the over-privileged identity behind it, which makes guardrails insufficient on their own.


At a glance

What this is: GitLost illustrates how a malicious issue comment can steer an AI agent into exposing private repository content when identity controls and privilege scoping are too weak.

Why it matters: IAM and NHI teams need to treat agent access as governed identity, because prompt-level safeguards do not stop over-privileged autonomous workflows from disclosing data.

👉 Read Unosecur's analysis of the GitLost incident and AI agent identity failure


Context

GitLost is a prompt-injection case study, but the governance failure sits in access design rather than language handling. An AI agent that can read issues, trigger tools, and reach across repositories is already acting inside a trust boundary that needs identity controls, not just guardrails.

For IAM and NHI programmes, the core question is whether an agent is scoped to a task or merely trusted because it is embedded in a workflow. Once a non-human identity can inspect private content it was never intended to touch, the control problem becomes one of privilege, ownership, and visibility.


Key questions

Q: What breaks when an AI agent has more repository access than its task requires?

A: The access model breaks because the agent can be steered into retrieving or disclosing data outside the intended workflow. In practice, the problem is not the prompt alone but the mismatch between privilege and purpose. When cross-repository access exists, a benign-looking request can become a data exposure path.

Q: Why do prompt guardrails fail when AI agents have broad identity permissions?

A: Prompt guardrails only shape the model's response, not the underlying access rights the agent already has. If the identity behind the agent can read private repositories, files, or tools, then a successful prompt injection can still trigger disclosure. The control boundary has to be the permission model, not the conversation text.

Q: What are the signs that shadow agents are outside IAM governance?

A: The clearest signs are missing owners, incomplete inventory, unclear access scope, and workflows that can act across systems without approval records. If a team cannot name who owns the agent or what it is allowed to reach, the identity is already operating outside governance.

Q: How should security teams govern workforce and customer AI agents differently?

A: Treat workforce agents as internal automation with blast-radius risk and customer agents as externally exposed, tenant-isolated actors. The former needs tight scoping across internal systems, while the latter needs delegated identity, tenant binding, and stronger isolation around each request. One IAM pattern rarely fits both without creating blind spots.


Technical breakdown

How indirect prompt injection steers agent execution

Indirect prompt injection works when malicious instructions are embedded in content the agent treats as normal input, such as an issue comment or readme text. The model then follows the hidden instruction path rather than the business intent of the workflow. In GitLost, the attacker did not need code execution or stolen credentials. They relied on the agent's tendency to interpret natural language as an actionable instruction, which turns ordinary content channels into control channels when the workflow has broad reach.

Practical implication: treat agent-facing content as an execution surface, not just untrusted text.

Why cross-repository read access becomes a governance problem

The decisive failure was not that the prompt was persuasive, but that the agent had cross-repository read access to private material outside the task boundary. That is an identity and authorization issue. When an AI agent can move from a public issue to private repository data, the problem is over-scoped privilege, not model misunderstanding. In NHI terms, the agent's permissions were broader than the work it was assigned, so the workflow carried an unnecessary disclosure path.

Practical implication: scope every agent to the minimum repository and object set required for the task.

What shadow agents change in identity architecture

Shadow agents are AI agents operating without approved ownership, inventory, or governance. That breaks the basic assumption that every identity can be named, reviewed, and tied to a control owner. Once agents can appear inside internal workflows without formal registration, recertification and access review lose coverage because the organisation cannot reliably enumerate what exists. The result is not just blind spots in monitoring. It is a structural gap between identity inventory and the actual runtime estate.

Practical implication: maintain a live inventory of AI agents with owner, scope, and access lineage.


Threat narrative

Attacker objective: The attacker aimed to exfiltrate restricted private repository content by abusing the agent's legitimate access path.

  1. Entry began with a benign-looking public GitHub issue that carried hidden instructions in plain English.
  2. The agent processed the injected request and used its legitimate cross-repository read access to fetch private content.
  3. The private readme was posted back into the public issue, turning authorised access into public disclosure.

Read and download The State of NHI & AI Agent Breach Report 2026, covering 150+ breaches impacting Non-Human Identities including AI Agents.


NHI Mgmt Group analysis

Prompt injection is the trigger, but over-privileged agent identity is the failure mode. GitLost only worked because the AI agent had access to private repositories that were outside the task it was performing. That is an NHI governance problem, not a prompt-engineering problem. The practitioner takeaway is that any workflow allowing an agent to cross trust boundaries without explicit identity scoping is already failing at design time.

Shadow agents break the assumption that every runtime identity is known, owned, and reviewable. The article's visibility figures point to a control environment that cannot reliably enumerate what is running, who owns it, or what it can reach. That makes recertification and access review incomplete before they start. In practice, governance fails when the inventory is weaker than the runtime estate, and this is precisely the condition shadow agents create.

Identity controls must sit at the point of issuance, not at the point of interpretation. Prompt guardrails can influence model behaviour, but they do not constrain what data the agent can retrieve if the underlying access model is too broad. For NHI governance, the control that matters is the access boundary attached to the agent identity. The practitioner conclusion is to govern what the agent can touch, not merely what it can be told.

Scoped access for autonomous workflows should be treated as a zero-trust identity design problem. GitLost shows that public and private context can collapse into the same execution path when an agent is allowed to traverse both. That means RBAC and ABAC for agents are not optional embellishments. They are the only practical way to prevent a low-friction conversation from becoming a high-impact disclosure channel.

What this signals

GitLost is a useful warning for programmes that still treat AI agents as tooling rather than identities. Once an agent can move from public input to private data access, governance has to start with inventory, ownership, and scoped permissions rather than post-hoc review.

Agent identity drift: when an agent's permissions outgrow the task it was meant to perform, the organisation loses the ability to distinguish workflow automation from uncontrolled access. That is why visibility into ownership and effective scope matters as much as detection.


For practitioners

  • Inventory every AI agent and shadow workflow Create a current register of agents, owners, permitted repositories, and the tools each agent can invoke. Remove any workflow that cannot be tied to a named owner and an approved business purpose.
  • Restrict cross-repository read paths Limit each agent to the smallest repository set required for its task and deny private repository reads unless the workflow explicitly requires them. Review repo-to-repo permissions as a separate control plane for NHI governance.
  • Bind access to task scope Issue permissions for a specific task, not for the agent in general, so a public-facing workflow cannot reuse credentials that reach private infrastructure. Recheck whether the access path still makes sense after the task completes.
  • Add ownership and recertification to agent governance Require periodic review of agent ownership, scope, and effective permissions, with remediation when no human owner can be named. Treat unnamed or unapproved agents as unmanaged identities, not harmless automation.

Key takeaways

  • GitLost shows that prompt injection becomes a governance failure when an AI agent can reach private data it was never meant to access.
  • The incident demonstrates how shadow agents and unclear ownership create an identity gap that traditional review cycles do not reliably catch.
  • Task-scoped access, live agent inventory, and named ownership are the controls that reduce the disclosure path exposed by over-privileged agents.

Standards & Framework Alignment

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

OWASP Agentic AI Top 10, OWASP Non-Human Identity Top 10 and MITRE ATT&CK define the specific risk controls and attack patterns relevant to this term.

FrameworkControl / ReferenceRelevance
OWASP Agentic AI Top 10ASI03 — Identity & Privilege AbuseThe article centres on an AI agent misused through excessive access and identity scope.
ASI09 — Human-Agent Trust ExploitationIndirect prompt injection exploits the agent's trust in ordinary language inputs.
Recommendation — Constrain agent privileges to the minimum task scope and review identity boundaries for abuse paths. Treat user-authored content as potentially malicious input and validate agent actions against policy.
OWASP Non-Human Identity Top 10NHI-05 — Overprivileged NHIThe GitLost incident succeeded because the agent had broader repository access than the workflow required.
NHI-10 — Human Use of NHIShadow agents blur ownership and oversight, leaving human operators unable to govern agent behaviour.
Recommendation — Reduce agent access to the exact repositories and objects needed for each task. Assign a named human owner to every agent and remove unowned identities from production.
MITRE ATT&CKTA0006;TA0010 — Credential Access; ExfiltrationThe attack path relies on gaining access to data and disclosing it through a legitimate agent channel.
Recommendation — Map agent data exposure paths to credential access and exfiltration techniques in detections and hunting.

Key terms

  • Shadow Agent: An AI agent deployed without formal registration, identity governance, or security oversight, the agentic equivalent of shadow IT. Shadow agents are more dangerous than typical shadow NHIs because they actively take actions using their credentials.
  • Indirect Prompt Injection: Indirect prompt injection is an attack where malicious instructions are hidden inside content that an AI system reads later. The model may treat that content as context rather than as hostile input, which can influence tool use, data access, or workflow actions if controls are weak.
  • Task-Scoped Access: Task-scoped access is permission granted for one defined purpose and removed once the task is complete or the session expires. For non-human identities, it reduces standing privilege and limits how long an attacker can exploit a stolen credential.
  • Agent ownership: The assignment of accountable business and technical responsibility for an AI agent or automated workflow. Ownership should include approval authority, review cadence, and a clear connection to the identity that the agent uses, so that access and liability do not disappear when the workflow scales.

What's in the full article

Unosecur's full analysis covers the operational detail this post intentionally leaves for the source:

  • The exact GitLost attack flow and how the injected instruction moved through the agent's workflow
  • The Microsoft Cyber Pulse visibility figures cited in the article and how Unosecur uses them to frame shadow-agent risk
  • The vendor's description of how its identity fabric approach maps to discovery, least privilege, and RBAC and ABAC for agents
  • The FAQ section's direct explanation of why guardrails alone do not stop this class of disclosure

👉 The full Unosecur post covers the GitLost attack path, shadow-agent visibility gap, and governance implications.

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 July 22, 2026.
Updated on October 7, 2026.
NHI Mgmt Group, the independent authority on Non-Human Identity, IAM, and Agentic AI security. nhimg.org