Skip to content
Beta
All articles

GitHub's code scanning for AI applications: what the preview detects today

GitHub now scans pull requests for prompt injection paths in agent code. The preview detects one of the three risks it names, and findings never block merges.

By The SpanDock team

4 min read

A diagram: untrusted content flows into a model that holds tools, and a pull request scanner flags that path before merge

On 28 October 2026, GitHub put a new detector into public preview: code scanning for AI applications. It reads pull requests for code that builds AI agents and looks for places where untrusted content can reach a model that has tools, data or business systems within reach. That is the shape behind most prompt injection incidents, and catching it at review time is a sensible idea. The announcement and the documentation describe its scope a little differently, though, and the difference matters if you plan to rely on it.

What GitHub announced

The changelog entry says code scanning can now detect AI application and agent vulnerabilities, "including indirect prompt injection (XPIA), sensitive information disclosure, excessive agency, and other AI-specific risks as coverage expands". It describes each risk:

  • Indirect prompt injection: instructions hidden in untrusted content, such as a file, web page or issue comment, that an agent reads. The changelog notes that this is the top risk in the OWASP Top 10 for LLM Applications.
  • Sensitive information disclosure: an AI application that can reach sensitive data without proper authorisation controls.
  • Excessive agency: an agent with more capabilities, permissions or autonomy than its task needs.

Scans run automatically on pull requests alongside CodeQL, and findings come with mitigation guidance in the pull request.

What the preview actually covers

The documentation is more specific. Under "Detection coverage" it says: "During public preview, AI applications scanning only detects indirect prompt injection (XPIA) vulnerabilities in AI agents." Sensitive information disclosure and excessive agency are described as risks the detector targets, but the preview does not report them yet.

The documentation adds several other limits:

  • Pull requests only. It scans when a pull request is opened and after each new commit. It does not scan the existing repository or backlog.
  • Not on forks or Dependabot. It does not run on pull requests from forks or on those created by Dependabot.
  • Advisory. Findings appear as pull request comments with an "AI app" label. They never block a merge, and they can't be used in rulesets to enforce merge requirements.
  • Model-based. It uses an LLM-based approach rather than CodeQL, so it has no language or framework limits. Like any model-based check, expect some misses and some false alarms.
  • Off by default. It must be enabled at the organisation level, even if AI Scan for pull requests is already on. The two features share an enterprise policy but are enabled separately.
  • Licensing and cost. It needs a GitHub Advanced Security license and consumes AI credits on top of it, including for eligible public repositories. It is not available on GitHub Enterprise Server.

Copilot Autofix suggestions are generated for its findings automatically, independent of the setting that controls Autofix for CodeQL results.

How it relates to AI Scan

GitHub now has two model-based detectors on pull requests. AI Scan, which we covered when it became generally available, looks for conventional vulnerabilities. This one looks for risks specific to AI applications. GitHub's advice is that teams building agents should evaluate both. Neither replaces the other, and enabling one does not enable the other.

What it means for engineering and security leaders

  • The useful part is the data flow, not the prompt. Prompt injection can't be fixed by better wording in a system prompt. What a reviewer can judge is whether untrusted content and powerful tools meet in the same model call. A detector that points at those code paths gives reviewers somewhere to look.
  • Coverage claims need reading twice. If a security review lists "excessive agency" as covered because the changelog mentions it, that is not accurate for the preview. Record what the documentation says is detected today.
  • Advisory findings need an owner. Because findings can't block merges, someone has to decide what happens to them. Otherwise they become comments that authors dismiss.
  • A clean scan is not a clean design. The detector covers new pull requests, not agent code already in production, and a model-based scanner can miss things. As our look at attack success rates argued, low numbers in one test do not mean an agent is safe.

Practical takeaways

  • If you have Advanced Security and build agents, turn on "Scan for AI applications" for a few repositories that contain agent code and watch the findings for a few weeks before rolling it out widely.
  • Decide who triages "AI app" findings and what a finding means for the pull request, since the tool won't block it.
  • Keep reviewing the other two risks by hand. For excessive agency, the question from the OWASP entry is simple: does this agent have more tools, permissions or autonomy than the task needs?
  • Inventory existing agent code separately. The detector only sees changes, so older code paths that mix untrusted input and tools need a one-off review.
  • Map findings to shared vocabularies such as the OWASP prompt injection entry and the new MITRE ATT&CK techniques so reports mean the same thing across teams.
  • Budget for it. The detector consumes AI credits on top of the Advanced Security license, so watch usage as you widen the rollout.

Sources

  1. GitHub Changelog: Code scanning for AI applications in public preview (28 October 2026)
  2. GitHub Docs: AI applications scanning for pull requests
  3. OWASP GenAI Security Project: LLM01 Prompt Injection
  4. OWASP GenAI Security Project: LLM06 Excessive Agency
Cookie categories

Details: Cookie Policy.