A pull request can leave your application code untouched and still introduce a security problem.
It might expose a database through Terraform, change how a Dockerfile downloads software, or modify a shell script that handles untrusted input.
These files influence production security, but application-code analysis does not automatically cover all of them.
On October 15, 2026, GitHub made AI Scan for pull requests generally available. It adds AI-based security analysis for selected languages and frameworks outside CodeQL’s current coverage, including Terraform HCL, Dockerfiles, Shell/Bash, PHP, JSP, and Blazor.
The important distinction: AI Scan complements CodeQL. It does not replace it, audit your entire infrastructure, or automatically block insecure changes.
What AI Scan adds to pull requests
AI Scan examines supported pull-request changes and surfaces potential security vulnerabilities directly in the review workflow.
Findings appear in the Conversation and Files changed tabs, alongside CodeQL results. An AI indicator distinguishes them, and findings can include a risk explanation and a suggested autofix.
That matters because a repository is more than its application code. It also contains the instructions that provision infrastructure, build containers, configure environments, and deploy services.
AI Scan brings additional security feedback to those changes without requiring reviewers to leave the pull request.
However, supported coverage does not guarantee that every vulnerability will be detected.
AI Scan versus CodeQL
CodeQL analyzes supported code using its query-based analysis engine. AI Scan adds another detection approach for selected languages and frameworks CodeQL does not currently cover.
They share a review interface, but their findings have different operational consequences.
| Question | CodeQL | AI Scan |
|---|---|---|
| Primary role | Security analysis for supported code | Additional AI-based analysis for selected PR changes |
| Repository backlog | Supports repository code-scanning alerts | Findings remain on pull requests |
| Merge enforcement | Applicable code-scanning requirements can block merges | Findings cannot enforce ruleset merge requirements |
| Relationship | Keep existing analysis enabled | Add alongside existing controls |
AI Scan does not require CodeQL default setup and can run independently of CodeQL analysis.
That independence should not be confused with replacement. If CodeQL fails, AI Scan running does not mean the missing CodeQL coverage has been restored.
Why Terraform coverage matters
Infrastructure changes can alter who can reach a service without changing how the service authenticates users.
A Terraform pull request might broaden database access, change a security group, or modify infrastructure permissions. The security impact depends on the complete configuration and deployment context.
Useful review questions include:
- Is this access intentionally public?
- Which workloads actually need it?
- Can permissions be narrowed?
- Does the proposed configuration match organizational policy?
- Are other controls being relied on without verification?
These are illustrative review concerns, not promises that AI Scan detects every instance.
AI feedback can help start the investigation. Terraform validation, policy checks, plan review, and deployed-environment verification still have separate jobs.
Dockerfiles introduce supply-chain decisions
A Dockerfile determines more than which packages an application needs.
It can introduce externally downloaded scripts, change the build’s trust assumptions, or expose sensitive material during an installation step.
When a Dockerfile changes, reviewers should consider:
- Whether downloaded artifacts are pinned and verified
- Whether remote content can change without a repository update
- Whether build credentials are available to unnecessary processes
- Whether approved packages can replace unverified installation scripts
AI Scan creates another opportunity to flag security concerns where build instructions change.
It does not replace container-image vulnerability scanning. Reviewing build instructions and inspecting the resulting image answer different security questions.
Shell scripts deserve application-level scrutiny
Deployment scripts often receive less attention than application code, despite operating with powerful credentials and production access.
A small script change can introduce unsafe command construction, mishandle untrusted input, or weaken validation.
The useful question is not simply whether the script runs successfully. It is whether an unexpected input can make it perform an unintended action.
Shell/Bash coverage helps extend security review into this frequently overlooked part of the repository.
Still, every finding needs context. Reviewers must understand where input originates, which privileges the script has, and how the command behaves.
Four limitations to understand before enabling it
1. Findings are advisory
AI Scan findings do not fail the code-scanning check and cannot block merges through ruleset requirements.
Enabling it does not create an automatic security gate. Existing required checks, branch protections, and reviewer approvals remain responsible for merge enforcement.
2. It is not a historical repository audit
AI Scan analyzes pull requests. Its findings do not become backlog alerts in the repository’s security view.
Turning it on should not be described as scanning all existing code and producing an inventory of historical vulnerabilities.
3. Some pull requests are excluded
GitHub states that AI Scan does not run on pull requests from forks or pull requests created by Dependabot.
Teams accepting external contributions should account for that gap rather than assuming every incoming change receives the same analysis.
4. AI findings can be wrong
GitHub explicitly warns about false positives.
A convincing explanation is not enough. Verify the affected behavior, inspect the assumptions, and review suggested fixes before applying them.
A fix that removes one suspicious pattern can still alter application behavior or introduce a regression.
Availability and costs
AI Scan is available for public repositories owned by organizations or personal accounts.
Private and internal organization-owned repositories require GitHub Code Security or GitHub Advanced Security. A GitHub Copilot license is not required.
The feature runs when code scanning and the repository’s effective AI Scan setting are enabled. It does not require a separate CodeQL default-setup configuration.
Usage consumes Code Security AI Credits, which are also used by agentic autofix. Teams can configure budgets to control spending.
Budget limits need operational attention: if a hard budget exhausts the available quota, AI Scan cannot produce findings. Treat that as a potential coverage interruption, not just a billing notification.
How to roll it out without creating noise
Start with one repository that regularly changes infrastructure, container builds, or shell scripts.
Then follow a simple process:
- Confirm eligibility and enable the required settings.
- Keep CodeQL and specialized scanners in place.
- Assign someone to triage findings.
- Require human verification before applying fixes.
- Track valid findings, false positives, and actual remediation.
- Monitor usage budgets and excluded pull requests.
Do not judge success by finding count alone.
Ten useful findings that prevent meaningful mistakes are more valuable than hundreds of comments developers dismiss.
GitHub’s security overview provides AI Scan metrics, but teams should also record whether findings were actionable and whether the fixes preserved intended behavior.
The right expectation
AI Scan expands security attention to files that can quietly change how production systems are built, exposed, and operated.
Its value is not that AI now guarantees repository security. Its value is another chance to notice a risky change before it reaches production.
Keep CodeQL, retain specialized checks, and preserve human ownership.
Use AI Scan as an additional review signal—not as permission to trust a pull request simply because no finding appeared.



