AI can do more than suggest code snippets
It’s easy to assume that large language models are only good for autocomplete or documentation generation. In reality, they can also act as a first line of defense against security flaws, especially when they are tightly integrated into a product’s build pipeline.

What changed at Mozilla?
Earlier this year Mozilla announced that the next‑generation model GPT‑6 Cyber, provided by OpenAI, is now a permanent component of Firefox’s security workflow. The model is wrapped in an open‑source toolchain called gpt6‑cyber‑scanner, which runs automatically on every pull request that touches the browser’s core code.
The scanner does three things:
- Looks for known vulnerable patterns, such as unsafe memory handling or insecure TLS configurations.
- Generates a short report that explains why the code is risky and suggests a concrete fix.
- Triggers a low‑severity alert in Mozilla’s internal bug tracker if the model’s confidence exceeds 85%.
Because the model is hosted on Mozilla’s own secure inference endpoint, no code is sent to external servers. This addresses a common privacy concern that many developers have about using cloud‑based AI.
Who benefits?
Developers get immediate feedback while they write code, similar to a linter but with a deeper understanding of security semantics. Security teams receive a prioritized list of potential issues, allowing them to focus on the hardest cases instead of triaging every single change. Firefox users see fewer zero‑day exploits because patches can be prepared and tested faster.
Practical steps you can take
If you maintain an open‑source project or a commercial product, you can adopt a similar approach without waiting for a custom model. Here’s a quick checklist:
- Identify the parts of your codebase that handle security‑sensitive operations.
- Set up an AI model that is trained on public vulnerability data (OpenAI offers a fine‑tuning API for this purpose).
- Integrate the model into your CI pipeline using a simple wrapper script.
- Make the model’s output part of the code review process, but keep a human in the loop for final approval.
Mozilla has published the gpt6‑cyber‑scanner repository under the MPL‑2.0 license, so you can clone it, adjust the rule set, and point it at your own repository.
Example: Running the scanner locally
# Clone the tool
git clone https://github.com/mozilla/gpt6-cyber-scanner.git
cd gpt6-cyber-scanner
# Install dependencies
pip install -r requirements.txt
# Scan a local directory
./scan.py --path ../my-firefox-fork
The command prints a JSON payload with each finding, the confidence score, and a suggested patch. You can pipe this into your CI system or use the --ci flag to have it fail the build automatically when the confidence is high.
Limitations you should keep in mind
No model is perfect. GPT‑6 Cyber still produces false positives, especially around complex C++ templates that it has never seen before. Mozilla mitigates this by requiring a senior security engineer to approve every auto‑generated fix before it lands.
Another limitation is model availability. The GPT‑6 Cyber endpoint is currently limited to a handful of partners, and the pricing model is still evolving. If you cannot access the exact same model, the same workflow works with smaller, open‑source models like CodeBERT, albeit with lower confidence.
Why it matters now
The web is moving faster than ever, and browsers are the biggest attack surface in everyday computing. Reducing the time between vulnerability discovery and patch release can save millions of users from exploitation. By automating the first pass of security review, Mozilla has shaved days off its typical patch cycle.
That speed does not replace thorough testing; it simply gives security teams more bandwidth to focus on the hardest problems.
Next steps for the community
Watch the short video that introduced the integration for a visual walkthrough: How Mozilla strengthens Firefox security with GPT‑6 Cyber. Then, try the scanner on a small component of your own project. Share your findings on the Mozilla forum or open a pull request to improve the rule set.
AI‑driven security is still in its early days, but the practical gains you can see in Firefox today prove that the technology is ready for production use. Start experimenting, keep a skeptical eye on the results, and you’ll likely find that the model catches more than you expected.