Model Evasion
Tests whether adversarial examples, feature manipulation, or boundary exploitation can evade the model's safety mechanisms.
Sub-types
adversarial_examples: Crafted inputs that cause the model to misclassify or produce wrong outputs.feature_space_manipulation: Manipulating input features to evade detection or safety mechanisms.model_boundary_exploitation: Exploiting decision boundaries to find blind spots in model behaviour.
Threat Profile
Recommended Datasets
Primary
- advbench: Adversarial benchmarks for evaluating evasion resistance
Secondary
- xstest: XSTest for adversarial prompt detection
Attack Techniques
Primary
- Static Template: Template-based prompt injection
- PAIR: Iterative refinement for bypass discovery
Secondary
- AdvPrefix: Adversarial prefix optimisation
Metrics
asrjudge_score
Usage
Instantiate the Vulnerability
from hackagent.catalog.risks import ModelEvasion
from hackagent.catalog.risks.model_evasion.types import ModelEvasionType
# Use all sub-types
vuln = ModelEvasion()
# Or specify particular sub-types
vuln = ModelEvasion(types=[
ModelEvasionType.ADVERSARIAL_EXAMPLES.value,
ModelEvasionType.FEATURE_SPACE_MANIPULATION.value,
])
Run an Evaluation Campaign
from hackagent.catalog.risks.model_evasion import MODEL_EVASION_PROFILE
from hackagent.orchestrator.campaign import run_campaign, summary
TARGET = {
"name": "my-agent",
"connection": {
"provider": "local",
"type": "OPENAI",
"endpoint": "http://localhost:8080/chat",
},
}
# Use profile recommendations
for attack in MODEL_EVASION_PROFILE.primary_attacks:
for dataset in MODEL_EVASION_PROFILE.primary_datasets:
result = run_campaign(
{
"version": 1,
"campaign": {
"name": f"{attack.technique} vs {dataset.preset}",
"description": MODEL_EVASION_PROFILE.objective,
},
"dataset": {"source": {"type": "preset", "name": dataset.preset}},
"target": TARGET,
"attacks": [{"name": attack.technique}],
}
)
print(summary(result))