Scanner fired. Commit reverted. Samples gone anyway. That is the November 2026 Together AI disclosure compressed into three beats. And the order of those beats is the whole argument of this post. During development of xorl, Together AI’s public GitHub repository, an AI coding agent committed a credential that unlocked a private Hugging Face repository holding stored prompt samples (dev.to). Automated scanning caught the exposed credential and the commit was reverted. After an unauthorized party had already used it to download the samples. Detection won on paper.
Lost in practice.
The Short Answer: Why Coding Agents Leak Credentials
If you are triaging this for your own repos, the blunt version: coding agents leak credentials because trusted and untrusted text get fused into a single context, the agent acts on all of it. And we hand that context long-lived keys. This is not a smarts problem. It’s plumbing.
Evidence stacks up fast.
A Cequence writeup of Johns Hopkins University research reports credential theft demonstrated against Claude Code, Gemini CLI. And GitHub Copilot using nothing but pull-request titles and issue comments (Cequence). The same writeup cites a systematic analysis of 78 studies that found every tested coding agent vulnerable to prompt injection, with adaptive attack success rates exceeding 85%. A smarter model does not close that gap. Labels and authorization do.
Why AI Coding Agent Credential Leaks Keep Happening
First read, the xorl story looks like a security win.
Second read, it isn’t.
Per the disclosure, the exposure window ran long enough for an unauthorized party to obtain the credential and download the stored prompt samples; only then did automated scanning flag the secret and revert the commit.
Reverting a commit does not un-leak it.
The old commit stays in history, and anyone who grabbed the repository during the window keeps a copy. Notice what was stolen, too. Prompt samples, not money. Exactly the kind of quiet intellectual property a lean team never bothers to classify as a secret.
Two lessons drop out of this.
Scanning is recovery, not prevention: it bounds damage after the key is already public.
And the agent wasn’t hijacked when it committed the credential; it was doing its assigned job.
That second point should move your effort off the model and onto what the model can reach.
The mechanism behind all of it is indirect prompt injection, which is simple to define and miserable to fix: malicious instructions ride in content the agent reads rather than in your prompt.
An academic treatment of the problem calls it the “architectural conflation of code and data inherent to LLM-based systems” (arXiv).
The agent cannot structurally distinguish a pull-request title from an instruction, since both arrive as text it is supposed to consider.
The attacks are insultingly cheap. Cequence’s account of the Johns Hopkins work describes instructions embedded in “a pull request title, issue description, or comment,” including a scenario where a malicious bug report instructs an agent to leak a password. No exploit chain, no zero-day. Ordinary repository content turned into a delivery vehicle with two sentences of text.
Forcepoint’s report on coding-agent attacks lists what one injected instruction can end up reaching (Forcepoint):
– Repository files, Git history, terminals, and shells
– Package managers and environment variables
– MCP tools and cloud credentials
– GitHub, GitLab, CI/CD systems, and databases
– Developer filesystems
The same report found that the malicious samples it studied hid steps in Base64 and ZIP files to steal credentials. And 91% of them added prompt injection on top. Credential theft isn’t a side effect of these campaigns. It is the payload.
Prompt Injection Through a Documentation Lookup
The most boring attack surface in this whole mess is CVE-2026-75130, given that the entry point is documentation. A report on the vulnerability states that Context7 through version 2.1.2 allowed attackers to execute malicious instructions in connected AI coding agents by injecting unsanitized content through the Custom AI Instructions feature served via the MCP server (dev.to). The NVD record went up 2026-08-18 on a VulnCheck submission. Listed impacts were credential exfiltration from environment files to an attacker-controlled service, plus destructive file deletion on the victim’s machine. Triggered “when the agent makes a routine library documentation request.”
Sit with that trigger phrase for a second. The agent went to check how a library works. And the answer it fetched deleted files and shipped out the environment file.
This is provenance failure in its purest form.
Nothing in the pipeline recorded that the instruction originated outside the repository, so nothing downstream could treat it differently.
Agent asked for docs, docs carried orders, and the context swallowed both without a label in sight. Flat version of the same point: nobody knew where the words came from.
How to Prevent AI Agent Credential Leaks
Stop trying to make the model suspicious.
The durable controls in the research are boring infrastructure, and they hold regardless of which agent you run.
Mark every message segment with a trust label at ingestion. User, system, or tool result. And keep that label through context assembly. If a chunk of context arrived from a documentation server or a stranger’s issue comment, the runtime should know that and behave accordingly.
Gate sinks on causal history. When an action follows untrusted content, require an approval that shows both the proposed action and the source text that prompted it. One interface change, and an invisible hijack becomes a reviewable diff. You finally see which outside text caused which privileged step.
Bind the principal outside the model, and check the resource on the server (dev.to).
In practice: derive who is acting from the session or the job. And check authorization before any side effect executes. Give each job the least credential it needs to finish.
A documentation lookup doesn’t need write access to the filesystem, and it certainly doesn’t need a long-lived key.
This reframes prompt injection as what it actually is: an authorization bug. The model got manipulated, sure.
The system failed as the system was willing to execute privileged actions with no independent check.
Most solo setups concentrate the risk in one place: a handful of keys to payment, email. And hosting sit in a single file, and the agent can read every one of them. The Cequence writeup states the operational rule plainly: “any credential that an AI agent can access is a credential an attacker can potentially exfiltrate.” Treat that sentence as a design constraint, not a warning:
– Cut credentials per job: one scoped, short-lived key per task instead of one master token per machine.
– Treat repository text as untrusted input: pull-request titles, issue comments, and documentation lookups are all attacker-reachable surfaces.
– Require approval gates that show source text whenever an action follows content from outside your repo.
– Add trust labels in your own agent setup if the vendor hasn’t shipped them yet.
– Keep secret scanning on, but budget for it as cleanup, not protection.
Quick question: how many credentials can your agent read right now? If the answer doesn’t come instantly, that’s the answer. Pick the repository your agent touches most, count every credential it can reach. And treat the total as the real attack surface. The work is shrinking it before somebody else counts it for you.
FAQ: AI Agent Credential Leaks
Can an AI coding agent leak my credentials?
Yes, two independent ways.
An agent doing its assigned job committed a live credential at Together AI. And separate Johns Hopkins research demonstrated credential theft against Claude Code, Gemini CLI.
And GitHub Copilot using pull-request titles and issue comments.
No hijack required in either case.
What is prompt injection in a coding agent?
Malicious instructions that ride in content the agent reads.
A pull-request title, an issue comment, a documentation response. Instead of in your prompt. The agent can’t structurally distinguish them from instructions, since both arrive as text it is supposed to consider. The academic framing calls it the “architectural conflation of code and data inherent to LLM-based systems.”
Is secret scanning enough?
No. At Together AI, scanning worked as designed and the samples still left, since the exposure window ran long enough for someone to download them first. Scanning bounds damage after a secret is public — it’s recovery, not prevention.
Keep it on, budget for it as cleanup.
Are smarter models safer here?
Not per the research.
The systematic analysis of 78 studies found every tested coding agent vulnerable to prompt injection, with adaptive attack success rates exceeding 85%.
A smarter model doesn’t close the gap.
Labels and authorization do.
What is least-credential design?
One scoped, short-lived key per task, instead of a master token per machine. Each job gets only what it needs to finish. A documentation lookup doesn’t need filesystem write access. Pair it with binding the acting principal outside the model and checking authorization on the server before any side effect runs.
Sources
– Together AI xorl disclosure (dev.to)
– Cequence — AI agent prompt injection credential theft
– arXiv — architectural treatment of prompt injection
– Forcepoint X-Labs — AI coding agent attacks 2027
– Context7 CVE-2026-75130 report (dev.to)
– Prompt injection is an authorization bug (dev.to)
