BuildRiot
Sign in

Article · AI

GitHub’s AI scanner targets indirect prompt injection, separate from CodeQL

GitHub’s AI application scanning preview uses an LLM reviewer and documents coverage for indirect prompt injection in agents. A proposed banking-agent experiment shows how to distinguish a visible security risk, a scanner finding, and a successful attack.

A miniature inspection lens reveals a red hook hidden in a document catching a blue banking agent’s arm as it reaches toward a transaction drawer.
Illustration: BuildRiot (AI-generated)

Key takeaway

An agent’s access to sensitive tools makes authorization as important as its handling of untrusted text. Developers should evaluate scanner findings against observable tool behavior and measure attack resistance alongside legitimate task completion.

A new reviewer with a narrower documented scope

GitHub’s AI application scanning preview targets indirect prompt injection in agents, according to its operational documentation. The October 28, 2026 announcement named broader risks: indirect prompt injection, sensitive-information disclosure, and excessive agency. It described scanning for paths connecting untrusted content to models with access to tools, data, or business systems. Teams should use the documented coverage limit when choosing cases to evaluate. Sources: GitHub

The feature uses an LLM instead of CodeQL. CodeQL describes its own approach as querying code as data. GitHub says the new reviewer has no language or framework limitations. That is a scope claim, not a measurement of how accurately it interprets each framework’s tools and authorization rules. Sources: GitHub

A useful evaluation separates three questions: whether source code exposes a dangerous path, whether the scanner reports it, and whether an attacker can exploit it. Each requires different evidence. Source inspection can identify a trust boundary, while a scanner assessment needs an actual finding and an exploitation claim needs runtime results. GitHub’s preview has no established per-framework accuracy or repeatability results here, and its detection of the proposed banking cases remains unmeasured.

A banking tool illustrates the authority boundary

Consider a proposed banking-agent fixture with a transaction lookup tool and a signed-in user. The agent would receive chat messages, retain conversation history, and choose when to call the tool. Its instructions would tell it to retrieve only the current user’s transactions. This small design would make the relationship between model instructions and tool authority easier to inspect.

The risky variant would let the model supply an account identifier to the transaction tool. The inspection question would be whether trusted application code checks that choice against the signed-in user. If the wrapper simply forwards the identifier, the reviewer should trace where authorization actually happens. A natural-language restriction alone would not demonstrate that the lookup enforces the intended account boundary.

The concern in this design is unauthorized account selection; database involvement alone would not justify a SQL injection claim. The attack’s entry point also matters. A malicious instruction typed into chat would test direct injection, while one embedded in a retrieved document would test indirect injection. GitHub documents the latter as the preview’s coverage, so a direct-injection case should not serve as its positive control. Sources: GitHub

Test the path from external content to sensitive tools

The coverage experiment should introduce attacker-controlled text through a retrieved document or tool result. Keep the transaction tool available so the test connects external content, a model decision, account selection, and data access. A useful finding should identify both the untrusted input and the sensitive capability. Merely recognizing suspicious wording would not explain why the application could act on it.

Controlled variants can test different parts of that explanation. Move retrieval and agent construction behind helper functions to test whether the reviewer follows indirection. Retain an untrusted observation across turns to test delayed influence, then remove sensitive tools to create a benign control. The table below sets out the evidence needed at each stage; it does not report detection results.

Table

Evidence needed for source, scanner, and attack claims

QuestionEvidence needed
Is a dangerous path visible in source?Source inspection and an explanation of the trust boundary
Does the scanner report it?An actual finding tied to tested code and scanner configuration
Can an attacker misuse the path?Runtime execution with observable security outcomes
These proposed evaluation criteria distinguish a visible risk from a scanner finding and a demonstrated attack.

For each variant, record the commit, pull-request changes, dependency versions, detector settings, scan time, finding text, cited lines, and proposed fix. Repeat equivalent scans and score alert presence separately from explanation quality. Keep CodeQL findings separate from AI application findings. Investigate a missing warning before classifying it: an excluded request, insufficient context, a missed risk, and a removed vulnerability imply different outcomes.

Preview mechanics shape the experiment

GitHub scans pull requests when they open and after new commits, rather than scanning the repository’s existing backlog through this feature. Fork and Dependabot pull requests are excluded. A coverage test therefore needs an eligible pull request containing the intended change. The absence of a comment on an excluded request says nothing about detection accuracy. Sources: GitHub

The preview is off by default, and enablement is separate from AI Scan for pull requests. It requires GitHub Advanced Security on github.com and excludes GitHub Enterprise Server. Usage consumes AI credits in addition to the license, including for eligible public repositories. Teams planning repeated scans should account for those requirements before assembling an evaluation. Sources: GitHub

Findings appear as advisory comments and cannot enforce merge requirements through rulesets. Autofix suggestions are automatic. Review each proposed change against the authorization boundary it is supposed to protect. A useful fix should survive the same attack cases while preserving legitimate requests. Sources: GitHub

Runtime testing must observe records and tool arguments

For the proposed banking fixture, ask whether a session signed in as one user can receive another user’s records. Capture actual tool arguments and returned data rather than relying on the chatbot’s explanation. A refusal should not count as a successful defense if an unauthorized lookup already occurred. Likewise, an agent that fails ordinary requests offers little evidence of useful security when it also fails to execute an attack.

AgentDojo provides a methodological reference through agents that call tools in stateful environments. The NeurIPS 2024 paper introduced 97 realistic tasks and 629 security test cases with specified attacker goals and injection locations. Its utility checks examine environment state, and the evaluated models completed less than 66% of tasks without attacks. Those historical results describe the paper’s configurations, not GitHub’s preview or current models. Sources: OpenReview

The practical lesson is to report legitimate task completion alongside attacker success. A low attack-success rate needs context: the agent may be respecting an access rule, or it may be failing to use its tools. Establish ordinary behavior before interpreting adversarial results. The following protocol would make those outcomes easier to distinguish.

  1. Verify that ordinary requests for the signed-in account succeed.
  2. Run direct and indirect injection cases separately.
  3. Inspect tool arguments, returned records, and retained conversation state.
  4. Repeat attacks in fresh sessions and across multiple turns.
  5. Send unauthorized arguments directly to the tool after the authorization fix.
  6. Report legitimate task completion alongside attacker success.

Make the tool enforce the account boundary

For the proposed fix, derive the authorized account identity from trusted session state inside the transaction tool. That change would move account selection out of the model’s control. Test stronger prompt instructions as a separate variant so their effect remains distinguishable from application enforcement. Compare each scanner explanation with the control that actually changed.

Before execution, pin the fixture to a commit and preserve its dependency and model configuration. Keep the attack cases after applying the fix, then check that legitimate banking requests still complete. Test unauthorized tool arguments directly as well as through the agent. Record which requests the tool rejects and whether the scanner’s suggested changes preserve that behavior.

Attribution

Sources

  1. 1GitHubAI applications scanning for pull requests
  2. 2GitHubCode scanning for AI applications in public previewSource published (UTC)
  3. 3GitHubCodeQL documentation
  4. 4OpenReviewAgentDojo: A Dynamic Environment to Evaluate Prompt Injection Attacks and Defenses for LLM Agents

Read the original source for full details and context.

Report a problem

Links, dates or what you expected. Do not include passwords or private data.

More on AI

All AI stories
GitHub’s AI scanner targets indirect prompt injection, separate from CodeQL · BuildRiot