complier
Give your agents rules, not just instructions.
A prompt asks an agent to publish only after a review. complier makes it so. You write which tool
calls count as which steps (a translation unit, in CEL) and the order those steps may happen in
(a contract, in CSP). Your agent's harness asks complier before it runs each MCP tool call,
and complier refuses the ones that are out of turn, telling the agent why.
Live demo and walkthrough: complier.dev
How it works
agent (Claude Code + the complier plugin)
│ tool call, e.g. mcp__notion__notion-update-page {page_id: "p1", command: "replace_content"}
▼
pre-tool-use hook ──── asks the daemon ────► translation unit (CEL rules) ──► event: overwritten.p1
│ │
│ is the event allowed by the contract (CSP) now?
│ no ──► denied before it runs, with the reason
▼ yes
the harness runs the call on its own MCP server (e.g. Notion), with its own sign-in
-
Translation units are proven before they load. Google's CEL verifier (with Z3) checks that no
call matches two rules and every call matches a rule or the fallback. A unit that isn't proven
is refused. See cel/README.md.
-
Contracts are CSP policies, proven and compiled by FDR. A spec defines Act, Value,
Returns(x) and a Policy over attempt, allow, deny and result, built from Permit and
Deny, and it states its agent and system explicitly:
Agent = ControllableCHAOS
System = prioritise(Agent [| {|attempt, allow, deny, result, refuse|} |] ComplierGuard(Policy),
<{|attempt|}, {refuse}>)
With several agents, the spec declares datatype Role, every event carries the role
(attempt.writer.submit), and each agent is its own ControllableCHAOS:
Agent = ||| r : Role @ ControllableCHAOS(r). An agent's calls are attempted as its
COMPLIER_ROLE.
At machine up, FDR checks that Agent is ControllableCHAOS (one per role) and System is that
composition (so every property is proven against the most general agent), that the policy
answers every attempt it takes, can't leave an agent waiting, is deterministic, with finish
can't leave an agent unable to do anything unless it finished, and passes the
spec's own assertions, then compiles it into an automaton. The daemon only walks that automaton;
complier doesn't interpret CSP itself.
-
Allow, deny or refuse. A call becomes attempt.<role>.<action>. If the policy offers it, the
policy's own allow or deny edge is the verdict; if not, the call is refused and the policy
stays where it was. Only allowed calls run.
-
Nothing polls the world. Agents' translated calls are the only outside events.
-
Fails closed. An MCP call the units don't cover, that can't be translated, or that can't be
checked (no daemon, no machine) is denied. Built-in tools (Bash, Edit, ...) are checked only in
a machine with a claude-code unit, which then blocks the ones it doesn't name; otherwise the
hook only stops them editing the configuration that enforces all this.
Repository map