Need more detail? Connect your coding agent to the full docs.

Skip to Content
AMIRILDocs

Test a rule on past calls

Replay a rule over the tool calls your agents already made and see which ones it would have fired on, before it blocks anything.

A test replays one version of a rule over the tool calls your agents made in the last day, week or month. It uses the same engine the SDK runs in your agent. You see how many calls the rule would have fired on, and which ones. Test a rule before you publish it or switch it to Enforce.

You need a saved rule, and a draft is enough. You also need traces from your agent, because the test replays the calls they recorded.

Run a test

  1. Open Rules and open the rule.
  2. Scroll down to the Past calls card on the rule's page.
  3. In the first menu, pick the version to test. The newest is chosen for you, and a version not yet published reads like Version 2, draft.
  4. In the second menu, pick 24 hours, 7 days or 30 days. The default is 7 days.
  5. Select Test on past calls in the card. If that version was tested over that window before, the card shows the last result and the button reads Test again.

The replay usually takes a few seconds.

Read the result

The Past calls card leads with the count, such as "Would have fired on 12 past calls". Under it you see how many calls and runs the test replayed.

The table below lists the calls the rule fired on. Each row shows when the call ran, the agent and tool, the decision and the sentence the rule gave. Select a row to open its run.

The By agent table gives the count for each agent. A rule that names one agent counts only that agent's calls.

If nothing would have fired, try 30 days. If the count is still zero, open a run where the call happened. Check that the rule names the same tool and argument the call used.

Change the rule and test again

  1. Select Edit rule and change the rule.
  2. Select Save changes. It saves a new draft version.
  3. Pick that version under Past calls and select Test on past calls.

When every call in the table is one you meant to stop, publish that version.

Next steps

Last updated on