Policies
Rule structure, the condition language, precedence, versions and default deny.
A policy is a named list of rules. All published policies in an environment form the policy set that every decision is evaluated against.
Rule structure
| Field | Required | Meaning |
|---|---|---|
id | Yes | Stable ID, returned in matched_rules |
effect | Yes | allow, deny or require_approval |
actions | Yes | Action names; namespace.* matches a namespace and * matches every action |
agents | No | { ids: [...] } and/or { tags: [...] }; omit to match any agent |
subjects | No | { kinds: [...] }; use none to match requests without a subject |
require_delegation | No | Match only with a valid delegation covering the action |
condition | No | Boolean expression (below); omit to always match |
approval | For require_approval | channel_id and expires_in_seconds |
Precedence and default deny
For each request, ReQlo finds every matching rule across the policy set, then:
- Any
deny→ deny (policy_denied). - Else any
require_approval→ approval required. - Else any
allow→ allow (policy_allowed). - Else → deny (
no_matching_policy).
Rule order never matters, and an allow can never override a deny. Invalid requests are rejected with an error, not evaluated.
Condition language
Conditions are small, side-effect-free expressions.
Values you can reference
| Path | Type |
|---|---|
agent.id, agent.tags | id, string list |
subject.id, subject.kind | id, string (missing when no subject) |
action | string |
resource.type, resource.id, resource.attributes.<name> | per schema |
context.<name> | per schema |
request.time | timestamp (evaluation time, UTC) |
environment.type | sandbox or production |
Operators: ==, !=, <, <=, >, >=, in (value in list literal), contains (list contains value),
&&, ||, !, parentheses.
Functions: has(path), startsWith(s, prefix), endsWith(s, suffix), size(list),
hour_of_day(timestamp, "America/Toronto"), day_of_week(timestamp, "UTC") (1 = Monday).
condition: >
resource.attributes.owner_id == subject.id
&& context.document_classification in ["public", "internal"]
&& hour_of_day(request.time, "America/Toronto") >= 8There are no loops, regular expressions, network calls or user-defined functions, so evaluation time is bounded.
Missing attributes
If a condition references an attribute that wasn't sent, that comparison is false, so the rule doesn't match. For allow rules this is safe (no allow). For deny rules it can let a request through:
# Risky: if risk_score is optional and missing, this deny never fires.
- id: deny-risky
effect: deny
actions: [payments.initiate]
condition: context.risk_score > 80Fix it by making the attribute required in the schema, or by denying when it is absent:
condition: "!has(context.risk_score) || context.risk_score > 80"Publishing warns whenever a deny rule compares an optional attribute without has(). The warnings come back in the
publish response's warnings list, and reqlo policies push --publish prints them.
Versions
In the dashboard, Policies lists each policy as Live or Draft with a plain summary of what it does. Select Manage to see its rules and publish or unpublish it (owners and admins).
- Editing a policy changes its draft only. Drafts never affect decisions.
- Publishing validates the draft and creates a new immutable policy set version, such as
2026-11-07.2, used by new decisions within seconds. - Rolling back republishes an earlier version as a new version; history is never rewritten. A version is a snapshot
of every live policy together, so rolling back restores all of them. Owners and admins can roll back from the
History tab on the Policies page, or with
reqlo policies rollback <version>(API). The History tab shows what changed in each version. - Every decision records the
policy_versionit used.
Stateful limits
Conditions see one request at a time. A rule like "no more than 5,000 a day per user" needs cumulative state and cannot be enforced safely with a stateless condition, because concurrent requests could each pass. Enforce cumulative limits in your authoritative system with an atomic reservation (for example, a database transaction that reserves the amount), and use ReQlo for per-request rules.
Approval is not allow
require_approval produces approval_required, which is not permission to act. See
Human approvals.
Something wrong or unclear? Report an issue with this page.