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 Endpoint Overrides

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

Overview

Concrete helpers for rewriting a campaign's model connection endpoints to point at run-time servers and waiting for local servers to become ready, provided by the HackAgent orchestrator package.

Description

EndpointOverrides is a frozen dataclass specifying run-time endpoints: ollama repoints all Ollama models, while openai / judge / attacker split by role for OpenAI-compatible overrides. ServerReadiness specifies how long to wait for local servers and the PIDs to watch. The helpers operate on the plain dict a CampaignSpec dumps to, so callers can edit connections in place and re-validate. The CLI campaign command and scripts/run_campaign.py both build on these.

Usage

  • CLI campaign runs: The CLI applies endpoint overrides to redirect models to local servers.
  • SLURM/notebook launches: Override endpoints at launch time without editing the campaign file.

Code Reference

Source Location

Signature

@dataclass(frozen=True)
class EndpointOverrides:
    ollama: Optional[str] = None
    openai: Optional[str] = None
    judge: Optional[str] = None
    attacker: Optional[str] = None
    def any_openai(self) -> bool: ...
    def any(self) -> bool: ...

@dataclass(frozen=True)
class ServerReadiness:
    wait_for_ollama: float = 0.0
    ollama_pid: Optional[int] = None
    wait_for_server: float = 0.0

Import

from hackagent.orchestrator.campaign.overrides import EndpointOverrides, ServerReadiness

Usage Examples

Override Endpoints for a Local Run

from hackagent.orchestrator.campaign.overrides import EndpointOverrides

overrides = EndpointOverrides(ollama="http://localhost:11434")
# Apply overrides to the campaign dict, then re-validate

Related Pages

Implements Principle

Page Connections

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