{
  "id": 23163383,
  "title": "How do you build securely when AI is writing more of the code?",
  "url": "https://urgent.news/2026/12/02/how-do-you-build-securely-when-ai-is-writing-more-of-the-code",
  "topic": "ai",
  "section": "AI",
  "published": "2026-12-02T18:30:34.000Z",
  "source": {
    "name": "GitHub Blog",
    "slug": "github-blog",
    "url": "https://blog.github.com/security/application-security/how-do-you-build-securely-when-ai-is-writing-more-of-the-code/"
  },
  "original_language": null,
  "account": "As AI-generated code becomes more prevalent in software development, ensuring that the code is secure is becoming increasingly important. GitHub has implemented various security checks and analysis tools to address this concern. When an AI agent makes changes to the code, it is crucial to verify that the code is secure before it is shipped.\n\nGitHub's built-in security checks and analysis tools help developers check code as they build and review changes before merging them. The platform provides various analysis methods, including CodeQL and AI Scanning, which work together to detect potential vulnerabilities across different languages and vulnerability patterns.\n\nEven though an AI agent claims its work is finished, this does not guarantee the security of the code. It is possible for an agent to generate vulnerable code, expose secrets, or recommend non-existent dependencies. For instance, in the case of a PHP search endpoint where the agent directly inserts search text into SQL queries, a security risk arises if the search text can manipulate the SQL query, allowing attackers to gain unauthorized access to data.\n\nTo mitigate such risks, GitHub offers a local security review through the Copilot app, Copilot CLI, or Copilot Chat in VS Code. This review checks the local changes made by the agent and provides prioritized findings and remediation suggestions. In our example, the review might flag SQL injection as a potential vulnerability and suggest using parameterized queries to separate SQL instructions from the user's search value.\n\nEven after a local review, there is still a chance that the pull request might still contain security issues, as reviewers can introduce their own changes that introduce new risks. Therefore, GitHub Code Security's pull request checks, powered by CodeQL, are essential. CodeQL builds a database representation of the code and runs queries over this representation to identify potential problems. AI Scanning, on the other hand, uses agents to explore the repository and reason about the code's functionality, enabling it to identify unfamiliar attack patterns and vulnerabilities in additional languages.\n\nIt is important to note that pull request checks only examine new or changing code, leaving older code unscanned. This means that even if a piece of code has been deemed safe in the past, it may still contain vulnerabilities as attackers discover new techniques. In our example, older parts of the application that build database queries are also vulnerable and not subject to pull request checks.\n\nTo address this issue, Standard AI Scan can be run on the default branch of the repository. This scan uses a proprietary harness with multiple models to examine language-specific files and functions, providing additional security checks for languages not covered by CodeQL. The findings from the repository AI Scan are then integrated into the code scanning backlog alongside CodeQL alerts, allowing developers to assign alerts, link issues, and apply autofix workflows.\n\nFor critical projects, regular scanning is essential. While the checks previously mentioned are sufficient for most work, more extensive scanning may be required in situations like major releases or audits. GitHub's tools provide a comprehensive approach to securing code as AI-generated code becomes increasingly common in the software development landscape.",
  "summary": "AI writes more code, faster, but security still needs your judgment. See how GitHub combines static and AI-powered security analysis, right where you work.",
  "summary_source": "publisher",
  "key_points": [],
  "editors_take": null,
  "opinion": false,
  "illustration": null,
  "coverage": {
    "outlets": 1,
    "outlets_capped": false,
    "also_reported_by": []
  },
  "machine_translated": false,
  "ai_generated": true,
  "disclaimer": "Accounts, briefs, key points, the editor’s take and translations are written by software from other outlets’ reporting and may contain errors. A summary whose summary_source is \"publisher\" is the outlet’s own feed text. Always check the linked original."
}