simulate_policy
Test CSL policies by simulating them against JSON inputs. Compiles and runs the runtime guard to return ALLOWED or BLOCKED with full violation details. Supports single or batch inputs and dry-run mode for shadow testing.
Instructions
Simulate a CSL policy against one or more JSON inputs.
Compiles the policy, then runs the runtime guard against the provided context. Returns ALLOWED or BLOCKED with full violation details.
Supports batch simulation: pass a JSON array of objects to test multiple inputs.
Args: csl_content: The complete CSL policy source code as a string. context_json: JSON object (single input) or JSON array (batch) to test. dry_run: If true, evaluates all rules but never blocks. Useful for shadow testing.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| csl_content | Yes | ||
| context_json | Yes | ||
| dry_run | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |