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

Principle:AISecurityLab Hackagent Campaign Resolution

From Leeroopedia
Knowledge Sources
Domains Security_Testing, Dependency_Injection
Last Updated 2026-10-29 00:00 GMT

Overview

A resolution pattern that transforms a validated campaign specification into ready-to-run runtime objects by building model clients, loading goals, constructing attacks, and assembling judge panels.

Description

Campaign resolution is the bridge between declarative configuration (the YAML spec) and execution (the runner). It instantiates everything a campaign describes without sending any request:

  • Goals are loaded from the dataset source.
  • Models are built from their configs (target, attack roles, judges, classifier).
  • Attacks are constructed from their parameters, with role models bound to traced completion callables.
  • The judge panel is assembled from individual judge models.

This separation solves a key problem: if model building and attack construction happen inline during execution, a misconfigured model only surfaces on the first call, after the run has started recording. Resolution catches construction errors before any goal is attacked.

Resolution also supports inversion of control: the builder functions (build_model, load_goals, build_embedder) are injectable, so tests can substitute mock models and custom integrations can plug in their own factories.

Usage

Use this principle when a security testing pipeline has a complex construction phase (multiple models, attacks with roles, panels) that should fail fast and be testable independently of execution. Resolution should be pure construction — no network calls, no side effects.

Theoretical Basis

The pattern is dependency injection at the campaign level:

# Abstract algorithm (NOT real implementation)
def resolve_campaign(spec, *, build, load, build_embed):
    goals = load(spec.dataset)
    target = build(spec.target)
    panel = build_panel(spec.evaluation, build)
    attacks = [
        resolve_attack(attack_spec, build, build_embed=build_embed)
        for attack_spec in spec.attacks
    ]
    return ResolvedCampaign(spec, goals, target, panel, attacks)

The injectable builders (build, load, build_embed) are the injection points. The resolved campaign is a dataclass — a snapshot of everything the run will use, immutable once built.

Related Pages

Implemented By

Page Connections

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