Scope: local-decision layer only — bundle auto-refresh, HITL and audit
streaming are the Governor harness (Python/TypeScript only). This binding makes
one thing fast and local: the policy DECISION. You fetch the rule bundle and
stream audit yourself.
Build
Build the C-ABI core (no pyo3) once, then build/run the Go package from the repo:Acquire a bundle
Every decision is made against a rule bundle you fetch from the control plane and hold in memory. Fetch it over the rules API:VISIQ_ENDPOINT defaults to https://api.visiqlabs.com; set it only for onprem.
Hold the returned JSON as a string (bundleJSON) and pass it to the gate helpers.
Govern a tool call
GateAction(bundleJSON, toolName, args, agentID) decides one tool/action call.
Inspect decision["allowed"]; on a mask verdict apply
decision["action"]["argRedactionRules"] to the args before running the tool.
guide_example_test.go,
ExampleGateAction) against a bundle copied verbatim from the oracle-stamped
conformance corpus: the deny fixture blocks (allowed=false), the permit fixture
passes (allowed=true).
Govern a retrieval
GateRetrieval(bundleJSON, resourceMetadata, agentID) decides one retrieval.
Inspect decision["retrieval"]["action"] — drop on deny/escalate, redact via
decision["retrieval"]["redactionRules"] — before content reaches the model.
Fail mode
A HARNESS-internal failure — the native core can’t load, orvisiq_evaluate
returns NULL — is routed by VISIQ_FAIL_MODE (owner G001 rescope): open
(default) returns a permit-equivalent decision plus a loud stderr report so a
VisIQ packaging bug never disrupts the agent; closed returns a deny-equivalent.
A real rule deny always blocks regardless of fail mode.
Override the core library
The binding loadslibvisiq_core from the build tree. Point it elsewhere with
VISIQ_CORE_LIB (an absolute path), matching the Java and Ruby bindings.
Next steps
Java Reference
The Java binding —
gateAction over the same core.Ruby Reference
The published Ruby gem —
gate_action over the same core.