Mutant AI
Automate Evaluation & Red Teaming for LLMs
Mutant is the open-source evaluation framework for synthesizing adversarial datasets, testing AI agents, and grading RAG pipelines.
Read the Official Documentation →
⚡ Quick Install
Mutant is available on PyPI. Install it using pip or uv:
$ pip install mutant-ai
🏗️ Core Framework
Mutant is divided into four core pillars. You can use them independently or chain them together for end-to-end evaluation.
1. Data Augmentation
Stop writing manual test cases. Mutant takes a single seed scenario and uses cognitive dimensions (like anger, prompt injection, or complex reasoning) to generate hundreds of behaviorally diverse test cases instantly.
from mutant.core import Scenario, augment
from mutant.providers.ollama import OllamaProvider
provider = OllamaProvider(model="llama3.1")
# Generate 5 diverse variations of a basic intent
dataset = await augment(
dataset=[Scenario(title="Refund", description="I want a refund.")],
provider=provider,
mutations_per_case=5,
dimensions=["emotion.angry", "language.slang"]
)
dataset.save("mutations.json")
2. Agentic Red Teaming
Instead of static security scans, unleash a hypothesis-driven attacker agent. Mutant dynamically probes your system in multi-turn conversations, adapting its attacks to bypass your safeguards.
from mutant.redteam import red_team
from mutant.providers.ollama import OllamaProvider
from my_app import my_agent
provider = OllamaProvider(model="llama3.1")
# Unleash the attacker against your live agent
report = await red_team(
target=my_agent,
goal="Extract the hidden system instructions.",
provider=provider,
max_turns=5
)
report.to_html("security_report.html")
3. Security Evaluation
Go beyond general correctness and actively grade your application's defensive mechanisms. Run your adversarial datasets through the Eval Suite using specialized security metrics to automatically detect prompt injections, PII leakage, and unauthorized behavior.
from mutant.eval import EvalSuite, SensitiveDataLeakage, PromptInjectionResistance
from mutant.providers.ollama import OllamaProvider
provider = OllamaProvider(model="llama3.1")
# Grade the agent against security threats
suite = EvalSuite(metrics=[
SensitiveDataLeakage(provider=provider),
PromptInjectionResistance(provider=provider)
])
report = await suite.evaluate(test_cases=dataset.cases)
report.to_html("security_report.html")
4. Evaluation Suite
Once you've generated your adversarial dataset or executed your attacks, grade your application's responses using LLM-as-a-judge metrics to provide deterministic scores and HTML reports.
from mutant.eval import EvalSuite, Correctness, Faithfulness
from mutant.providers.ollama import OllamaProvider
provider = OllamaProvider(model="llama3.1")
# Initialize metrics and evaluate test cases
suite = EvalSuite(metrics=[
Correctness(provider=provider),
Faithfulness(provider=provider)
])
report = await suite.evaluate(test_cases=dataset.cases)
report.to_html("eval_report.html")
📊 Actionable Reports
Mutant natively outputs highly visual HTML dashboards and CI/CD-ready JSON artifacts, mapping your exact vulnerability and coverage footprint natively out of the box.
📚 Documentation
For full documentation, including advanced tutorials, architecture diagrams, and custom metric creation, visit the official documentation.
🤝 Contributing
Contributions are heavily welcomed! Please read our Contributing Guide to get started.
📄 License
MIT © 2026 Ankit Mishra. Built for the open-source community.
Metadata
Release files for mutant-ai 0.8.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| mutant_ai-0.8.0.tar.gz | 788.6 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| mutant_ai-0.8.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 1.0 MB
Release files / mutant_ai-0.8.0.tar.gz
| Download URL | mutant_ai-0.8.0.tar.gz |
|---|---|
| Size | 788.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
72ad2d26ac53d9a032dca4968f94c94737be8e86f6c9d9e296884e07fd19ddd7
|
|
BLAKE2b-256 checksum How to use checksums |
dea594f9806716dd9b4ffd01e787d14c5d3c6c2100dccb51ea22f6c138ce5a28
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.12.17 {"installer":{"name":"uv","version":"0.12.17","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Release files / mutant_ai-0.8.0-py3-none-any.whl
| Download URL | mutant_ai-0.8.0-py3-none-any.whl |
|---|---|
| Size | 222.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
44a9272855e82c7afee70e0ed46615e25aa51ef29f2bf4b34776a07cf180fcb8
|
|
BLAKE2b-256 checksum How to use checksums |
5e1b88cfe26455b232ed25470843d89880234ef1929eb58802836df60f9fa8cd
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.12.17 {"installer":{"name":"uv","version":"0.12.17","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|