GitHub adds AI security detections for Shell, Dockerfiles, Terraform and PHP

GitHub's AI code scanning flags Shell, Dockerfile, Terraform and PHP issues that CodeQL misses. How AI Scan works, what it needs and how to enable it on PRs.

TechLogHub Engineering Team
March 25, 2026
4 min read
0 views

Share Article

GitHub adds AI‑powered bug detection to expand security coverage

GitHub has added AI-powered security detections to GitHub Code Security so pull requests get flagged in files CodeQL never analysed: shell scripts, Dockerfiles, Terraform and PHP. For many teams those are exactly the files where secrets leak and misconfigurations hide. Here is what was announced, what has shipped since, and how to decide whether to turn it on.

What happened

On 23 March 2026 GitHub product VP Marcelo Oliveira announced AI-powered detections for GitHub Code Security. The idea is a hybrid: CodeQL keeps doing deep semantic analysis for the languages it supports, and an AI engine covers code that is hard to model with traditional static analysis. GitHub said that in internal testing the system processed more than 170,000 findings over 30 days, with more than 80% positive developer feedback. It also said Copilot Autofix fixed more than 460,000 security alerts in 2025, cutting average time to resolution from 1.29 hours to 0.66 hours. GitHub previewed the feature at RSAC and planned a public preview for early Q2.

The public preview arrived on 14 July 2026. The changelog says detections run automatically when a pull request is opened or updated, are labelled "AI" to set them apart from CodeQL results, and are informational only. They do not block merges.

Who is affected

  • Organisations on GitHub Advanced Security / GitHub Code Security. During the preview you need a GHAS licence and a GitHub Copilot licence, and runs consume AI credits under usage-based billing.
  • Teams with mixed-language repos. GitHub's docs name PHP, Shell/Bash, Terraform (HCL) and Dockerfiles, plus framework gaps such as JSP for Java and Blazor for C#. GitHub says the list is not exhaustive and may change.
  • Enterprise admins. The feature is off by default at the enterprise level and has to be allowed there before organisations can enable it.

What it means for developers and engineering teams

Static analysers such as CodeQL build a precise model of data flow for a language. That gives high precision, but each language needs a lot of engineering, so infrastructure code and scripting languages have long been weak spots. That matters, because a typical service repo also carries a Dockerfile, a few .sh deploy scripts and a terraform/ directory, and those decide whether a container runs as root, whether a bucket is public or whether a pipeline interpolates untrusted input into a shell.

The AI engine fills that gap by reading the diff with repository context (GitHub says it uses tools such as code search) and reasoning about categories like injection, weak cryptography, broken access control, sensitive data exposure, security misconfiguration, SSRF and supply-chain risk. It does not need a build. The trade-off is the usual one for LLM-based review: wider coverage, less certainty. GitHub's docs say false positives can occur. Findings show up only on the PR, not as backlog alerts, and cannot yet be enforced through rulesets.

A few details matter in practice:

  • It ignores your custom instruction files such as copilot-instructions.md or CLAUDE.md. You cannot steer it with prompts.
  • It does not run on pull requests from forks or on Dependabot PRs, so open-source maintainers get less out of it than internal teams.
  • It scans pull requests only. Existing code is not scanned until someone changes it.

Treat it as an extra reviewer for files nobody was scanning, not as a gate. Keep a deterministic IaC or container scanner in CI for the checks you want to enforce.

What to do now

  1. Check eligibility. Confirm you have GHAS/Code Security plus Copilot seats, and estimate AI-credit usage from your PR volume before enabling it across the org.
  2. Enable it in stages. An enterprise owner allows AI security detections, then turn it on for a pilot org or a few repos with lots of Terraform, shell or PHP. The REST API exposes an ai-scan setting if you manage settings as code.
  3. Make sure code scanning is on. The changelog says CodeQL default setup is required. The current docs say AI Scan can run even if CodeQL fails. Follow whichever your tenant's settings page shows.
  4. Measure the signal. Use the thumbs up/down on each finding and the Prevention tab in security overview to track how many AI findings lead to code changes.
  5. Keep a hard gate elsewhere. AI findings don't block merges, so keep required status checks for the rules you enforce, such as secret scanning push protection or a policy-as-code check on Terraform.
  6. Cover what it skips. Fork PRs, Dependabot PRs and untouched legacy code still need a scheduled full-repo scan.

Related on TechLogHub

Sources

Stay Updated

Get the next deep dive in your inbox

Subscribe for product analysis, engineering explainers, and practical guides published on TechLogHub.

See what launched this week

One email a week: new and trending developer tools, fresh comparisons, and what shipped. Unsubscribe in one click.

GitHub AI Security Detections: How AI Scan Works | Github Adds Ai Powered Bug Detection To Expand Security Coverage | TechLogHub