Choosing garak detectors and model-as-judge scoring for your target
A detector is the step in a garak run that turns a raw generation into a hit or a no-hit, so the detector you choose decides what a FAIL actually means. A scan can look alarming or reassuring for reasons that have nothing to do with the model, simply because the detector matched the wrong signal. Before you trust a hit, confirm which detector fired, what it looked for, and whether that signal matches the harm you are testing for. Detector choice drives both coverage, meaning which failures the scan can see at all, and noise, meaning how many hits are false positives.
Most garak detectors work in one of two ways. Some look for keywords that are present or absent in the output, which is fast, deterministic and easy to explain to an auditor, but brittle when a model answers in a paraphrase or a different language. Others use a classifier to judge the response, run locally or through an API, which handles meaning better but adds a model dependency whose version and behavior you must record. Keyword matching suits clearly defined strings such as a leaked secret format or a known refusal phrase. A classifier suits outputs where the meaning matters more than the wording.
garak's judge module adds detectors that use a model as a judge, including ModelAsJudge, Refusal and Jailbreak detectors, and the garak source for these detectors lists how each is implemented. Teams usually reach for a judge when a keyword or classifier cannot tell a genuine policy violation from a safe answer that uses similar words. Judge-based scoring adds cost and variance, so confirm which model acts as judge, pin its version, and spot-check a sample of its verdicts against human review before you use the scores for a go or no-go decision. Setting the pass and fail threshold with eval_threshold is a separate decision covered in the next section.
Detector types and when each fits
This table compares keyword, classifier, judge-based and extended garak detectors across how they decide, where they run, what they cost to run, typical noise and when to choose them. Read each row as a trade-off: cheaper detectors are faster and more predictable, while judge-based detectors catch more nuanced failures at the price of extra model calls and their own error rate.
| Detector type | How it decides | Cost and run time | Typical noise | When to choose it |
|---|---|---|---|---|
| Keyword detectors | Look for words or phrases present or absent in the output | Low, no extra model call | Can flag harmless wording or miss paraphrased failures | Clear, known strings such as refusal phrases or leaked markers |
| Classifier detectors | A trained classifier scores the response, run locally or through an API | Moderate, depends on where the classifier runs | Depends on the classifier's training data and the topic | Known harm categories where a maintained classifier fits your policy |
| ModelAsJudge detector | A judge model reads the prompt and response and rates them against a criterion | Higher, one extra model call per evaluated output | Sensitive to the judge prompt and judge model choice | Nuanced policy questions where keywords cannot capture the failure |
| Refusal detector (judge-based) | A judge model decides whether the response refuses the request | Higher, one extra model call per evaluated output | Partial answers and hedged refusals may be scored inconsistently | Checking whether guardrails hold on requests the application should decline |
| Jailbreak detector (judge-based) | A judge model decides whether the response complies with a jailbreak attempt | Higher, one extra model call per evaluated output | Subtle role-play compliance can be missed or over-flagged | Testing jailbreak probes where keyword matching misses the outcome |
| Extended detectors | Add further detectors beyond each probe's recommended set | Longer run time, more evaluations per attempt | More hits to triage, so more false positives to review | When coverage matters more than a shorter run; confirm the list with --list_detectors |
When to enable judge-based refusal and jailbreak detectors
When you test a bare model with no application around it, the question is usually whether the model declines requests it should decline. Keyword matching can miss refusals phrased in unexpected ways, and a judge model can read the whole response and decide whether it is a refusal, a partial answer or a compliant answer. The judge adds this reading of intent, which keyword lists cannot provide. It needs a judge model reachable from the scan host, either running locally or behind an API that your organization approves. The main risk is using the same model family as both target and judge. A judge from that family may share the target's blind spots, so it can accept outputs that a different judge would flag.
- What the judge adds: a semantic reading of refusals, including indirect or polite declines.
- What it needs: a judge model the scan host can reach, with its endpoint and credentials configured.
- Same-family risk: a shared training lineage can hide the weaknesses you are trying to find.
- Choice of judge: pick a judge from a different provider or a stronger model when the target is high risk.
- Cost: each judged response adds an inference call, so the run takes longer and costs more.
Before relying on results, confirm the judge configuration keys in the garak user guide at docs.garak.ai for your garak version.
When the target is an application with a system prompt and a policy, a refusal is not automatically the correct outcome. The policy defines what the application should and should not do, so a judge needs that context to decide whether a response is a violation. A judge that only sees the raw output may flag a helpful answer as a jailbreak, or pass a response that breaks the policy in a subtle way. Give the judge the policy wording and the intended scope of the application where your garak setup allows it. This tab concerns the judge's reading of the application, not the probe selection itself.
- What the judge adds: a decision tied to what your application is allowed to do.
- What it needs: the application's policy text, a reachable judge model, and a target configured to match production.
- Context gap: a judge without the policy may score normal product behavior as a failure.
- Same-family risk: if the application runs on the same model family as the judge, a flagged response may reflect the judge's own tendencies.
- Review loop: sample the judge's decisions on known good and known bad responses before trusting the totals.
Confirm with your garak version how the system prompt and any policy text are passed to the judge, since the supported configuration keys are listed in the user guide.
Keyword detectors tend to flag any response that contains a listed term, even when the term appears in a safe context such as a quotation or an explanation. A judge detector can separate a genuine jailbreak from a harmless mention, which reduces the number of hits your team must triage. The trade-off is that the judge can also be wrong, so reducing false positives in one place can introduce false negatives elsewhere. Measure the effect on a labeled sample before changing the detector set for a scan you intend to compare over time.
- What the judge adds: fewer hits caused by keyword matches in harmless text.
- What it needs: a labeled sample of responses so you can check the judge against known outcomes.
- Threshold interaction: the eval_threshold setting determines how many judged hits count as a failure, so review it after adding a judge.
- Risk of hidden misses: a judge can pass responses that a keyword check would catch, so run both where the budget allows.
- Run comparison: changing detectors changes scores, so record the detector set in every report.
Ask your team to confirm the judge's agreement with human reviewers on a sample before treating the reduced count as an improvement.
A scan that must stay offline or air-gapped cannot call a hosted judge API. In that case the judge must be a model that runs on hardware inside the isolated network, and the scan host must reach it over a local address. Without a local judge, the judge-based detectors cannot run, and you should rely on keyword or local classifier detectors instead. Plan the model artifacts, their licenses and their update path before the scan, because the judge model must be copied into the isolated environment. Check the license of any local judge model with your legal team.
- What the judge adds: the same semantic reading as a hosted judge, without sending responses outside the network.
- What it needs: a locally hosted judge model, enough compute to run it, and a local endpoint reachable from the scan host.
- Artifact transfer: the model files, dependencies and garak plugins must be brought in through your approved process.
- Same-family risk: local deployments often use one model family for both roles because it is the one available, so document that choice.
- Fallback: keep the keyword and classifier detectors in the run so the scan still produces results if the judge is unavailable.
Confirm with garak's documentation whether the judge configuration can point to a local endpoint and which keys control it before planning the isolated build.
How eval_threshold affects pass and fail
The eval_threshold setting is the score cutoff at which garak's evaluation counts an output as a hit. Detectors return a score for each attempt, and the threshold decides which scores become hits. Because every probe's result is built from those hits, moving the threshold changes the pass and fail outcome across the whole run, not just one probe. A small change can flip a probe from FAIL to PASS, so the value must be treated as part of the test definition rather than a tuning detail.
A stricter threshold, which requires a higher score before an attempt counts as a hit, reduces noise from borderline detector output but can hide weak signals. A model that leaks partially, or that complies only occasionally, may score below the cutoff and report as clean. A looser threshold does the reverse: it surfaces more borderline cases for review, which helps when you are searching for weaknesses, but it also produces more false alarms that someone must triage. Before choosing a value, run a sample of known good and known bad outputs from your own application and see where the detector scores fall. Confirm the current default and the exact key name in the garak user guide for your installed version, because both can change between releases.
Record the threshold in the run config and make sure it appears in the report, so that a later run can be compared with an earlier one on the same basis. A change in the threshold between two scans can look like a change in the model's behavior when it is not. Store the value next to the detector list, generation count and garak version in version control, and note any override made on the command line. When a result shifts after a rescan, check the threshold first, then the detectors and the version, before concluding that the model or its safeguards have changed.
Setting up detectors and a judge in a garak run
This sequence takes a team from a clean garak install to a pilot run whose detectors, judge model and pass threshold have been checked against known-bad output. The result is a run configuration the team can explain, repeat and trust before scaling it to a full scan.
Install garak from PyPI on Python 3.11
Create a dedicated virtual environment on a Linux or macOS host running Python 3.11 or newer, then install garak with pip from PyPI. The PyPI package requires Python 3.11 or newer, so confirm the interpreter version before installing. Record the installed version, because detector names and defaults can change between releases. Done means
garak --versionprints a version string and the command runs without import errors.List detectors available in this version
Run the detector listing command from the installed garak to see which detectors ship in this release, rather than relying on names from documentation or older notes. Note which detectors are keyword-based, which use a classifier and which belong to the judge module, since those three groups behave differently and need different checks. Save the listing with the run record so later reruns can be compared against the same detector set. Done means you have a saved list and can name the detector each candidate probe will use.
Choose the probe set and default detectors
Select the probes that match the application's risks using the probe selection options, then review which detectors the default probewise harness attaches to each probe. The harness runs each probe with its recommended detectors, so start from those defaults and change only what you can justify. Keyword detectors check for words present or absent in the output, while classifier detectors judge the response with a model run locally or through an API. Done means a written table maps each selected probe to its detectors and to the reason for each choice.
Add extended and judge detectors deliberately
Enable extended detectors or the judge-based Refusal and Jailbreak detectors only for probes where keyword or classifier results are not enough to decide a hit. Judge detectors depend on a second model, so each one adds configuration, cost and a new failure mode. Record the reason for each addition in the run configuration. Done means every added detector has a stated purpose and an owner who can explain it.
Configure the judge generator and endpoint
Point the judge detectors at a judge model through a generator the team controls, with the endpoint, credentials and model name set in the run configuration rather than typed into a shell session. Confirm with the model owner which version the judge runs and whether its outputs are stable enough to score repeatedly. Send one test prompt and check that the judge returns a parseable answer. Done means a direct request to the judge returns a response, and the garak log shows the judge generator loaded without errors.
Set eval_threshold and check the scoring logic
Set eval_threshold deliberately, since it determines how the evaluator turns detector scores into pass and fail results for a probe. Write down the value, the reason for it and the expected effect on hits, then keep it fixed across comparable runs. Use a value that the team has agreed in advance, not one picked after seeing results. Done means the threshold is in the saved configuration and the team can explain what a single failed attempt means under it.
Run a small pilot with a known-bad sample
Run a small pilot on a narrow probe set, and include a sample that is known to produce undesirable output for the chosen detectors, such as a deliberately permissive test endpoint or a prompt from an established test set. Confirm that the known-bad sample scores as a hit and that a known-safe response does not. This is illustrative: the sample depends on the detector and the target. Done means both controls behave as expected before the full scan is scheduled.
Check the JSONL report and garak.log for judge errors
Open the JSONL report and confirm that each attempt has a detector result and an evaluation, then search garak.log for judge timeouts, parse failures, rate limit messages or fallback behavior. Judge failures can quietly change results, so a clean-looking summary is not enough. Compare the pilot's hit count with what the known-bad and known-safe controls predicted. Done means the report and log show no unexplained judge errors and the pilot results match the controls.
How a generation becomes a pass or fail
A probe prompt goes to the target generator, and each output is passed to the detectors that the probe's configuration selects: keyword, classifier, or judge model. Each detector score is compared with the eval_threshold, and the outcome is written to the JSONL report. A failed judge call is a separate branch that should be checked in garak.log, since it can otherwise look like a clean result. Confirm which detectors a probe uses before reading any pass rate.
Path from one probe attempt to a recorded pass or fail, including the judge error branch.
Security and operational risks in judge-based scoring
A judge model is a second model that reads target output and decides whether it is a hit, so it carries its own data, security and versioning risks. The cards below cover what leaves your boundary, how the judge can be manipulated, and how judge choices affect the reproducibility of scores over time.
Data leaving your boundary
A hosted judge receives every prompt and response it scores, and garak generations often contain the sensitive material the probe was trying to elicit. Confirm where the judge endpoint runs and what its provider retains before you point a scan at production-like data. A local or self-hosted judge keeps these transcripts inside infrastructure you already control.
Prompt injection of the judge
The target's output is untrusted text placed inside the judge's prompt, so a response that says the verdict is already decided can steer the judge toward a wrong result. This makes a judge score less reliable than a keyword match on exactly the outputs a red team cares about most. Test the judge with known injected responses and check that its verdicts match a sample you label by hand.
Self-preference within a model family
A judge tends to favor outputs that resemble its own style, so a target and judge from the same model family can under-report failures. Record the target and judge model names in every report and compare results when the judge changes. Where possible, choose a judge from a different family than the system under test and confirm this choice with your reviewers.
Judge version drift
Hosted judge models change behind the same model name, so a score can move between scans even when the target has not changed. Pin the judge model version where your provider allows it, and treat a judge change as a new baseline. Rerun a fixed reference set of outputs after any judge update to see whether the verdicts moved.
Judge credentials in secret stores
A judge that calls a hosted API needs a key with billing and model access, which is an exposure if it is stored in a config file or shell history. Keep the key in your organization's secret store, inject it at run time, and scope it to the judge model only. Confirm that garak's run logs and the garak.log debugging file do not echo the key.
Retaining reports with sensitive generations
Each run writes a JSONL report of every attempt and its evaluation, and that file holds the prompts and responses in full. Set a retention period for scan output that matches your data policy, restrict access to the report directory, and delete or redact reports that include real customer data. Document the retention rule alongside the scan configuration so that it is applied on every run.
Questions teams ask before tuning garak detectors
How much effort does tuning garak detectors take in-house compared with a partner?
Effort depends on how many probes and detectors the scan runs, how much of the output your team must interpret, and whether you already have a judge endpoint and a labeled sample. An in-house team pays for the time of engineers who learn the detector set, the judge prompts and the report format, and that learning cost is one-time. A partner is paid under a written scope that names the detectors to tune, the sample to label and the retest. Ask any partner to list which detector settings it will change, which it will leave at defaults, and how it will show that a threshold change is justified.
What drives the cost of running a judge model during a garak scan?
The cost comes from three multipliers: judge calls per attempt, where the judge is hosted or local, and the number of generations. Each probe attempt that a judge-based detector evaluates adds at least one judge call, so the count grows with probes, prompts per probe and generations per prompt. A hosted judge bills per call or per token, which is a recurring cost tied to every scan. A local judge shifts the cost to GPU or CPU capacity that you already run or must buy. Ask for a quote that states the expected judge calls per scan, the judge endpoint used and who pays for it.
How long does a detector tuning pass take, and what makes it longer?
Duration depends on the size of the labeled sample, how many detectors you compare, how many scans a threshold change requires, and how quickly the target and judge endpoints respond. Each candidate detector setting needs a rerun against the same prompts before results can be compared, so the number of candidates multiplies the run time. Extended detectors and judge-based detectors are usually slower than keyword checks. Access delays, rate limits and disagreements about what counts as a hit also add time. Ask the partner for a timeline tied to the written scope rather than a generic duration.
What does the work need from our team before it starts?
The work needs three inputs: access to the target, a judge endpoint, and a labeled sample. Target access means a test endpoint or application that matches production closely enough to produce representative output, plus credentials and a named contact for rate limits. A judge endpoint is a model your organization approves for scoring, either hosted or local, with a known cost and data handling position. A labeled sample is a set of outputs marked as hits or non-hits by people who know the application's policy. Without the labeled sample, threshold decisions rest on opinion, so confirm early who will label it.
Can a non-specialist set up garak detectors and judge scoring?
A non-specialist can run a default scan and read the summary, because garak runs its default detectors without extra configuration. Choosing extended detectors, configuring a judge model, and setting eval_threshold correctly require someone who understands both the application's policy and how the detectors judge output. Judge-based detectors also depend on prompt wording and model behavior, which can change scores in ways that are hard to spot. A sensible division is that a security or platform engineer owns the configuration in version control, while the policy owner signs off on what counts as a failure.
Do detector choices change garak results after an upgrade?
Yes, detector choices and their defaults can shift results between garak releases, so a score change after an upgrade may reflect the detector rather than the model. Before upgrading, record the garak version, the detector list, the judge model and version, and the eval_threshold used in each baseline run. Then rerun the same configuration on the new release and compare the outcomes per probe before you change any threshold. Check the release notes for detector and evaluator changes, and keep the old and new reports side by side for the first scan cycle.
How DeployOpen scopes garak detector and judge work
DeployOpen starts every garak detector and judge engagement with a fixed scope agreed in writing before any scan runs. The scope names the target application or model, the probe families in play, the detectors and any judge model to be used, and the deliverables. Because the detector choice decides what counts as a hit, it is settled up front rather than left to the first run. Our role covers planning, configuration, testing and evidence preparation. DeployOpen performs security testing and prepares evidence for your review. It does not issue audit reports, attestations or certifications. Independent auditors and certification bodies make those determinations.
Next comes a review of the target, the probes and the detector choices. For each probe, we confirm which detectors it would run under the default probewise harness, whether keyword, classifier or judge-based detection fits the output format, and whether an extended detector or a judge-based refusal or jailbreak detector is justified by the risk. Judge models add cost and their own failure modes, so the review records which model scores results, where it runs, and how its verdicts will be checked. Confirm with your own team which eval_threshold value reflects the risk you accept, since this value determines when a probe is marked as failed.
A pilot run with labeled checks comes before the full scan. A small set of known-good and known-bad responses from the target is scored by the chosen detectors and judge, and the results are compared with the labels. Disagreements show whether a detector is too strict or too permissive for the application, and whether the judge is consistent enough to rely on. The final run configuration, including detector names, judge model, thresholds and the garak version, is documented and stored in version control so the scan can be rerun exactly. Optional retainer support covers rescans after model, prompt or detector changes, so that results remain comparable over time. Ask any provider to state in writing who performs each step and what evidence you will receive.

