Skip to main content
Policy checks let you enforce reliability standards programmatically — before code ships. Instead of manually reviewing dashboards before every release, you define thresholds once and let critiqor check tell you whether your agent meets them. Use policy checks as a deployment gate in your CI pipeline, a pre-release verification step, or a local sanity check after a session.

What is a policy check?

critiqor check reads your saved evaluation history and verifies that recent runs meet the reliability thresholds you’ve configured. If every checked run meets the thresholds, the command exits successfully. If any run falls short, the check fails and reports which thresholds were not met. This makes it straightforward to integrate Critiqor into automated workflows: block a deployment if the trust score is too low, fail a CI job if hallucination risk is above your limit, or enforce consistent standards across a team.

Basic usage

By default, critiqor check reads evaluations from critiqor_evaluations.jsonl in your current working directory. Run this after finalizing one or more sessions to check them against your configured thresholds. To read from a different file, pass the --evaluations flag:

Setting thresholds

Pass threshold flags to define the reliability bar your runs must meet:
You can use either flag independently or combine them. All specified thresholds must be met for the check to pass.

Filtering by agent

If your evaluation file contains runs from multiple agents, use --agent-id to scope the check to a specific agent:
Only runs matching the specified agent ID are evaluated. Runs from other agents in the same file are ignored.

Using a policy file

Instead of passing flags on every invocation, define your thresholds in a policy file and reference it with --policy. This is the recommended approach for teams and CI environments — thresholds live in version control alongside your agent configuration.
Create a policy.json file in your project with your thresholds:
Critiqor accepts both JSON and YAML policy files. Any threshold you can pass as a flag can also be defined in the policy file. Flags passed at the command line take precedence over values in the policy file if both are present.

Exit codes

critiqor check uses standard exit codes, making it straightforward to integrate into any CI or scripting environment: When a check fails, the command prints a summary of which runs failed and which thresholds were not met. Use this output to identify which session to investigate in the dashboard. Example CI integration (GitHub Actions):
If the step exits non-zero, the workflow fails and the deployment is blocked.
Policy checks evaluate your saved evaluation history. Make sure you have finalized all recent sessions with critiqor finalize before running checks — any session that hasn’t been finalized won’t appear in the evaluation file and won’t be included in the check.