RIL
RIL is a policy language for AI tool calls. Write a rule for when an agent can act, when a person must approve, and when the agent must stop. Require the RIL check in CI to catch pull requests that weaken those rules.
v0.2.1 · Open specification + free binary · macOS, Linux & Windows
An agent requests a tool call. RIL evaluates it offline and fails closed. The v0.2.1 release reports 6.6 ms.
- Deny A destructive shell command is blocked.
- Hold A customer data export waits for the named data owner.
- Allow A read of approved documentation can proceed.
A change touches critical lifecycle and authorisation code. RIL checks the proof and test bindings for those files.
- Kani CBMC The authorisation invariant passes its proof harness.
- Quint The model verifies that two claims cannot be active at once.
- Tests The bound regression suite passes.
A pull request changes laws.ril. RIL compares the rules and proof requirements with the base branch.
- Diff check Detects removed rules, widened permissions and downgraded proofs.
- Required check CI blocks a merge when the diff gate fails.
PR Gate passed: no rule or proof check was weakened. PR Gate blocked (exit 1): rule removed or proof downgraded.
From live tool call to merge gate.
A single language sets the rules for runtime requests and the checks that guard changes to your code and policies.
-
Action request
An integrated agent sends RIL the requested tool, resource and context.
-
Fail-closed decision
Forbid beats ask, and ask beats permit. Unmatched requests and evaluation errors are denied.
-
Human approval
An ask decision holds the request while the integration obtains approval from the designated person.
-
Formal proof check
Code laws bind invariants to formal checkers and regression tests.
-
Pull request diff gate
A required CI check blocks changes that remove a law or weaken its protections.
Control you can show, not just claim.
Use RIL to check a tool call, verify an invariant or require a policy check before merging code.
Fail-closed action rules
Send tool requests from Claude Code, MCP clients or Retvest apps through the local governor. Forbid wins over ask and permit, and requests that match no rule are denied.
Proofs bound to code
Link an invariant to the files it protects and the checks that verify it. Bind Kani CBMC, Quint, Verus, Lean or Bend proofs, or use test commands for regression checks.
Pull requests that respect the rules
Require
ril laws diffin CI so a pull request cannot merge if it removes a law, widens a permission or downgrades a proof check.Open specification and free engine
Use the Apache-2.0 language specification, 10-case conformance suite and editor grammar. Run the proprietary native engine for free on macOS, Linux or Windows.
Good questions.
What happens when a tool call has no matching rule?
RIL denies it. Evaluation errors also fail closed. Forbid takes precedence over ask and permit. An ask decision lets the calling integration hold the request for human approval.
How does RIL verify an invariant?
A code law names the files it protects and binds the invariant to a checker such as Kani CBMC, Quint, Verus, Lean or Bend. You can also bind a test command to guard against regressions.
How does RIL block a change that weakens policy?
The diff command compares a pull request’s rules against the base branch and exits with an error when it detects weakened rules or proofs. Make that check required in CI to block the merge.
How do coding agents and MCP clients connect?
Put the RIL evaluator in a pre-tool hook or between an MCP client and its tools. Use its decision to stop, hold or allow the call. Try the CLI commands and interactive policy example.
How is RIL licensed?
RIL uses a licensing model similar to PL/SQL, with an open language specification and a proprietary execution engine. The native binary is free under the Retvest Free Binary License. The specification, conformance suite and editor tooling use Apache-2.0.
Stop trusting prompts. Try RIL v0.2.1 today.
Retvest is an independent, non-commercial software project. Nothing on this site is for sale. Download the free RIL v0.2.1 binary for macOS, Linux, or Windows on GitHub.