Documentation Index
Fetch the complete documentation index at: https://docs.visiqlabs.com/llms.txt
Use this file to discover all available pages before exploring further.
How Rules Work
Rules define what actions your agents are permitted to perform. Every outbound request intercepted by the SDK is evaluated against your rule set. Rules are compiled into an optimized bundle that SDKs download and cache locally — evaluation happens in-process with no network round-trip on the hot path. Each rule targets a specific application or API (resource_type), matches based on conditions (action, agent ID, request context), and applies an effect: permit the request, deny it, or route it to a human for approval.
Rule Structure
A rule has the following fields:| Field | Type | Description |
|---|---|---|
name | string | Human-readable name for the rule |
description | string | Optional longer description |
effect | allow | deny | hitl | What happens when this rule matches |
resource_type | string | The target app this rule applies to (e.g. stripe.com, github.com, or * for all) |
conditions | RuleCondition[] | List of field/operator/value conditions that must all match |
priority | number | Rules with higher priority are evaluated first. Default: 0 |
enabled | boolean | Whether the rule is active. Disabled rules are excluded from the bundle |
Example Rule (JSON)
Condition Operators
Conditions match against fields extracted from the intercepted request:agent_id, target_app, action (HTTP method or method + path), and any additional context your agent passes.
| Operator | Description | Example |
|---|---|---|
equals | Exact string match | action equals "POST" |
in | Value appears in a list | agent_id in ["billing-agent", "reporting-agent"] |
not_equals | Value does not equal the target | action not_equals "DELETE" |
not_in | Value does not appear in a list | agent_id not_in ["untrusted-agent"] |
resource_type.
Undefined fields fail-closed. If a condition references a field not present in the request context, the condition does not match —
undefined is never treated as a match target.Natural Language Rules
You can describe rules in plain English. ALLOW compiles them to policy using AI (powered by thePOST /allow/rules/compile endpoint). No Rego expertise required.
Example prompt: “Allow my billing agent to make GET requests to Stripe but block all write operations including POST, PUT, PATCH, and DELETE”
Compiled result:
Rule Evaluation Flow
When the SDK intercepts an outbound request:- The SDK extracts
target_app(the hostname) andaction(the HTTP method, or method + path) from the request URL and headers. - The ALLOW rule engine iterates through the cached bundle in priority order (highest priority first).
- The first rule whose
resource_typematches and whose all conditions match wins. - The winning rule’s
effectis applied:allow→ permit,deny→ block,hitl→ pause for human approval. - If no rule matches, the request is an uncovered scenario (see HITL for how these are handled).
Rule Sync
The SDK periodically fetches the latest compiled rule bundle fromGET /allow/rules/bundle. The default sync interval is 30 seconds, configurable via syncIntervalMs or ALLOW_SYNC_INTERVAL_MS.
Sync uses ETag / If-None-Match for efficiency — if the bundle has not changed since the last fetch, the server returns 304 Not Modified and no data is transferred. The bundle version field is a SHA-256 hash of the serialized rules array, so it changes exactly when rules change.
The SDK loads an initial rule bundle on startup. If the initial fetch fails (transient server issue, no connectivity), the SDK falls back to server-side evaluation via POST /allow/evaluate until a bundle is successfully loaded on the next sync cycle.
Managing Rules
Rules can be created and managed via:- Dashboard: Navigate to Rules in the ALLOW dashboard. Use the Create Rule button for manual entry or the Compile from description input for natural language.
- REST API: Use the Rules endpoints documented in the API Reference. Useful for programmatic rule management, CI/CD pipelines, and bulk imports.
Rule Priority Guidelines
| Priority range | Suggested use |
|---|---|
100+ | Override rules — specific denies that should always win |
10–99 | Normal allow rules for known-good patterns |
1–9 | Broad catch-all rules |
0 | Default / lowest precedence |