Aller au contenu
← AI red teaming: techniques, open-source tools and automated pipelines

Leçon 14 sur 18 · 11 min

How to read red-team results: rates, intervals and hits

Read a scanner report the way a statistician and an investigator would: denominators first, then intervals, then the actual failing replies, and only then a conclusion.

Cette page est en anglais pour le moment.

A scan finishes and prints a table. The temptation is to read the biggest number and move on. This lesson gives a reading order that avoids the common mistakes, using what four open-source tools report.

Animated chart of a scan report with illustrative values. Five probe families are listed with failures over attempts, a failure-rate bar and an interval line. A small sample shows a very wide interval, zero failures in a small sample still has a non-zero upper bound, and a large sample has a narrow interval. A side panel shows three replies where the detector is right, raises a false alarm and misses a failure.
Illustrative values. The same rate over few attempts has a wide interval, and detectors are wrong in both directions.

What the tools give you

  • garak writes a log, a JSONL report for each run, and a hit log of the attempts that yielded a vulnerability. In the console, a probe is marked FAIL if any attempt showed the undesirable behaviour, with the failure rate; figures such as 840/840 give the number of generations and how many seemed to behave acceptably [1].
  • Augustus prints a table with probe, detector, passed, score and status columns, where status reads VULN or SAFE, and can also write JSON, JSONL and HTML [2].
  • PyRIT stores every prompt and reply in memory and exports them, by label, as JSON or CSV with the original and converted prompt, the reply and the scores [3].
  • promptfoo exports JSON for processing, HTML for people and JUnit XML for CI viewers, and can fail a pipeline on test failures or on a threshold you compute [4].

A reading order

1. Start with the denominator

A count of failures means little without the number of attempts. Three failures out of 10 and thirty out of 100 are the same rate, 30 per cent, yet the first is far less certain (its 95 per cent interval below runs from 10.8 to 60.3 per cent, the second from 21.9 to 39.6). For each line, note how many prompts, how many variants from buffs and how many generations went into it.

2. Read the interval, not only the bar

Treat each rate as an estimate. Brown, Cai and DasGupta recommend the Wilson interval, or the Jeffreys interval, for small samples and warn that the textbook normal-approximation (Wald) interval has misleading coverage [5]. For a share k out of n with observed rate p and a z value of about 1.96 for a 95 per cent interval, the Wilson interval is centred at (p + z²/2n) / (1 + z²/n) with half-width z × √(p(1 − p)/n + z²/4n²) / (1 + z²/n). Worked here with that formula:

Computed for this lesson with the Wilson formula. Zero failures in 40 attempts is still compatible with a weakness that appears in nearly one reply in eleven.
Failures / attemptsObserved rateWilson interval (95 per cent)
3 / 1030.0 per cent10.8 to 60.3 per cent
30 / 10030.0 per cent21.9 to 39.6 per cent
30 / 30010.0 per cent7.1 to 13.9 per cent
0 / 400.0 per cent0.0 to 8.8 per cent
0 / 4000.0 per cent0.0 to 1.0 per cent

Miller’s paper on error bars for evaluations makes the wider case: treat an evaluation as an experiment, use statistical formulas for the uncertainty and for comparing models, and plan the experiment so noise stays small [6].

3. Open the failing replies

Every failure line should lead you to the actual replies: garak’s hit log, Augustus’s JSONL, PyRIT’s export. Read a sample of them. Some will be real. Some will be false alarms, such as a refusal that quotes the attack. Then read a sample of the passes too, because a detector can miss a failure that was reworded. Lesson 13 explains how to turn this sampling into error rates.

4. Compare like with like

Two runs are comparable only if the probes, buffs, number of attempts, model and guardrail versions, and the judge and its settings all match. Model output varies, so repeat a run before treating a small difference as a change.

5. Separate finding from measurement

Microsoft’s planning guidance asks that a report make clear that red teaming exposes the risk surface and is not a replacement for systematic measurement, so that readers do not take specific examples as a metric for how widespread a harm is [7]. It also suggests recording the date, a unique identifier for the input and output pair for reproducibility, the input and a description of the output, and adding a content warning if the examples are problematic.

Common misreadings

  • Zero failures means safe. It means none were found by these probes in this sample.
  • A high pass rate means a strong system. The probes may be easy, or the detector too lenient.
  • Averaging across probes. A single average hides a family that fails badly.
  • Comparing across tools. Different probes and judges make raw rates incomparable.
  • Treating one failing example as prevalence. It shows that the failure is possible, not how often it happens.

Triage after reading

Rank real failures by what they enable: a leaked canary in a system with no secrets differs from an action triggered in a system that can send money. Combine the probe family, the reproducibility and the permissions behind the system, then hand each finding to an owner with the exact conversation attached.

À retenir

  • Read denominators first, then intervals, then the actual failing replies.
  • Use the Wilson interval for small samples; zero failures is not proof of safety.
  • Sample passes as well as failures, because detectors err in both directions.
  • Compare runs only when probes, versions, judge and attempts match.
  • Report findings as exposure of risk, not as a measure of prevalence.

Vérifiez vos connaissances

  1. 1. What does an interval add to a failure rate?

    • How uncertain the estimate is — Exact.
    • The model’s size
    • The run time
    • The probe names

    A wide interval shows that few attempts give little certainty.

  2. 2. Why is “0 / 40” not proof of safety?

    • The interval’s upper bound is still above zero — Exact.
    • Zero is invalid
    • Probes cannot find zero
    • Reports hide zeros

    With 40 attempts, the 95 per cent interval reaches about 8.8 per cent.

  3. 3. What should you read after the table?

    • The actual failing replies and a sample of passes — Exact.
    • Nothing
    • Only the headline number
    • The licence

    The replies show whether the detector is right.

  4. 4. When can two runs be compared?

    • When probes, versions, judge settings and attempts match — Exact.
    • Always
    • Never
    • Only on the same day

    Otherwise a difference may come from the setup, not the system.

À vous de jouer avec FireAI

Mettez cette leçon en pratique sur votre propre Mac.

Sources

Mettez-le en pratique sur votre Mac

Essayez toutes les fonctionnalités gratuitement pendant 17 jours, sans carte bancaire.

Télécharger pour Mac Docs