In the modern software development landscape, the velocity at which code is produced has reached unprecedented levels. AI agents, capable of refactoring, debugging, and drafting entire features, have become indispensable partners for developers. However, this shift toward autonomous coding introduces a complex security dilemma: when an agent signals that a task is complete, tests pass, and the syntax appears logical, how can a developer truly verify that the output is secure? As the reliance on AI-generated code grows, the industry faces a burgeoning challenge in maintaining integrity across vast, multi-language repositories.
The scale of this issue is immense. According to internal data from GitHub, the platform identified more than 200 million vulnerabilities between January and October 2026. This figure represents a staggering 100% increase year-over-year, a statistic that underscores the urgent necessity for robust, scalable security measures. As AI-generated code proliferates across the global developer ecosystem, the risk of unintentionally introducing insecure patterns, exposing sensitive secrets, or suggesting nonexistent dependencies has become a primary concern for security-conscious engineering teams.
Ensuring the safety of an application in this environment requires a departure from traditional, reactive security models. It demands a holistic approach that integrates security checks directly into the building phase, mandates rigorous reviews before code merges, and continuously scans for risks across the entire project footprint. GitHub’s current strategy focuses on weaving built-in security analysis directly into the developer experience, allowing teams to investigate findings and apply remediation without the friction of context-switching between disconnected security tools. By building security into the workflow, the goal is to shift from a cycle of overwhelming, backlogged security debt to a proactive, iterative process of detection and resolution.
The Illusion of Completion: Addressing Agentic Oversight
A critical realization for modern developers is that an agent’s "done" signal is not a proxy for safety. Even when an agent produces code that satisfies every automated test, it can still harbor latent security vulnerabilities that are invisible to standard functional testing. Consider a common scenario: an agent tasked with updating a PHP search endpoint might implement a database query by directly inserting user-provided search text into an SQL string. Because the search functionality operates as intended, the code passes all functional tests, making the vulnerability difficult to spot without a deliberate, expert-level code review. In this case, the lack of sanitization creates a prime opportunity for SQL injection, allowing an attacker to manipulate the underlying database queries and potentially gain unauthorized access to sensitive data.
Expecting a human developer to manually audit every line of code generated by an agent is an unsustainable, slow, and error-prone process. To solve this, developers are increasingly turning to local security reviews as a primary defense. By executing a /security-review command within the Copilot app, the Copilot CLI, or Copilot Chat in VS Code, developers can initiate a preliminary scan of their active changes before a pull request is ever opened. This process provides prioritized findings and actionable remediation suggestions. Crucially, this review remains focused on the local workspace—it does not require a full repository audit, and it does not automatically alter the codebase. Instead, it empowers the developer to ask the AI to explain a specific vulnerability and propose a fix, such as replacing a dangerous query with a parameterized one that isolates user input from executable SQL commands.
The Pull Request Checkpoint: Closing the Gap
While local reviews serve as an essential first line of defense, the pull request (PR) remains a critical checkpoint for any secure development lifecycle. The PR process itself is not immune to risk; during the collaborative review phase, human reviewers might introduce their own changes or miss subtle vulnerabilities, potentially bypassing initial security protocols. Therefore, every PR requires an automated, objective security gate that triggers upon submission.
The foundation of this defense on GitHub is CodeQL, a powerful engine that analyzes code to find security vulnerabilities. To address the evolving nature of software, GitHub has complemented this with AI-powered scanning, which extends security coverage to a broader range of languages and complex vulnerability patterns that traditional static analysis might overlook. These two methodologies serve different but complementary roles: CodeQL provides deep, deterministic analysis of well-defined patterns, while AI-powered scanning adds a layer of intelligence capable of identifying vulnerabilities that may not fit neatly into pre-defined rule sets. For languages like PHP, which may fall outside the traditional scope of CodeQL, this AI-driven layer ensures that endpoints are scrutinized and that any identified issues are accompanied by clear, suggested fixes that reviewers can evaluate before merging.

Addressing the Legacy Codebase
While PR checks are vital for ensuring that new code is secure, they inherently leave a blind spot: the existing, legacy code that remains untouched during daily development. Older sections of an application may have been written years ago and have not been modified since, meaning they have never been subjected to modern, AI-assisted security scrutiny. As threat landscapes evolve and new techniques are discovered, code that was once considered safe may become a liability.
To mitigate this, developers with write access to a repository can utilize a Standard AI Scan on the default branch. This tool uses a sophisticated, proprietary harness that leverages multiple models where available. Rather than attempting the impossible task of reading every single file in the repository, the agent intelligently navigates the project, selecting specific files and functions to examine within a set time budget. This approach allows for the discovery of vulnerabilities across both CodeQL-supported languages and those that are not. Once the scan is complete, findings are consolidated into a unified code scanning backlog alongside CodeQL alerts. By suppressing duplicate findings, the system provides a clean, actionable view of the repository’s security posture. These alerts can then be assigned to team members, linked to specific project issues, or integrated into wider security campaigns, ensuring that legacy code is brought up to modern standards. For those working within the Copilot app, the GitHub security extension provides a dedicated security canvas, allowing developers to manage these alerts and explore fixes without ever leaving their development environment.
Deep Scans for High-Stakes Releases
For the vast majority of development tasks, standard, automated checks are sufficient. However, there are scenarios—such as the final stages of a major release, a compliance audit, or a critical update—where the standard limits on time and scope are insufficient. In these high-stakes moments, organizations cannot afford to leave any stone unturned.
For these situations, tools like "Deep Scan," currently in private preview, represent the next frontier. Powered by Microsoft’s "Codename MDASH" technology, Deep Scan is designed for deep-dive investigations. Like the Standard AI Scan, it can be initiated with a simple click on a repository. Its primary purpose is to provide an exhaustive security evaluation when the risks associated with a potential vulnerability are at their highest. Crucially, the outputs from Deep Scan, Standard AI Scan, and CodeQL are all unified within the same dashboard, allowing teams to use agentic autofix workflows to resolve issues across the entire spectrum of security findings.
A New Standard for Secure Development
The integration of these tools marks a significant shift in how security is perceived in the software development lifecycle. The objective is no longer to find a single "green check" that certifies an entire codebase as secure, but rather to create a multi-layered, ongoing process of verification. By combining focused local reviews, comprehensive PR checks, and hybrid, system-wide scans, developers can maintain a clear, manageable path from the detection of a vulnerability to the implementation of a peer-reviewed fix.
This evolution in security tooling reflects a reality where AI is no longer just a coding assistant but a core component of the development engine. As organizations continue to scale their use of AI agents, the ability to maintain a secure, resilient, and high-velocity workflow will depend on these integrated security loops. By putting security at the center of the development experience—from the first local change to the final production release—teams can leverage the power of AI while ensuring the integrity of the software they build for the future. The next time a developer works with an AI agent, the most effective security measure is to initiate a /security-review before the code ever leaves the local machine, starting a process of security that continues throughout the entire life of the project.

