Get startedSign in

Simulating and testing policies

Validate Rego policies with live evaluation data and automated tests

Test policies at two levels:

  • Use the Plural policy simulator to evaluate an editor draft against representative or previously observed input.
  • Keep Rego unit tests beside each policy in Git and run them in CI before publishing changes.

Simulate a policy in Plural

Open Security → Policies, select a policy, and open its Definition tab. The simulator appears next to the Rego editor.

To run a simulation:

  1. Select an item from Past evals to load input captured from a live policy evaluation.
  2. Review or edit the JSON under Input.
  3. Update the Rego in the editor if you want to test a proposed change.
  4. Click Run simulation and inspect the decision and JSON under Output.

Simulations run against the current editor buffer, even when it has not been saved. This lets you validate a change before replacing the active policy.

Info:

Past evaluations are sampled for debugging and auditability, so the list is not a complete record of every policy evaluation.

The output depends on the policy type: