AegisLLM is a modular security benchmarking framework designed to evaluate, measure, and improve the security of Large Language Models (LLMs) against adversarial attacks and defensive controls.
Evaluate. Defend. Measure. Protect.
LLMs are increasingly used in applications, agents, automation, and decision-support systems. Their usefulness also creates a security problem: an attacker may try to manipulate the model into ignoring instructions, revealing restricted behavior, or producing responses that violate the intended security policy.
AegisLLM provides a structured way to test those risks instead of relying on a few manual prompts.
AegisLLM brings together:
Adversarial Attacks
β
LLM Evaluation
β
Security Metrics
β
Risk Analysis
β
Defense Evaluation
β
Regression Detection
β
Security Dashboard
This makes it possible to compare benchmark runs and understand whether an LLM's security posture is improving or getting worse.
AegisLLM currently provides evaluation for attack categories including:
- Prompt Injection
- Jailbreak Attacks
- Encoding-based Attacks
- Adaptive Attack Strategies
The framework is designed around a modular attack architecture so additional attack types can be added without rewriting the benchmark engine.
AegisLLM can evaluate attacks adaptively instead of treating every attack as a single attempt.
The adaptive workflow can:
- Send an initial attack.
- Evaluate the model response.
- Apply mutation strategies when required.
- Retry the modified attack.
- Record the number of attempts.
- Measure adaptive attack success.
This helps reveal attacks that may fail initially but succeed after controlled mutation.
Security testing is not only about finding attacks.
AegisLLM also evaluates defensive controls to answer:
Does a defense actually reduce successful attacks?
The framework includes rule-based defensive evaluation with configurable detection behavior.
Defense benchmarking can measure:
- Baseline attack success
- Defended attack success
- Attack success reduction
- Defense block rate
- Defense bypass behavior
- Category-level defense performance
- Benign prompt behavior
A defense that blocks every prompt is not necessarily a good defense.
AegisLLM therefore includes benign control evaluation to help identify unwanted blocking of legitimate prompts.
This makes it possible to consider both:
Security
+
Utility
β
Better Defensive Evaluation
AegisLLM provides measurable security results instead of only pass/fail output.
ASR = Successful Attacks / Total Attacks
A normalized risk score can be used to summarize the observed security risk of a benchmark run.
Attack performance can also be examined by category so that weaknesses are easier to identify.
Benchmark results include response latency, allowing security results to be considered together with model performance.
Security can change between model versions, prompts, defenses, or configurations.
AegisLLM supports comparing benchmark runs to detect security regressions.
This can help identify situations such as:
Previous Model
β
5% attack success
β
New Model
β
18% attack success
β
β οΈ Security Regression
Regression functionality can consider overall and category-level benchmark behavior.
AegisLLM includes an Ollama target adapter for evaluating locally running models.
Example model:
llama3.2:3b
The adapter communicates with the local Ollama API and supports configurable:
- Model name
- Ollama base URL
- Prompt generation
This makes local security experimentation possible without requiring a hosted LLM API.
AegisLLM generates an HTML dashboard for analyzing benchmark results.
The dashboard includes:
- Overall risk indicator
- Risk score
- Model information
- Total attacks
- Successful attacks
- Attack Success Rate
- Average latency
- Benchmark metadata
- Generation timestamp
- Category analysis
- Interactive category views
- Latency analysis and sorting
- Attack score analysis and sorting
- Attack result table
- Category filters
- Success/failure filters
- Attack search
- JSON export
- CSV export
- Empty states
- Responsive layout
- Section navigation
The dashboard is intended to make security benchmark results easier to inspect and communicate.
AegisLLM is organized into modular components:
ββββββββββββββββββββββββ
β AegisLLM β
ββββββββββββ¬ββββββββββββ
β
βββββββββββββββββββββββΌββββββββββββββββββββββ
β β β
βΌ βΌ βΌ
Attack Modules Benchmark Engine Defense Modules
β β β
β βΌ β
β Target Adapters β
β β β
β βΌ β
β LLM β
β β β
βββββββββββββββββββββββΌββββββββββββββββββββββ
βΌ
Evaluators & Metrics
β
ββββββββββββββββββββΌβββββββββββββββββββ
βΌ βΌ βΌ
Risk Regression Exports
β β β
ββββββββββββββββββββΌβββββββββββββββββββ
βΌ
HTML Dashboard
aegis/
βββ attacks/ # Adversarial attack definitions
βββ adaptive/ # Adaptive attack execution and mutation
βββ benchmark/ # Benchmark execution and metrics
βββ defenses/ # Defensive evaluation
βββ evaluators/ # Response evaluation strategies
βββ targets/ # LLM target adapters
βββ dashboard/ # HTML dashboard generation
tests/
βββ ... # Automated project test suite
A typical AegisLLM security evaluation follows this flow:
1. Select LLM Target
β
2. Select Attack Dataset
β
3. Execute Attacks
β
4. Evaluate Responses
β
5. Calculate Security Metrics
β
6. Calculate Risk
β
7. Evaluate Defense
β
8. Compare Benchmark Runs
β
9. Export Results
β
10. Inspect Dashboard
git clone https://github.com/PIXELL07/AegisLLM.git
cd AegisLLMpython3 -m venv .venvActivate it:
source .venv/bin/activatepip install -e .python -m pytest -qCurrent project checkpoint:
265 tests passed
The automated test suite covers major project areas including:
- Benchmark execution
- Attack handling
- Adaptive attacks
- Evaluators
- Category metrics
- Risk scoring
- Defense benchmarking
- Benign controls
- Offline evaluation
- Result exports
- Regression detection
- Dashboard generation
- Dashboard interactions
- Ollama target behavior
- CLI functionality
Run all tests with:
python -m pytest -q| Capability | Status |
|---|---|
| Prompt Injection Evaluation | β |
| Jailbreak Evaluation | β |
| Encoding Attacks | β |
| Adaptive Attacks | β |
| Attack Dataset Support | β |
| Exact Evaluator | β |
| Contains Evaluator | β |
| Risk Scoring | β |
| Category Metrics | β |
| Defense Benchmarking | β |
| Benign Control Evaluation | β |
| Offline Evaluation | β |
| Security Regression Detection | β |
| Regression Thresholds | β |
| JSON Export | β |
| CSV Export | β |
| Ollama Target | β |
| HTML Dashboard | β |
| Interactive Dashboard | β |
| Attack Search and Filters | β |
| Automated Test Suite | β |
AegisLLM is useful when an LLM needs to be evaluated as a security-sensitive component, rather than only as a language-generation system.
It can help teams:
- Find weaknesses before deployment.
- Compare different models.
- Measure attack resistance.
- Evaluate defensive controls.
- Detect security regressions between runs.
- Understand which attack categories are most effective.
- Test locally running LLMs.
- Produce reproducible benchmark results.
- Communicate security findings through a dashboard.
In short:
AegisLLM turns LLM security testing into a repeatable benchmarking process.
The architecture is designed to support future additions such as:
- More LLM providers
- Additional attack categories
- Additional defense strategies
- More sophisticated adaptive attack mutations
- Expanded security metrics
- More detailed benchmark comparison
- Additional dashboard visualizations
These are extension points rather than requirements for the current framework.
AegisLLM is intended for:
- Security research
- Authorized testing
- Defensive development
- Academic experimentation
- LLM robustness evaluation
Only evaluate models and systems that you own or have explicit permission to test.
The results of a benchmark depend on the selected model, attack dataset, evaluator, defense configuration, and benchmark settings. A benchmark result should therefore be interpreted as an evaluation of the tested configuration, not as a guarantee of overall model security.
See the repository's license information for the applicable terms.