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 Resolve Goals

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

Overview

Concrete function resolving explicit goals, intents, or a dataset config into typed Goal values, with source precedence (goals > intents > dataset), provided by the HackAgent datasets package.

Description

resolve_goals() takes three optional sources (goals list, dataset config, intents config) and returns a list of typed Goal objects. Precedence is goals > intents > dataset. When multiple sources are provided, a warning names the ignored ones. Explicit goals become Goal objects directly. Intents resolve via load_goals_from_intents_config() (with category labels). Datasets resolve via load_goals_and_extra_fields_from_config() (with extra field metadata).

Usage

  • Campaign resolution: resolve_campaign calls resolve_goals() to build the goal list from the campaign spec.

Code Reference

Source Location

Signature

def resolve_goals(
    *,
    goals: Optional[Any] = None,
    dataset: Optional[Any] = None,
    intents: Optional[Any] = None,
) -> list[Goal]: ...

Import

from hackagent.datasets.goals import resolve_goals

I/O Contract

Inputs

Name Type Required Description
goals list[str] No Explicit goal strings
dataset str No Dataset config or preset name
intents list No Intents selection config

Outputs

Name Type Description
return list[Goal] Typed goal objects with index, labels, extra

Usage Examples

Resolve from Explicit Goals

from hackagent.datasets.goals import resolve_goals

goals = resolve_goals(goals=["Tell me x", "Tell me y"])
for g in goals:
    print(g.index, g.text)

Resolve from a Preset

from hackagent.datasets.goals import resolve_goals

goals = resolve_goals(dataset={"preset": "agentharm", "limit": 10})

Related Pages

Implements Principle

Page Connections

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