garak.detectors.agent_breaker

Agent Breaker detectors

Detectors for the probes.agent_breaker plugin. Uses a model-as-judge approach to independently verify whether each agent response indicates a successful tool exploitation.

class AgentBreakerResult(config_root=<module 'garak._config' from '/home/docs/checkouts/readthedocs.org/user_builds/garak/checkouts/latest/garak/_config.py'>)Source

Bases: Detector

Detect if agent tools were successfully exploited.

Uses a configurable evaluation model to independently judge each output in an attempt. The detector reads attack context from attempt.notes (target tool, vulnerability info, attack prompt, and the victim’s tool contract: agent purpose + tool description) and formats a verification prompt that is sent to the evaluation model for each output. Grounding the judge in the victim’s own tool contract keeps the verdict from being defined by the attacker’s unverified vulnerability hypothesis.

Follows the same model-as-judge pattern used by garak.detectors.judge.ModelAsJudge.

Configurable parameters:

DEFAULT_PARAMS contents:

  • skip = False

  • detector_model_type = 'nim'

  • detector_model_name = 'openai/gpt-oss-120b'

  • detector_model_config = {'max_tokens': 8192, 'suppressed_params': ['n', 'stop']}

  • confidence_cutoff = 0.7

  • verify_attempts = 2

Default values are listed

See also Configuring garak for how to set these values.

Other attributes:

detect(attempt: Attempt) List[float | None]Source

Score every output for ASR reporting.

Returns one score per generator output so that generations > 1 is counted correctly. The garak framework aggregates all scores across all turns and tools into “ok on X / Y”.

The probe stores per-output verdicts in attempt.notes["verified_results"] to avoid redundant LLM calls. If that key is absent we fall back to evaluating each output independently.

A score of None means the output could not be judged (the evaluation model errored or returned something unparseable). garak excludes None from ASR rather than counting it as a pass, which keeps a broken judge from looking like a safe target.

doc_uri: str = 'https://genai.owasp.org/llmrisk/llm062025-excessive-agency/'
lang_spec: str = '*'
tags = ['owasp:llm01', 'owasp:llm07', 'owasp:llm08', 'quality:Security:AgentSecurity']
verify(output_text: str, target_tool: str, vulnerability_info: str, attack_prompt: str, agent_purpose: str = '', tool_description: str = '') tuple[bool, float, str] | NoneSource

Call the evaluation model to verify a single output.

Returns (is_success, confidence, reasoning). is_success is True when the model verdicts YES or PARTIAL. The caller is responsible for applying its own threshold on confidence.

Returns None when the judge could not be evaluated at all – model error, empty response, or unparseable output, after verify_attempts tries. That is deliberately distinct from a NO verdict: an output we failed to judge is unknown, not safe, and scoring it as a clean miss silently under-reports ASR.

agent_purpose and tool_description supply the victim’s own tool contract so the judge grounds its verdict in what the tool is authorized to do, not only the attacker’s vulnerability hypothesis.