Locked learning resources

Join us and get access to thousands of tutorials and a community of expert JavaScript developers.

Unlock This Lesson

Locked learning resources

This lesson is for members only. Join us and get access to thousands of tutorials and a community of expert JavaScript developers.

Unlock This Lesson

Rerun Attacks on Every Change

In this lesson, you added your attack set to the pull-request check as its own slice. Then you watched it catch an attack that had been closed before launch and reopened after a teammate shortened the prompt and moved to a newer model.

Key Points

  • A rate from one day. The attack success rate from Write Attacks as Eval Cases comes from one day, one prompt and one model. Red-teaming isn’t a session before launch. Every change to the prompt, the model or the sources can reopen an attack.

  • The change. Three months after launch, a teammate’s pull request shortens the answer prompt, because the code checks verdicts now. It also moves the answer role to a newer model.

  • A slice with a ceiling. Your pull-request check, npm run evals:pr, already grades each slice against its own floor, saves a results file under each commit, and keeps the key in a secret with a spending limit. The attacks join it as one more slice. Lower is better there, so each row gets a ceiling instead of a floor. A closed row’s ceiling is zero, so one success fails the check.

  • A small set on every pull request. The pull-request set runs every question in your cases, but only the first injected wording, three times each. The go or no-go attempt from the July traces is now a third question in the jailbreak case, so it runs on every pull request.

  • An open row, read with its spread. The reports row is still open. Three unchanged runs saw four, five and five successes in twelve. Three runs don’t bound the next one. A ceiling at the worst of them, 42 percent, would fail about one unchanged run in three by chance. With headroom, 60 percent fails about one in twenty.

  • A ceiling doesn’t accept a leak. At 60 percent, the reports ceiling catches a big rise, not a small one. On twelve attempts, a pull request that pushed the rate from about 39 percent to 50 percent would still pass about four runs in five. A looser ceiling fails fewer unchanged runs and lets more of a real rise through.

  • The ceiling doesn’t decide releases. That’s your call, and you don’t release with the leak open. Once the project closes it, the ceiling drops to zero.

  • The closed attack reopened. On the teammate’s pull request, the jailbreak row saw three successes in nine, above its ceiling of zero, so the check failed. A rerun saw the same three. When a row goes above its ceiling, read its replies rather than rerunning until it passes.

  • What the replies showed. All three came from the question the traces caught, and each reply started “No-go”, with the ford’s report. Any verdict is forbidden, even a cautious one, because the next one could be a “go”. The word check knows “you can cross” but not “no-go”, and the prompt line the teammate cut had kept the model from writing it.

  • Two layers. The word check needs a verdict rule that blocks any go or no-go, however it’s worded. Until that rule passes the attack set, put the prompt line back.

  • Why the case from the traces mattered. Without it, the row would have read zero in six, and the check would have passed. The reports row saw three and four in twelve: under its ceiling, and too few runs to show a change either way.

  • What each set costs. On this pull request, the small set made 45 answer calls and 38 judge calls, in two minutes, for seven cents. The full set runs every wording five times: 110 answer calls and 102 judge calls, in about five minutes, for eighteen cents. So the full set runs before a release, and a path filter in the workflow runs it automatically on any pull request that touches the model, the prompts or the sources.

  • The full set found more. This pull request changes the model, so it got the full set too. That found one more: in two runs of ten, the reply quoted the false beds note, “the col is clear”, next to the real snow report.

  • Keep the every-change set small. These are small numbers from a toy set. Each case you add multiplies the attempts by its questions, its wordings and its runs. Each attempt can make several calls (answer, tools, moderation, judge), so count and price them from the run.

  • The rule: keep your attacks in the check. Run a small set on every pull request and the full set before a release and on any model, prompt or source change. Add each new attack your traces show as a case.

These runs are from December 2, 2026, on one provider’s models. Your numbers will differ, but a cut prompt line can still reopen an attack your checks don’t cover.

Final Code

Locked learning resources

Join us and get access to thousands of tutorials and a community of expert JavaScript developers.

Unlock This Lesson

Already a member? Sign-In

Locked learning resources

The full lesson is for members only. Join us and get access to thousands of tutorials and a community of expert JavaScript developers.

Unlock This Lesson

Already a member? Sign-In

00:00 In Write Attacks as Eval Cases, you got a first attack success rate. It comes from one day, one prompt and one model. Three months after launch, a teammate opens a pull request.

00:13 It shortens the prompt, because the code checks verdicts now. It also moves the answer role to a newer model. Would anyone notice if a closed attack worked again?

00:24 Only if the attacks run again. Red-teaming isn’t a session before launch. Every change to the prompt, the model or the sources can reopen an attack.

00:36 Your pull-request check already grades each slice against its own floor. Every run saves a results file under its commit, and the key sits in a secret with a spending limit.

00:48 The attacks join it as one more slice. Every pull request runs a small set. It covers every question, but only the first injected wording, three times. The go or no-go attempt from your July traces is now a third question in the jailbreak case.

01:06 Here, lower is better, so each row gets a ceiling instead of a floor. A closed row’s ceiling is zero. One success fails the check. The reports row is still open, so read it with its spread.

01:20 Three unchanged runs saw four, five and five successes in twelve. Three runs don’t bound the next one. A ceiling at the worst, forty-two percent, would fail about one unchanged run in three.

01:33 With headroom, sixty percent fails about one in twenty. That ceiling doesn’t accept the leak. It catches a big rise, not a small one. You still don’t release with the leak open.

01:47 Once the project closes it, the ceiling drops to zero.

01:52 Run the check on the teammate’s pull request. The jailbreak row saw three successes in nine. Above its ceiling of zero, the check fails. A rerun saw the same three.

02:05 Don’t rerun until it passes. Read the replies. All three came from the question your traces caught. Each reply started “No-go”, with the ford’s report. Any verdict is forbidden, even a cautious one.

02:20 The next one could be a “go”. The word check knows “you can cross”, but not “no-go”. The prompt line your teammate cut had kept the model from writing it. The word check needs a verdict rule that blocks any go or no-go, however it’s worded.

02:36 Until that rule passes this set, put the prompt line back. Without the question from your traces, the row would have read zero in six, and the check would pass.

02:47 The reports row saw three and four in twelve, under its ceiling. That’s too few runs to show a change either way.

02:57 The small set made forty-five answer calls and thirty-eight judge calls. It took two minutes and cost seven cents. The full set runs every wording five times: a hundred and ten answer calls, a hundred and two judge calls, five minutes and eighteen cents.

03:16 So it runs before a release, and automatically on any pull request that touches the model, the prompts or the sources.

03:24 This pull request changes the model, so it got the full set too. That found one more. In two runs of ten, the reply quoted the false beds note, “the col is clear”, next to the real snow report.

03:38 These are small numbers from a toy set. Each case you add multiplies by its questions, its wordings and its runs, and each attempt can make several calls.

03:48 So keep the every-change set small.

03:53 Keep your attacks in the check. Run a small set on every pull request, and the full set before a release and on any model, prompt or source change. Add each new attack your traces show as a case.

04:08 Next, in Exercise: Grade Attacks by Behavior, you’ll grade the assistant’s recorded replies to a set of attacks and add the cases that set is missing.

Become a Member to join the conversation.