Prompt injection isn't a bug you patch once
Researcher RyotaK ended up cataloguing around fifty separate ways to bypass Claude Code's permission system. The most critical one let an attacker steal CI/CD secrets in January 2026, starting from a single GitHub issue.
by detektd team

In January 2026, researcher RyotaK, from Japanese firm GMO Flatt Security, disclosed a critical flaw in claude-code-action, Anthropic's official GitHub Action that runs Claude Code inside continuous integration workflows. The tool's idea is simple and popular: you mention the agent in an issue or pull request, it reads the context, writes code, replies in a comment. That exact loop (read text, then act) is what got turned against the repositories using it.
A trust problem, not an execution problem
The first link was an authorization check. Before acting, the action was supposed to make sure whoever triggered it had write access to the repository. But the function in charge of that check, checkWritePermissions, unconditionally trusted any "GitHub App" trigger. Anyone can register their own GitHub App: an attacker could therefore fire the workflow with content entirely under their control.
function checkWritePermissions(actor) {
if (actor.type === "GitHub App") return true; // any app at all
return hasRepoWriteAccess(actor);
}The second link was the agent itself. In a GitHub Actions runner, workflow secrets are environment variables of the process. The malicious content could steer the agent into reading those variables, then copying them somewhere public: an issue comment, for instance, through the very GitHub tool the action gave it to reply with. Among the data exposed that way: an OIDC token that can be exchanged for an installation token of Claude's GitHub App, with full write access to the repository.
The most worrying detail concerns Anthropic's own repository: it used the same vulnerable workflow. A successful attack could have injected code into the action itself, and from there spread to every repository using it downstream. That's the classic supply chain attack pattern, triggered here by a single issue.
The "lethal trifecta"
The term "prompt injection" was popularized in September 2022 by developer Simon Willison, who has documented its variants ever since. In June 2025, Willison formalized a framework that has become a reference: the "lethal trifecta". An agent becomes exploitable as soon as it combines three properties: access to private data, exposure to untrusted content, and the ability to communicate externally.
- Private data: the workflow's secrets, present in the runner's environment.
- Untrusted content: the text of an issue, written by anyone.
- External communication: the ability to post a public comment.
The claude-code-action case ticks all three boxes. And that explains why the flaw can't be reduced to one line of code: fixing checkWritePermissions closes one entry point, but as long as an agent combines all three properties, any other way of getting it to read malicious text (a file in the repo, a dependency, a pull request comment) recreates the same situation.
Why prompt injection can't be "patched"
The comparison with SQL injection is instructive. For years, SQL injections came from the same problem: data (user input) mixed in with instructions (the query). The fix was structural: parameterized queries, which physically separate the two. Nothing equivalent exists for a language model: instructions and data arrive in the same stream of text, and the model has no reliable way to know which it should follow. That's why OWASP ranks prompt injection first in its Top 10 for LLM applications (LLM01).
RyotaK has since reported around fifty separate ways to bypass Claude Code's permission system.
GMO Flatt Security
Anthropic fixed the bypass in claude-code-action v1.0.94, rated 7.8 in CVSS v4.0, and paid a $4,800 bounty. But the figure of around fifty bypasses says it all: each individual fix works, and the surface stays open. It changes shape with every new tool given to the agent, every new MCP connector, every new way to disguise an instruction as data.
Cline: the scenario made real
A month after the disclosure, in February 2026, the theoretical scenario played out elsewhere. The GitHub Actions workflow of Cline, a competing open-source coding agent, was compromised: an attacker stole an npm publish token and pushed an unauthorized cline@2.3.0 release straight to the registry. Users installing it from npm received a version the maintainers had never published.
The problem didn't start with agents, either. In 2021, GitHub Security Lab was already documenting "pwn requests": workflows that run with the repository's secrets in response to content from outside, like a pull request from a fork. AI agents don't create that class of flaw; they widen it, because an agent turns any piece of text into potential actions.
Hardening a workflow that runs an agent
Since you can't stop a model from reading a malicious instruction, the defense is to break the trifecta: reduce what the agent can reach, who can trigger it, and what it can send out. On GitHub Actions, two settings do most of the work: minimal permissions for the workflow token, and a condition that restricts triggering to repository members:
permissions:
contents: read
issues: write
jobs:
agent:
if: >-
contains(fromJSON('["OWNER","MEMBER","COLLABORATOR"]'),
github.event.comment.author_association)
runs-on: ubuntu-latest- Give the agent's job only the secrets it strictly needs, and no publishing secrets (npm, container registry, deployment).
- Separate the agent's work (proposing code) from publishing (merging, releasing), with human approval in between.
- Keep the action up to date: fixes for this class of flaw ship regularly, and a pinned old version stays vulnerable.
Anatomy of a runner's secrets
To measure what an agent can reach inside a GitHub Actions runner, you need to know what's in there. Each job gets a freshly generated GITHUB_TOKEN, whose rights are set by the workflow's permissions block, hence the importance of not leaving the defaults. On top of that come the secrets declared in the workflow, exposed as environment variables wherever they're referenced.
The most sensitive case is OIDC. When a workflow declares the id-token: write permission, the runner gets two environment variables, ACTIONS_ID_TOKEN_REQUEST_URL and ACTIONS_ID_TOKEN_REQUEST_TOKEN, which let it ask GitHub for a signed identity token. That token is then exchanged with AWS, GCP, Azure (or Claude's GitHub App in the case at hand) for real access. In other words, anyone who reads the runner's environment during the run can mint that token. That's why reading /proc/self/environ was so serious: it didn't just reveal static secrets, but the means to obtain new ones.
The OIDC token contains a sub claim describing exactly where it comes from, for example repo:acme/app:ref:refs/heads/main, or repo:acme/app:environment:production if the job uses a GitHub environment. The cloud-side trust policy must pin that claim as tightly as possible. A condition like "any branch of any repo in the organization" turns every compromised workflow into production access.
"Condition": {
"StringEquals": {
"token.actions.githubusercontent.com:aud": "sts.amazonaws.com",
"token.actions.githubusercontent.com:sub": "repo:acme/app:environment:production"
}
}Two other reflexes matter. GitHub masks secrets in logs, but only when their exact value appears: a value that's base64-encoded, split up or posted through the API (in a comment, for instance) escapes masking. And a secret should only be exposed to the step that needs it, through that step's env block, rather than at the level of the whole job where the agent runs.
steps:
- name: Run agent (no secrets in its environment)
run: ./run-agent.sh
- name: Upload report
run: ./upload.sh
env:
UPLOAD_TOKEN: ${{ secrets.UPLOAD_TOKEN }}What an external scan can see of it
A scanner like detektd can't see your CI workflows. It does see, however, the part of the AI surface your app exposes publicly, and that's often where the trifecta forms on the user-facing side:
- An agent's system prompt or tool schemas shipped to the browser, readable by any visitor.
- Public entry points that pass unfiltered user input straight to an LLM.
- MCP or agent endpoints reachable without authentication, exposing tools that can act (files, shell, HTTP requests).