policy subcommands and the --policy flag on check and recommend.
What Policy Files Control
A policy file is a YAML document that governs:- Model allowlists — which models or model families are permitted or blocked
- Runtime restrictions — which inference runtimes (
ollama,vllm,mlx,llama.cpp) are approved - Enforcement mode — whether violations log a warning (
audit) or fail the command (enforce) - Exit code — the non-zero exit code returned in
enforcemode (configurable viaenforcement.exit_code) - Reporting formats — which export formats (
json,csv,sarif) are produced byaudit export - Provenance requirements — minimum metadata fields that must be present on any candidate model
Enforcement Modes
| Mode | Behaviour | Exit code |
|---|---|---|
audit | Violations are reported in output but the command exits 0 | Always 0 |
enforce | Blocking violations cause a non-zero exit | Default 1, overridable via exit_code |
Creating a Policy File
Generate a policy template
policy init writes a fully commented policy.yaml template to your working directory:policy.yaml and edit the allowlists, restrictions, and enforcement settings to match your organization’s requirements.Validate the policy file
policy validate checks the file against the v1 schema and returns a non-zero exit code if the file is invalid:check or recommend.Apply the policy to check and recommend
Pass Policy outcomes are embedded in the command output alongside the usual model rankings. In
--policy <file> to check or recommend to enable policy evaluation:enforce mode, any blocking violation halts the command with a non-zero exit.Audit Export Formats
| Format | Best for |
|---|---|
json | Post-processing in pipeline jobs, dashboards, custom tooling |
csv | SIEM ingestion — Splunk, ELK, DataDog pipelines |
sarif | Security and code-scanning tool integrations (GitHub Advanced Security, etc.) |
Provenance Fields in Reports
Allcheck, recommend, and audit export outputs include normalized model provenance fields. These fields are present even when the underlying model metadata does not supply them — missing values are represented as "unknown" rather than being omitted, keeping downstream parsers deterministic.
| Field | Description |
|---|---|
source | Where the model entry originated (dynamic catalog, local install, curated fallback) |
registry | The model registry the entry was sourced from (e.g. ollama) |
version | Model version or tag |
license | Canonicalized SPDX-style license identifier |
digest | Content digest / hash when available |
License Canonicalization
License values are normalized before policy checks so that free-text license strings from model metadata match policy rules reliably:| Raw value | Canonical form |
|---|---|
MIT License | mit |
Apache 2.0 | apache-2.0 |
apache-2.0 will match models tagged Apache 2.0, Apache-2.0, or similar variants.
