Rule replay

Before you add a rule, play it against your recent requests: what it would have approved, denied or left for a person, and where that parts from what your people decided.

A new allow rule is a bet that you would have said yes to everything it covers. Rule replay checks that bet against what already happened. Before you add a rule, play it against your workspace’s recent requests: how many it would have approved or denied at once, how many it would have left for a person, and, most important, where it parts from what your people actually decided.

A new rule, always allow refund.* up to €150, replayed on the last 30 days: it would change 39 requests, and would have approved 2 refunds a person denied and 1 that nobody answered in time.

A replay decides nothing. It reads your requests and your rules, stores nothing and tells nobody. The rule only takes effect once an owner adds it.

Rule to replay

Of 20 requests in the last month, this rule changes 5: 5 approved at once, 0 denied at once, 0 left for a person. 1 part from what your people decided.

  • 6 Novsupport-botpayment.refund€120.00

    Refund all of order 4533; the customer kept the goods

    Then: a person denied. Today’s rules: waits for a person. With the new rule: approved at once.

    Approves what a person denied

  • 20 Novsupport-botpayment.refund€150.00

    Refund a double charge, order 4655

    Then: a person approved. Today’s rules: waits for a person. With the new rule: approved at once.

  • 14 Novsupport-botpayment.refund€70.00

    Refund a lost parcel, order 4617

    Then: a person approved. Today’s rules: waits for a person. With the new rule: approved at once.

  • 14 Novsupport-botpayment.refund€60.00

    Refund a wrong size, order 4610

    Then: a person approved. Today’s rules: waits for a person. With the new rule: approved at once.

  • 2 Novsupport-botpayment.refund€80.00

    Refund late delivery, order 4502

    Then: a person approved. Today’s rules: waits for a person. With the new rule: approved at once.

How a replay works

  • It reads the newest requests of the last 30 days, or 1 to 90 days if you say, up to 5,000 of them. With more, only the newest are replayed and truncated is true.
  • Each request is weighed twice by the same evaluation a real request meets: once with today’s rules, once with today’s rules and the new one. The difference is what the new rule changes. When rules disagree the most cautious still wins, so a new allow never beats a standing deny or ask.
  • Rules match on the agent key the request came with, as they do for real. A request whose key was deleted only meets rules for every agent.
  • Budgets count from zero at the start of the replay and fill, in order, with what their rule approves, so a budget rule shows where it would have run out.

Where it parts from your people

approves_denied
The rule would approve a request a person denied. This is the one to read before adding an allow rule.
approves_unanswered
The rule would approve a request nobody approved in time, so it expired.
denies_approved
The rule would deny a request a person approved, so that work would have stopped.

The list of changed requests puts these first, then the rest newest first, 25 at most.

What a replay leaves out

  • Pauses, of the workspace or a key: they stop agents whatever the rules say.
  • Holds that are not a rule’s doing: the summary check, unusual for this agent, reviewers and tripwires. A real request can still be held for a person where the replay says a rule approves it.
  • Run grants and mandates, which belong to one run.
  • The month’s request count and your plan’s limits.

Who can replay

Any member, on every plan, as with trying the rules: a replay only reads requests a member can already see. Agent keys cannot. In the app, the replay sits beside Add rule, so owners on a plan with rules see it there; through the API any member can run one. Adding the rule afterwards still takes an owner, on a plan with rules.

The API

Send the rule as you would add it, under rule, and how many days to look back:

curl https://api.variantgate.com/v1/workspaces/$WORKSPACE_ID/rules/replay \
  -H "Authorization: Bearer YOUR_SESSION_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "rule": {
      "action": "payment.refund",
      "effect": "allow",
      "limit_amount": "200.00",
      "limit_currency": "EUR"
    },
    "days": 30
  }'
{
  "days": 30,
  "looked_at": 412,
  "truncated": false,
  "changed": 23,
  "newly_approved": 23,
  "newly_denied": 0,
  "newly_asked": 0,
  "approves_denied": 2,
  "approves_unanswered": 1,
  "denies_approved": 0,
  "samples": [
    {
      "request_id": "01937a2c-4d5e-7f60-8a9b-0c1d2e3f4a5b",
      "agent": "support-bot",
      "action": "payment.refund",
      "amount": "120.00",
      "currency": "EUR",
      "created_at": "2026-11-06T11:18:00Z",
      "happened": "person_denied",
      "before": "ask",
      "after": "approve",
      "disagreement": "approves_denied"
    }
  ]
}

A rule that could not be written, such as two approvals on an allow, a key of another workspace or days outside 1 to 90, is refused with 422.

Rule review and suggestions

Replay is for a rule you have not added yet. Rule review narrows the allow rules you already have to what they were used for, and Insights suggests rules from what you keep approving.

Gateways and policy tools can replay traffic against a policy or run it in log-only mode. Here the yardstick is the decisions your people made on those same requests, so the replay shows where a rule would have overruled them.