Skip to main content

Guards Playground

The Guards Playground runs sample content through a guard and shows you the exact decision it would make, including the score, the matched text, and how each check contributed. Use it to confirm a guard behaves as intended before you rely on it in production.

Open the Playground

Select Playground from the Security > Guards header, from the Build-time tab, or from the header of any guard editor. It opens as a side panel.

Set up a test

The panel mirrors the two guard categories with Runtime and Build-time tabs. Select the one you want to test.

Guard Playground panel with the Runtime tab selected and the Guard dropdown open showing All Guards and Email Address Detection

Use the Guard dropdown to choose what to test against:

  • All Guards runs the content through every enabled guard in that category.
  • Selecting a specific guard, such as Email Address Detection, tests only that one. Its threshold, action, and check count appear as badges so you know what you are testing.
Guard Playground on the Runtime tab, showing Threshold 8/10, block, and 2 checks badges, the Single and Batch (CSV) mode toggle, and a content field holding mail@example.com

Below the guard selector, Single and Batch (CSV) choose how much you are testing at once. Single is the default.

On Single, enter the text you want to evaluate in Content to test, then select Test. Select Clear to reset the input and results.

Read the result

After you run a test, the panel shows an Output section and a result summary.

Guard Playground result showing Blocked by guard: Email Address Detection, a Triggered block with Score 10/10, matched text, and a per-check breakdown

For content that fires the guard:

  • Output states the decision, for example Blocked by guard: Email Address Detection.
  • The result reads Triggered, with the action (such as block) and a Score out of 10.
  • Matched texts lists the exact strings that matched.
  • The per-check breakdown (for example, 2 checks (1 matched)) shows each check with its own score, so you can see which check drove the decision. In the example, the Email Address check scored 10 and the Mailto Link check scored 0, giving the guard a score of 10/10 against its 8/10 threshold.

For content that does not fire, the result reads Passed with a score below the threshold and 0 matched checks:

Guard Playground on the Build-time tab showing a Passed result with Score 0/10 and 58 checks, 0 matched

Test many inputs at once

Batch (CSV) runs a file of inputs through the selected guard in one pass. Use it when you are tuning a threshold and want to see the effect across a realistic corpus rather than one hand-written example — a sample of real tool arguments, say, or a set of prompts you know should and should not fire.

Guard Playground with Batch (CSV) selected, showing Download CSV Template and Upload CSV File buttons above a CSV Format note describing the content column, the 2,000-item maximum, and the generated results CSV
  1. Select Batch (CSV).
  2. Select Download CSV Template to get the expected shape.
  3. Fill in the content column, one input per row.
  4. Select Upload CSV File.

Willow runs every row against the guard you selected and generates a results CSV with the outcome for each row, so you can sort by score and look at what sits either side of your threshold.

A batch is capped at 2,000 items.

Iterate

If a guard fires when it should not, or misses content it should catch, adjust it and test again:

  • Tune the threshold to change sensitivity.
  • Edit, add, or disable individual checks. See Guard check types.
  • Re-run the same input until the decision is what you want.

Because the Playground reports the score and the matched checks, it tells you not just whether a guard fired but why, which is what you need to tune it.