Skip to main content
Validation rules determine whether a scenario passed. They are declared in the validation object of scenario.json and evaluated after the agent finishes executing.

Structure

Rules are organized into three scopes based on what they check: For tasks rules, each rule is checked against every task. A rule passes if it matches on at least one task.

Rule Structure

Every rule shares a common set of fields:

Validators

pattern_match

Checks whether a regex pattern matches in a specific field of the job or task data.
where targets:

job_resolution_status

Checks the job’s final resolution status.
Allowed values: success, agentic_failure, hard_failure, partial, no_action.

ticket_status

Checks the status of the ServiceNow ticket. Only applicable with --from gateway.

task_count

Verifies that the number of tasks created under the job falls within a range.

ansible

Runs an Ansible playbook and treats its exit code as pass/fail. The most reliable way to assert actual machine state.
A non-zero exit code fails the resolution gate and marks the scenario as failed. See Playbooks for how to write validate.yml.

Scoring Model

Compliance score: percentage of all non-Ansible rules that passed (required + optional combined). Informational. Two gates determine the actual pass/fail result: Compliance gate: passes when every required non-Ansible rule passes. Resolution gate: if a validate.yml Ansible rule exists, passes when the playbook exits 0. If no validate.yml rule is defined, it passes when the compliance gate passes and the compliance score is at least 80%. A scenario passes only when both gates pass.