Fiddle FFI — zero runtime gem dependencies.
One core, many languages; every decision is local.
Scope: local-decision layer only — bundle auto-refresh, HITL and audit
streaming are the Governor harness (Python/TypeScript only). This gem makes one
thing fast and local: the policy DECISION. You fetch the rule bundle and stream
audit yourself.
Install
The gem bundles the platform-matching compiled core, so there is no separate native install.Acquire a bundle
Every decision is made against a rule bundle you fetch from the control plane and parse. Fetch it over the rules API:VISIQ_ENDPOINT defaults to https://api.visiqlabs.com; set it only for onprem.
Parse the returned JSON into a Hash (bundle) and pass it in.
Govern a tool call
Visiq.gate_action(bundle, tool_name:, args:, agent_id:) 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.rb) 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
Visiq.gate_retrieval(bundle, resource_metadata:, agent_id:) 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 compiled core can’t load, or an FFI error — is routed byVISIQ_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 raises a fail-closed error. A real rule
deny always blocks regardless of fail mode.
Override the core library
The gem loads its bundled core. Point it at a specific library withVISIQ_CORE_LIB (an absolute path), matching the Go and Java bindings.
Next steps
Java Reference
The Java binding —
gateAction over the same core.Python Reference
The full Python harness — Governor, gates, and audit streaming.