15 Best Free AI Security Tools on GitHub (2026): Open-Source Picks

The 15 best free, open-source AI security tools on GitHub in 2026 for testing chatbots, adding guardrails, scanning models and AI pentesting.

15 Best Free AI Security Tools on GitHub (2026)

AI is now part of almost every app, and attackers have noticed. Prompt injection, jailbreaks, data leaks from chatbots and booby-trapped model files are real risks. The good news: some of the best tools for finding these problems are free and open source on GitHub, many of them built by NVIDIA, Microsoft, Meta and Google.

We checked every repository below on November 16, 2026 to confirm it is still maintained and to note its licence. Several popular tools that still appear in other “best of” lists are now archived, so we’ve flagged those at the end. For every tool’s details in one place, see our AI Security Tools Directory.

Top picks at a glance

If you want to…Start with
Quickly scan a chatbot or LLM for common attacksgarak (NVIDIA)
Run a serious AI red-team exercisePyRIT (Microsoft)
Add AI security tests to your CI/CD pipelinepromptfoo
Block prompt injection and unsafe output in productionNeMo Guardrails (NVIDIA)
Check a downloaded model file before loading itModelScan
Use AI to help with an authorised pentestStrix or PentestGPT
Detect disguised files with machine learningMagika (Google)

Test your AI app: red teaming and vulnerability scanners

1. garak by NVIDIA

garak is often described as “nmap for LLMs”. Point it at a model or chatbot and it runs probes for prompt injection, jailbreaks, data leakage, hallucination and toxic output, then tells you which attacks succeeded. It’s the easiest first scan for most teams. Licence: Apache-2.0. Install: python -m pip install -U garak · GitHub

2. PyRIT by Microsoft

Built by the Microsoft AI Red Team, PyRIT automates scans and adaptive multi-turn attacks against generative AI systems and supports human-led testing. Best for security teams that want structured, repeatable exercises. Note that the project has moved from Azure/PyRIT to microsoft/PyRIT. Licence: MIT · GitHub

3. promptfoo

A developer-friendly command-line tool for testing and red-teaming prompts, models and AI apps. You describe tests in a config file and run them on every code change, so a risky prompt change gets caught before release. Licence: MIT. Install: npm install -g promptfoo · GitHub

4. DeepTeam by Confident AI

A red-teaming framework that simulates jailbreaks, prompt injection and multi-turn exploits against agents, RAG pipelines and chatbots, looking for problems like PII leakage, bias and SQL injection. It runs locally on your machine. Licence: Apache-2.0. Install: pip install -U deepteam · GitHub

5. Agentic Security

A vulnerability scanner for LLMs and agent workflows with multimodal attacks (text, image and audio), multi-step jailbreaks and fuzzing. Useful for stress-testing an LLM API. Licence: Apache-2.0. Install: pip install agentic_security · GitHub

6. Giskard

Testing for AI agents and LLM apps, including a vulnerability scanner. Version 3 is a rewrite for dynamic, multi-turn agent testing, and version 2 is no longer maintained, so make sure you use v3. Licence: Apache-2.0. Install: pip install "giskard[scan]" · GitHub

Protect your AI app: guardrails and AI firewalls

7. NeMo Guardrails by NVIDIA

Adds programmable “rails” around an LLM app: keep conversations on approved topics, block jailbreak attempts and check inputs and outputs. A strong fit for customer-facing chatbots. Licence: Apache-2.0. Install: pip install nemoguardrails · GitHub

8. Guardrails AI

Validates LLM inputs and outputs with reusable validators for PII, toxic language, regex patterns, output schemas and more, from a public hub. Good when you need targeted checks rather than a full policy engine. Licence: Apache-2.0. Install: pip install guardrails-ai · GitHub

9. Purple Llama by Meta

Meta’s AI safety and security project. It includes Llama Guard (a content safety classifier), Prompt Guard (prompt-injection detection), LlamaFirewall, CodeShield (filters insecure AI-generated code) and the CyberSecEval benchmarks. Licence: Llama Community License. It’s free to use but has conditions, so read the terms. · GitHub

Secure your models: ML supply-chain tools

10. ModelScan by Protect AI

Model files downloaded from public hubs can contain code that runs the moment you load them (a “model serialization attack”). ModelScan checks formats such as Pickle, H5 and SavedModel before you load them. It’s updated less often than the others, so check for recent releases. Licence: Apache-2.0. Install: pip install modelscan · GitHub

11. Adversarial Robustness Toolbox (ART)

A comprehensive library, hosted by the Linux Foundation AI & Data, for evasion, poisoning, extraction and inference attacks against ML models, and the defences against them. Aimed at data scientists and researchers. Licence: MIT. Install: pip install adversarial-robustness-toolbox · GitHub

AI-assisted pentesting (authorised use only)

Important: only use these tools on systems you own or have written permission to test. Testing anyone else’s systems is illegal in the US and most countries.

12. Strix

Autonomous AI agents that test your application for vulnerabilities, confirm them and suggest fixes. It integrates with GitHub Actions to scan pull requests, which makes it a good fit for development teams. Licence: Apache-2.0 · GitHub

13. PentestGPT

An AI-powered penetration testing agent first published as research at USENIX Security 2024, now with an autonomous, agentic workflow in version 1.0. Popular for learning and for lab or CTF practice. Licence: MIT · GitHub

14. Nebula by BerylliumSec

An AI-assisted workspace that keeps an engagement’s assets, browser sessions, Kali terminals, notes and findings together. It works with several AI models, including local models through Ollama. Licence: BSD-2-Clause · GitHub

AI for defence

15. Magika by Google

Uses a small deep-learning model to identify a file’s true type, even when it’s renamed or disguised. Google uses it at scale to route Gmail, Drive and Safe Browsing files to the right security scanners. Useful in upload filters and malware triage. Licence: Apache-2.0. Install: pip install magika · GitHub

How to choose the right tool

  • Just curious, or testing a model: start with garak for a quick baseline.
  • Building an AI app: add promptfoo to your tests, and NeMo Guardrails or Guardrails AI at runtime.
  • Security team running assessments: use PyRIT or DeepTeam for deeper, multi-turn red teaming.
  • Downloading open-source models: scan them with ModelScan before you load them.
  • Customer-facing chatbot: NeMo Guardrails keeps it on approved topics and blocks jailbreak attempts.

Popular tools we left out (and why)

  • LLM Guard (Protect AI): archived and no longer maintained.
  • CAI (Cybersecurity AI): archived.
  • Rebuff and Vigil: no updates since January 2024.

Unmaintained security tools miss new attack techniques and may carry unfixed bugs, so avoid them for new projects even if they still rank well in search results.

How to start safely

  1. Test your own systems only, and use a staging copy of your AI app, not production.
  2. Install in an isolated environment: a Python virtual environment, a container or a test VM.
  3. Read the project’s README and code before running anything, as you should with any open-source security tool.
  4. Give AI agents the least access possible: limited API keys, no production credentials.
  5. Watch your API costs. Red-team tools can send thousands of requests to paid AI APIs.
15 best free AI security tools on GitHub, including garak, PyRIT, NeMo Guardrails and ModelScan
Save this list to Pinterest for later.

Frequently asked questions

What’s the best free tool to test a chatbot for prompt injection?

For a quick, broad scan, start with garak. If you want tests that run automatically on every code change, use promptfoo. For deeper, multi-turn red teaming, try PyRIT or DeepTeam.

Are these tools really free?

Yes, the code is free and open source. Some companies behind them also sell paid cloud platforms, and testing a paid AI model through its API will cost API credits. Purple Llama uses Meta’s Llama licence, which is free but has conditions.

Do I need to be a programmer to use them?

Most need basic comfort with the command line and Python. If you just want to check your own website’s security without installing anything, try our free online security tools.

Repository activity and licences checked on November 16, 2026. Projects change quickly, so always confirm details on each project’s GitHub page. Want to suggest a tool? Contact us.

Put it into practice

20+ free security tools. No sign-up, nothing to install.

Keep reading