# rule-injector

Moves agent behavioural rules out of the system prompt and injects each one at the point of need, through three hooks: pre_llm_call for behavioural guards.

- Type: Plugin
- Version: 1.1.0
- Updated: 22 Nov 2026
- Publisher: klautimus
- Category: Automation

[Contact us](https://www.ulpi.io/en/support#contact)

## What it does

Moves agent behavioural rules out of the system prompt and injects each one at the point of need, through three hooks: pre_llm_call for behavioural guards, transform_tool_result for corrections the model reads in place, and pre_verify as a completion gate. A rule is {trigger, inject} — matched on keywords, regex, tool name, tool error, path or session scope, or a boolean compound of those — with a per-turn injection budget and an undroppable always-on floor.

An optional adjudicator adds a semantic second pass over ambiguous turns, and propose.py drafts a rule from a user correction.

## How to set it up

Ships a local web dashboard (, FastAPI, read-only) that lists the rule set and the recent activation trace, and seven starter rules; rules.json is a template the user replaces.

```
python3 dashboard.py
```

Disclosure — writes one activation trace line per fired rule, a rule-drafting audit line, and (only with the adjudicator enabled) a 48-hour verdict log holding excerpts of the user message and recent turns, all under the active ULPI_HOME's logs/ directory, and writes the plugin's rules.json when a rule is created through its own CLI; no shell and no telemetry; the optional dashboard (, fastapi + uvicorn installed by the user) binds 127.0.0.1 and only reads the rules file and trace log; semantic triggers download a sentence-transformers embedding model from Hugging Face once and then run locally; the optional adjudicator, only when enabled, sends the current turn to the user's active model through Ulpi's plugin LLM facade and holds no key of its own.

```
python3 dashboard.py
```

## Review notes

What an owner reads and accepts before the install is approved.

- Ulpi has not reviewed this version: it is listed in the public plugin catalog, and the install still fetches it at its pinned commit, checks its shape and scans it before you approve

## More in Automation

- [Rung](https://www.ulpi.io/en/marketplace/plugins/rung): Stops an agent from marking its own work done until the tests you approved pass.
- [RunProof](https://www.ulpi.io/en/marketplace/plugins/runproof): Verify a Ulpi cron report and release its exact bytes to a local outbox once per workflow slot.
- [Selenite](https://www.ulpi.io/en/marketplace/plugins/selenite): Takes friction off the person, treated as accessibility: one test, "does this step, wait or check earn its cost to you?", applied to steps handed to a person.

[All listings →](https://www.ulpi.io/en/marketplace) · [Publisher's guide →](https://www.ulpi.io/en/docs) · [Report a problem →](https://www.ulpi.io/en/security#report)
