Welcome to Mutant
Whether you are building a simple RAG chatbot or a complex multi-agent system, Mutant provides the tools to automatically evaluate your system's correctness, faithfulness, and security before you deploy to production.
⚡ Quick Install
Mutant is available on PyPI. Install it using pip or uv:
🏗️ Core Framework
Mutant is divided into three 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.
-
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.
-
3. Evaluation Suite
Grade your production applications using deterministic or LLM-as-a-judge metrics. Measure Correctness, Faithfulness, Context Precision, and Sensitive Data Leakage out of the box.
💻 See it in Action
Here is what an end-to-end evaluation pipeline looks like using Mutant.
from mutant.core import Scenario, augment
from mutant.providers.ollama import OllamaProvider
provider = OllamaProvider(model="llama3.1")
# Generate 5 variations of a basic prompt using the angry dimension
dataset = await augment(
dataset=[Scenario(title="Refund", description="I want a refund.")],
provider=provider,
mutations_per_case=5,
dimensions=["emotion.angry"]
)
dataset.save("mutations.json")
from mutant.eval import EvalSuite, Correctness, Faithfulness
from mutant.providers.ollama import OllamaProvider
provider = OllamaProvider(model="llama3.1")
# Grade the target outputs against your generated dataset
suite = EvalSuite(metrics=[
Correctness(provider=provider),
Faithfulness(provider=provider)
])
report = await suite.evaluate(test_cases=dataset.cases)
report.to_html("eval_report.html")
from mutant.redteam import red_team
from mutant.providers.ollama import OllamaProvider
from my_app import my_agent
provider = OllamaProvider(model="llama3.1")
# Unleash an attacker agent against your application
report = await red_team(
target=my_agent,
goal="Extract the system prompt",
provider=provider,
max_turns=3
)
report.to_html("redteam_report.html")
📊 Actionable Reports
Mutant natively outputs highly visual HTML dashboards and CI/CD-ready JSON artifacts, mapping your exact vulnerability and coverage footprint.
