GitLost: We Tricked GitHub's AI Agent into Leaking Private Repos
TL;DR Highlight
A public GitHub issue made GitHub's AI agent leak private repo READMEs as a public comment
Who Should Read
DevOps and backend developers wiring AI agents into GitHub Actions to automatically handle issues and PRs
Core Mechanics
- One public issue leaked private repos
- Noma Labs found a prompt injection (hidden commands in content an agent reads) flaw in GitHub Agentic Workflows and named it GitLost.
- Simply opening an issue in a public repo of the same org pulled data from private repos.
- The attacker needed no coding skill, access, or credentials.
- The vulnerable workflow setup
- The workflow triggered on issues.assigned events.
- It read the issue title and body and replied using the add-comment tool.
- It had read access to other repos (public and private) in the org.
- The attack looked like a sales request
- The issue was crafted to look like a request from a VP Sales after a customer meeting.
- Once assigned, the agent fetched README.md from the poc (public) and testlocal (private) repos.
- It posted the contents as a public comment on the issue.
- One word, "Additionally", beat the guardrails
- GitHub had guardrails meant to stop this, but they failed to protect the repos.
- After repeated variations, adding "Additionally" made the model reframe its output instead of refusing.
- The context window is the attack surface
- Any issue, PR, comment, or file the agent reads can be weaponized if treated as instructions.
- Trust boundaries partly depend on model behavior, and models are built to follow instructions.
- Noma's four recommendations
- Never treat user-controlled content as trusted instructions.
- Scope permissions to the minimum; cross-repo agents are high-value targets.
- Restrict what agents can post publicly.
- Sanitize or isolate user input from the instruction context.
Community Reactions
- Public write-back is the real leak path
- One commenter argued the read permission was not what leaked data; the public comment write was.
- Their view: you can't win on input-side injection defense, so block the output side.
- It's misconfiguration, not a GitHub bug
- Commenters said the researchers granted private repo access and then let the agent answer in public.
- They compared it to running a CI job with secrets on public PRs.
- Privilege separation worked in practice
- One commenter described an SQL MCP server with a low-priv pool limited to SELECT on views without sensitive columns, and a high-priv pool running only predefined queries.
- Security is enforced at the database layer, not by the model.
- Pushback on the SQL injection analogy
- Some argued prompt injection is worse since SQL has prepared statements, while LLMs have no way to separate instructions from data.
- Others noted the post doesn't say whether GitHub fixed it.
How to Apply
- Audit your agent workflow permissions
- Today, find workflows in .github/workflows and gh-aw markdown files with public triggers (issues, issue_comment, pull_request).
- If their token or agent can read other repos, remove that access.
- Limit public-trigger agents to their own repo
- Give agents reacting to external issues read access only to that repo.
- Move tasks needing private repo access into separate workflows.
- Restrict the agent's public writes
- Disable public output tools like add-comment or add a human approval step.
- Check that content read from private scopes can't appear in public output.
- Isolate issue text as data
- Wrap issue title and body in delimiters and state in the prompt that it is data, not instructions.
- This alone isn't enough, so combine it with permission limits.
Try It
# Paste into Claude or ChatGPT (simplified review prompt based on the article's recommendations)
You are a CI/agent security reviewer. Read the GitHub workflow or agent config below and check whether prompt injection could leak private data.
Checklist:
1. Are there events outsiders can trigger (issues, issue_comment, pull_request, etc.)?
2. Can the agent read outside this repo (especially private repos)?
3. Can the agent write to public places (e.g. issue comments)?
4. Is user input (title/body) separated from instructions?
For each item, give a risk verdict, the evidence (relevant lines), and how to fix it with least privilege, as a table.
[Config]
{{workflow or gh-aw markdown}}Terminology
Related Papers
Frostbite: A new CPU architecture discovered, designed and verified by AI
AI agents designed a CPU from scratch, claiming 4.59x perf/W over a traditional core
Restricting AI agents in mobile operating systems platforms from capturing data
Signal now blocks OS-level AI agents from reading its screen on iOS 27 and Android
Actions Speak Louder than Words: Stateful Privacy Sniffing of LLM Agents via Behavioral Covert Channels in Web Interactions
Agents' link choices alone let attackers rebuild user queries at F1 0.89; SOR cuts it to 0.39.
Tracking and Limiting Unsupported Claim Propagation in Multi-Agent LLM Systems: A Provenance-Aware Framework
Passing claims with source, evidence and history kept equivalence at 5 agent stages at 96% versus 31%.
LLM assisted reverse engineering
Pointing an agent at binaries with skills and MD notes made years-long hacks feasible
Metrics-in-the-Loop: Complexity Feedback Reshapes Agent-Written Code
Injecting per-turn complexity reports into coding agents cut code erosion without changing correctness
Why is Gemini 4 Carbon taking so long?
Carbon took nearly an hour on bug fixes that Astra and Opus finished in minutes, mostly from extra unrequested work.
Weight-Space Programming builds neural networks like a 1990s researcher
LLM hand-wrote MNIST weights to 91.3%, using 1990s-style techniques