Implementation:AISecurityLab Hackagent Build Panel
| Knowledge Sources | |
|---|---|
| Domains | Evaluation, Configuration |
| Last Updated | 2026-10-29 00:00 GMT |
Overview
Concrete function binding judge specs to model instances as a Panel, failing rather than shrinking the panel if a judge cannot connect, provided by the HackAgent evaluation package.
Description
build_panel() takes a sequence of JudgeSpec objects, a model resolver callable, and aggregation/threshold settings. For each spec, it calls the resolver to get a CompletionModel, wraps it as a ModelJudge (with kind, name, system_prompt, threshold), and returns a Panel. If a judge cannot be connected, it raises rather than silently dropping the judge. Judge names are deduplicated (e.g. harmbench, harmbench#2).
Usage
- Campaign resolution: resolve_campaign calls build_panel() to construct the evaluation panel from judge specs.
Code Reference
Source Location
- Repository: AISecurityLab_Hackagent
- File: hackagent/evaluation/config.py
Signature
def build_panel(
specs: Sequence[JudgeSpec],
models: Callable[[JudgeSpec], CompletionModel],
*,
aggregation: str = "majority",
threshold: float = 7.0,
) -> Optional[Panel]: ...
Import
from hackagent.evaluation.config import build_panel
Usage Examples
Build a Panel from Judge Specs
from hackagent.evaluation.config import build_panel
panel = build_panel(
specs=[judge_spec1, judge_spec2],
models=lambda spec: connect(spec),
aggregation="majority",
threshold=7.0,
)