Implementation:AISecurityLab Hackagent Buckets
| Knowledge Sources | |
|---|---|
| Domains | Storage, Evaluation |
| Last Updated | 2026-10-29 00:00 GMT |
Overview
Concrete classification function mapping evaluation outcomes into reporting buckets (jailbreak, mitigated, error, pending), shared by the local backend, TUI, and web UI, provided by the HackAgent storage package.
Description
'result_bucket(status, notes) classifies a result into one of four buckets: JAILBREAK (SUCCESSFUL_JAILBREAK), MITIGATED (FAILED_JAILBREAK or PASSED_CRITERIA), ERROR (FAILED_CRITERIA, ERROR, or "failed with exception" in notes), or PENDING (unknown). The classification lives next to storage because every consumer needs the same logic.
Usage
- LocalBackend: count_result_buckets uses result_bucket().
- TUI/Web UI: Run summaries display bucket counts.
Code Reference
Source Location
- Repository: AISecurityLab_Hackagent
- File: hackagent/storage/buckets.py
Signature
JAILBREAK = "jailbreak"
MITIGATED = "mitigated"
ERROR = "error"
PENDING = "pending"
def result_bucket(status: Optional[str], notes: Optional[str] = None) -> str: ...
Import
from hackagent.storage.buckets import result_bucket, JAILBREAK, MITIGATED, ERROR, PENDING
Usage Examples
Classify a Result
from hackagent.storage.buckets import result_bucket
bucket = result_bucket("SUCCESSFUL_JAILBREAK")
print(bucket) # "jailbreak"
bucket = result_bucket("FAILED_JAILBREAK")
print(bucket) # "mitigated"