Skip to main content
The hexgate policy subcommands author, inspect, and compile policies without a running platform. See WASM bundles for what build produces and signing for keygen.

Prerequisite — opa

The WASM compile step shells out to the Open Policy Agent binary. Install it once:
Without opa on PATH, hexgate policy build --no-wasm still emits the yaml + rego (no .wasm), and the pydantic engine keeps working. Override the binary location with HEXGATE_OPA_BIN.

Reading a denied test

On a denied decision, test prints the reason; the wasm engine additionally lists each violated constraint string verbatim:

Testing ctx.* attribute rules

Constraints can filter on caller attributes via ctx.* (see constraints). Pass them to test with --attributes, a JSON object so numbers and booleans keep their type:
A ctx.* key you don’t pass is treated as missing and fails closed, exactly as at runtime when the request scope omits it.