GitLost: GitHub AI Agent Leaks Private Repos via Issues
Someone posted a GitHub issue. No code, no credentials, no access tokens. And a private repository’s contents showed up in the public comment thread. That’s GitLost — a prompt injection attack against GitHub’s AI agent that Noma Labs disclosed on July 7, 2026.
The attack is deceptively simple. GitHub has been rolling out agentic workflow features that let AI agents read issues, write code, and respond to comments. If your organization uses these agents, they have access to your private repositories. The problem: the agent reads issues from public repositories too. And it can’t reliably tell the difference between instructions from its owner and instructions embedded in content it reads.
An attacker opens an issue in a public repo belonging to the target organization. The issue body contains a prompt that tells the agent to pull data from a private repo and dump it as a comment. If the organization has the agentic workflow enabled and the public repo is in the same org, the agent follows the instructions. No authentication check. No scope validation. The agent just does what the text tells it to do.
How the attack actually works
The Noma Labs team found that the exploit has three stages. First, the attacker needs a public repository in the same GitHub organization that has private repos with AI agent access. This is common — many companies host their open-source projects alongside private code in the same org.
Second, the attacker crafts an issue that looks innocent to human reviewers but contains hidden instructions for the AI agent. The Noma team used markdown formatting tricks to embed prompts in ways that GitHub’s interface wouldn’t display to humans but the agent would parse. Think zero-width characters, HTML comments inside markdown, and collapsed sections.
Third, the agent processes the issue, follows the embedded instructions, and posts the results as a public comment. The attack is silent from the attacker’s perspective — they just open an issue and wait. No exploit code. No authentication bypass. No privilege escalation. Just natural language.
The Noma researchers demonstrated leaking source code, environment variable files, and internal documentation. In their proof of concept, the entire attack chain completed in under two minutes.
Why this matters beyond GitHub
GitLost isn’t really about GitHub. It exposes a fundamental problem with AI agents that interact with user content: prompt injection is the new SQL injection. Just like developers in the 2000s learned that concatenating user input into SQL queries was dangerous, we’re now learning that giving AI agents untrusted text to process is the 2026 equivalent.
The pattern is the same. You have a system (the AI agent) that executes instructions (prompts) with access to sensitive resources (private repos, databases, APIs). An attacker injects instructions into data the system processes. The system executes those instructions because it can’t distinguish between the legitimate instructions it was given and the attacker’s instructions hidden in content.
This isn’t a GitHub-specific problem. Any platform that connects AI agents to user-generated content has this vulnerability. Slack bots that read messages. Email assistants that process inboxes. Code review agents that analyze pull requests. If an AI agent reads content that anyone can write, someone will figure out how to make that content contain instructions the agent follows.
GitHub’s response and the patch
GitHub acknowledged the vulnerability and deployed a fix within hours of Noma’s responsible disclosure. The patch adds output filtering to agent responses — the agent now strips anything that looks like it might contain sensitive data before posting a public comment. GitHub also added scope restrictions that prevent agents from accessing repositories not explicitly mentioned in the workflow configuration.
But these are bandaids. Output filtering is a cat-and-mouse game — attackers will find new ways to encode data that bypasses the filter. Scope restrictions help but don’t address the root cause: the agent still reads attacker-controlled content and acts on it.
The Noma Labs team recommended a more fundamental fix: sandbox the agent’s execution context so that any data it pulls from private sources can only be written to private destinations. A public issue comment should never be a valid output target for data that originated in a private repo. Period.
The bigger picture: agent security is a new discipline
I’ve been saying this for a while, but GitLost makes it concrete. We’re building AI agents that have real access — to codebases, databases, deployment pipelines — and we’re giving them instructions from sources we don’t fully control. The security model we need doesn’t exist yet.
Traditional application security has clear boundaries: authentication, authorization, input validation, output encoding. Those boundaries don’t map cleanly to AI agents because the “input” isn’t just data — it’s language that the system interprets as instructions. You can’t sanitize language the way you sanitize SQL parameters. A prompt injection payload isn’t a special character sequence; it’s a coherent paragraph that happens to change what the agent does.
Here’s what’s terrifying: GitHub has some of the best security engineers in the world. If they shipped an AI agent with this vulnerability, what do you think the average startup’s hastily-built Slack bot looks like?
What teams should do right now
If you’re running AI agents that process any kind of user-submitted content — issues, PRs, chat messages, emails, support tickets — you need to audit them for prompt injection. Specifically:
Treat all user content as untrusted instructions. Your agent shouldn’t process user content the same way it processes system prompts. Separate these into different context windows or use clear delimiters that the model has been trained to respect.
Sandbox agent outputs. If an agent reads from a private source, it shouldn’t write to a public destination without explicit human approval. Build this into the agent’s tool definitions — a post_public_comment function should reject data that originated from a read_private_file call.
Add human-in-the-loop for sensitive operations. If your agent can access production databases, deploy code, or modify access controls, a human should sign off before those actions execute. This adds friction but prevents the worst-case scenarios.
Monitor agent behavior like you monitor API traffic. Log every tool call, every data read, every external write. If an agent suddenly starts reading files it’s never accessed before or posting to channels it’s never used, you want to know immediately.
None of this is a complete solution. Prompt injection is hard because language models are fundamentally designed to follow instructions in text, and distinguishing “good” instructions from “bad” ones is an unsolved research problem. But the basic hygiene above would have caught GitLost before it became a vulnerability disclosure.
The road ahead
GitLost will not be the last prompt injection vulnerability we see. It won’t even be the worst one. As agents get more capabilities — deploying infrastructure, managing finances, controlling physical systems — the blast radius of a successful prompt injection attack grows proportionally.
I think we’ll look back at 2026 as the year the security community woke up to AI agent threats. The OWASP Top 10 for LLM Applications was a good start, but it needs to evolve into something more operational — not just a list of vulnerability categories but a concrete testing framework that teams can run against their agents before deploying them.
GitHub patched GitLost quickly. The next platform might not be as fast. And the attack that really hurts won’t be disclosed responsibly — it’ll be exploited in the wild before anyone knows it exists.
Related attacks that make GitLost scarier
GitLost didn’t happen in isolation. It’s part of a pattern that’s been building for over a year.
In May 2026, researchers showed that Claude Code — Anthropic’s agentic coding tool — could be manipulated through hidden instructions in npm packages. Install a malicious package, and the agent’s code review context gets poisoned. The agent then suggests “fixes” that introduce backdoors.
A few months earlier, a team demonstrated that multi-agent systems are especially vulnerable. If one agent in a swarm gets compromised through prompt injection, it can spread malicious instructions to other agents through normal inter-agent communication. The infected agent doesn’t need special privileges — it just needs to send messages that other agents read and act on.
The common thread: agents inherit the trust model of the content they consume. If your agent reads a GitHub issue, it implicitly trusts the issue content. If it reads an npm package’s README, it trusts that README. This worked fine when humans were the only ones reading this content — humans have common sense and context that make them skeptical of “instructions” embedded in issues. AI agents don’t.
What’s new about GitLost is the simplicity. No supply chain attack. No dependency confusion. No npm registry shenanigans. Just a text field anyone can fill out on a public webpage. The barrier to entry is effectively zero — if you can open a GitHub issue, you can attempt this attack.
How GitHub’s agent architecture made this possible
To understand why GitLost worked, you need to understand GitHub’s agentic workflow architecture. When an organization enables agentic workflows, GitHub deploys an AI agent that listens for events in the org’s repositories — new issues, pull requests, comments, and so on. The agent has a system prompt that defines its capabilities and a set of tools it can use: read files, search code, create comments, open PRs.
The agent’s system prompt tells it to be helpful. When it sees a new issue, it reads the issue body and decides what to do. If the issue asks a question about the codebase, the agent searches the relevant repositories and responds. If the issue reports a bug, the agent might attempt to reproduce and fix it.
The vulnerability: the agent’s tool access wasn’t scoped to the repository where the issue was opened. An issue in a public repo could trigger the agent to search private repos in the same organization. And the agent’s output — the comment it posts — was public, even when the data it retrieved was private.
This is a classic confused deputy problem. The agent had legitimate access to private repos (for its intended workflow tasks). The attacker, through the issue prompt, tricked the agent into exercising that access on the attacker’s behalf and delivering the results to a public channel.
Sources:
- Noma Labs, “GitLost: How We Tricked GitHub’s AI Agent into Leaking Private Repos” (July 2026)
- The Register, “GitHub AI agent leaks private repos when asked nicely” (July 2026)
- The Hacker News, “Public GitHub Issue Could Trick GitHub Agentic Workflows Into Leaking Private Repo Data” (July 2026)
- SecurityWeek, “Critical Vulnerability Exposes GitHub Agentic Workflows to Prompt Injection” (July 2026)