lexq-rules

lexq-rules is a skill for Claude Code, Codex from lexq-io/lexq-cli. It costs 0 tokens per session (3,497 once invoked), scanned A, original, Apache-2.0.

A guide to LexQ policy rules, where each rule checks conditions and runs actions when the incoming facts match. Rules are checked in priority order, with priority 1 checked first.

In plain words
What is it for?
Use it to create, edit, reorder, enable, or disable rules, and to define single-field or grouped conditions and their actions.
Why use it?
It explains how to structure conditions, combine them with logical operators such as AND, and control which matching rule takes precedence.

Skill for Claude CodeCodex

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/lexq-io/lexq-cli/lexq-rules
Any agent
npx skills add lexq-io/lexq-cli --skill lexq-rules
Clone the repo
git clone --depth 1 https://github.com/lexq-io/lexq-cli

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for lexq-rules

README.md
[![agentmods](https://agentmods.dev/badge/skills/lexq-io/lexq-cli/lexq-rules.svg)](https://agentmods.dev/skills/lexq-io/lexq-cli/lexq-rules)
Your own site
<a href="https://agentmods.dev/skills/lexq-io/lexq-cli/lexq-rules"><img src="https://agentmods.dev/badge/skills/lexq-io/lexq-cli/lexq-rules.svg" alt="Measured on agentmods" height="20"></a>
Per session 0 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,497 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00000 $0.03497
Opus 5 $0.00000 $0.01749
Sonnet 5 $0.00000 $0.00699
Haiku 4.5 $0.00000 $0.00350

Measured 4d ago against content hash 3f7c96eb96ef, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

lexq-rules scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 4d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/lexq-rules/SKILL.md · 420 lines

How it starts

The opening of the file, as written. The whole thing — 420 lines — stays where its author put it; the contents beside it link to each section on GitHub.

LexQ CLI — Policy Rules

Prerequisite: Read lexq-shared/SKILL.md first.

Overview

A Policy Rule is a condition → actions pair within a version. Rules are evaluated in priority order — lower number wins, and priorities are 1-based (1 is highest). When a rule's condition matches the input facts, its actions fire.

priority is assigned by the server, not by you. New rules are appended last. Use lexq rules reorder to change the order.

Rule Structure

{
  "name": "VIP 10% Discount",
  "condition": {
    ...
  },
  "actions": [
    ...
  ],
  "mutexGroup": null,
  "mutexMode": "NONE",
  "mutexStrategy": "HIGHEST_PRIORITY",
  "mutexLimit": null,
  "isEnabled": true
}

Condition Syntax

Conditions use a tree structure with two node types: SINGLE and GROUP.

SINGLE Condition

{
  "type": "SINGLE",
  "field": "paymentAmount",
  "operator": "GREATER_THAN_OR_EQUAL",
  "value": 100000,
  "valueType": "NUMBER"
}

GROUP Condition (logical combinator)

{
  "type": "GROUP",
  "operator": "AND",
  "children": [
    {
      "type": "SINGLE",
      "field": "customerTier",
      "operator": "EQUALS",
      "value": "VIP",
      "valueType": "STRING"
    },
    {
      "type": "SINGLE",
      "field": "paymentAmount",
      "operator": "GREATER_THAN",
      "value": 50000,
      "valueType": "NUMBER"
    }
  ]
}

Operators

Operators are constrained by the left fact's type. Using one outside its type is rejected by the server — check lexq facts list before choosing.

Fact type Allowed operators
STRING EQUALS, NOT_EQUALS, CONTAINS, IN, NOT_IN
NUMBER EQUALS, NOT_EQUALS, GREATER_THAN, GREATER_THAN_OR_EQUAL, LESS_THAN, LESS_THAN_OR_EQUAL, IN, NOT_IN
BOOLEAN EQUALS, NOT_EQUALS
LIST_STRING / LIST_NUMBER HAS_ANY, HAS_ALL, HAS_NONE

Read the full file on GitHub · 420 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 4d ago First seen · 420 lines · 0 tokens per session scan A 3f7c96eb96ef

Subscribe to this mod's changes

lexq-rules is a skill published in the GitHub repository lexq-io/lexq-cli (0 stars, last pushed 6d ago), licensed Apache-2.0. It costs nothing until one of its globs matches a file; then it loads 3,497 tokens. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.