Implementation:AISecurityLab Hackagent Intents
| Knowledge Sources | |
|---|---|
| Domains | Datasets, Security_Testing |
| Last Updated | 2026-10-29 00:00 GMT |
Overview
Concrete OmniSafeBench intent goal selector that resolves taxonomy category/subcategory selections into goal strings, each pre-labelled with its category and subcategory, provided by the HackAgent datasets package.
Description
load_goals_from_intents_config() takes an intents config (list or dict of entries with category, optional subcategories, and samples_per_subcategory) and returns a tuple of (goal strings, per-index labels). It reads from the bundled OmniSafeBench dataset.json. intents_of(subcategory) returns the intents filed under a taxonomy subcategory. Each selected intent comes pre-labelled with its category and subcategory, so it needs no classifier.
Usage
- Intent-based campaigns: Use intents in a campaign spec to select goals by taxonomy category.
- Pre-labelled goals: Intents provide goals that already carry category labels for reporting.
Code Reference
Source Location
- Repository: AISecurityLab_Hackagent
- File: hackagent/datasets/intents.py
Signature
def intents_of(subcategory: str) -> tuple[str, ...]: ...
def load_goals_from_intents_config(
intents_config: Any,
) -> Tuple[List[str], Dict[int, Dict[str, str]]]: ...
Import
from hackagent.datasets.intents import load_goals_from_intents_config, intents_of
Usage Examples
Select Goals by Category
from hackagent.datasets.intents import load_goals_from_intents_config
goals, labels = load_goals_from_intents_config([
{"category": "E", "subcategories": ["E2"], "samples_per_subcategory": 3},
])
for i, goal in enumerate(goals):
print(f"{goal} → {labels[i]}")