autonomy policy compile-json¶
Compile a JSON rule list into Rego (writes data.autonomy)
Synopsis¶
Reads a JSON rule list and writes the equivalent Rego module to stdout
(or --out). The wire shape is the IR's Phase 1 JSON schema verbatim:
{
"version": "1.0.0",
"default": "deny",
"rules": [
{
"id": "REQ-PASS-001",
"effect": "allow",
"tool": "tool.echo",
"when": {
"op": "eq",
"field": "preflight.outcome",
"value": "pass"
}
}
]
}
The generated Rego carries explainability metadata (a rules_meta map
keyed on rule ID and a parallel matched_rule_id chain) so runtime
Decision events emitted to the WAL surface which rule matched, where
it lives in source, and a one-line remediation hint on deny outcomes
(#747 C05 + C06).
JSON doesn't carry line info naturally, so SourceRef.Line stays zero
for JSON-authored rules. The C06 source-location formatter handles
zero Line by emitting a file-only anchor.
Example:
autonomy policy compile-json policy.json --out compiled/policy.rego
autonomy policy build --in compiled --out bundle.tar.gz --version 1.0.0 \
--policy-frontend json-rules
Usage¶
autonomy policy compile-json <input.json> [flags]
Options¶
--out string output .rego file path (default: stdout)
Options inherited from parent commands¶
--require-signed-manifest Refuse to start if the SHA256SUMS release manifest or its cosign signature is missing/invalid (Tier 2 binary-integrity check; default: build-time compile-in via -ldflags -X, build-hardened artifacts=true, all others=false)
See also¶
autonomy policy— Manage policy bundles