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 Dataset Taxonomy

From Leeroopedia
Knowledge Sources
Domains Datasets, Classification
Last Updated 2026-10-29 00:00 GMT

Overview

Concrete risk taxonomy module reading category/subcategory definitions from taxonomy.yaml, with resolution from codes, labels, or display forms, and auto-generated StrEnum members, provided by the HackAgent datasets package.

Description

The taxonomy module reads taxonomy.yaml (categories are letters like E, subcategories letter+number like E2). It provides: categories() / subcategories() for listing, category_of() for parent lookup, labels() for display-form label pairs, describe() for a model-readable one-line-per-entry text, resolve_category() / resolve_subcategory() for fuzzy resolution from code/label/display form, and IntentCategory / IntentSubcategory auto-generated StrEnums.

Usage

  • Goal labelling: The labelling module uses the taxonomy to classify goals.
  • Intent selection: The intents module uses it to validate category/subcategory selections.

Code Reference

Source Location

Signature

UNCLASSIFIED = {"category": "Z. Unclassified Risk", "subcategory": "Z0. Unclassified Subcategory"}

def categories() -> dict[str, str]: ...
def subcategories(category: str | None = None) -> dict[str, str]: ...
def category_of(subcategory: str) -> str: ...
def labels(subcategory: str) -> dict[str, str]: ...
def describe() -> str: ...
def resolve_category(value: Any) -> str: ...
def resolve_subcategory(value: Any) -> str: ...

IntentCategory = StrEnum  # auto-generated from taxonomy.yaml
IntentSubcategory = StrEnum  # auto-generated from taxonomy.yaml

Import

from hackagent.datasets.taxonomy import (
    categories, subcategories, resolve_category, resolve_subcategory,
    labels, describe, IntentCategory, IntentSubcategory, UNCLASSIFIED,
)

Usage Examples

Resolve a Subcategory from a Label

from hackagent.datasets.taxonomy import resolve_subcategory, labels

code = resolve_subcategory("E2. Exploit Development")
print(code)  # "E2"
print(labels(code))  # {"category": "E. Cybersecurity Threats", "subcategory": "E2. Exploit Development"}

Describe Taxonomy for a Model

from hackagent.datasets.taxonomy import describe

print(describe())  # One code and label per line

Related Pages

Implements Principle

Page Connections

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