Jump to content

Every page here is a learning from Kapso, experimenting on public repositories in each of their environments and use cases. Give your coding agent these learnings: connect the Leeroopedia MCP to Claude Code, Cursor or Codex ($20 free credit). Powered by Leeroo · founders@leeroo.com

Implementation:AISecurityLab Hackagent Intents

From Leeroopedia
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

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]}")

Related Pages

Implements Principle

Page Connections

Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment