arXiv(opens in a new tab)cs.CROct 2026Cited by 3 papers on PaperVantage

Manuscript Offprint

arXiv:2610.11030

NOMOS: Compiling Written Policies into Statically Verified Tool-Call Gates for LLM Agents

Min-Young Yu, Tony Kim, Jang Won Choi

Abstract

Tool-using LLM agents violate the policies they are deployed to enforce, often silently. Prior defenses hand-write rules, query an LLM verifier per action, or compile policies through heavyweight formal machinery. Naive compilation fails: extracted rules block the tool satisfying their own precondition, or read arguments their tool lacks. NOMOS, a four-pass compiler, turns a natural-language policy into a deterministic tool-call gate; static verification with tool-schema-level checks alone (no prover, solver, or LLM) repairs or rejects 37% (airline) and 13% (retail) of candidates, without which most shipped rules are inoperable. Replaying compiled rules over undefended transcripts flags bindings that refuse legitimate work (a development binding refused 95.9% of task-passing calls); no evaluation binding is flagged. On τ2\tau^{2}-bench the gate cuts violations of reference-encoded clauses among state-changing calls from 66.3% to 2.6% (airline) and 30.8% to 6.9% (retail), raising airline task success significantly for 2≤k≤42 \leq k \leq 4; a 26B on-premise compilation is not significantly worse than hand-written or frontier-compiled rules. Unlike AgentDojo's shipped defenses, it reaches a zero attack success rate (ASR) on banking, where nine attack families collapse onto three structural rules. On the other three suites its ASR is at most 3.6%, from goals with no tool call to govern and one write admitted by a binding weaker than its clause; a second agent model, Llama-3.3-70B, reproduces the effect on both benchmarks. Decisions take microseconds without an LLM call, at a domain-dependent benign-utility cost; compilation runs on-premise on open-weight gemma-4-26B.

1 Introduction

LARGE language model (LLM) agents that operate real tools (payment APIs, booking systems, customer databases) are deployed under written policies: money may only be sent to known counterparties, basic-economy bookings cannot be modified, destructive actions require explicit user confirmation. The model is shown the policy in its system prompt, and compliance is delegated to its reasoning. This fails in a characteristic way: the agent completes the surface task while silently violating the policy, and in permissive environments the tool executes the violating call without complaint. On τ2\tau^{2}-bench airline [1], we measure that 66.3% of the state-changing tool calls issued by an undefended 26B agent violate the reference-encoded clauses of the domain policy (36.8% under the more permissive batch reading of its confirmation clause, Section 4); under AgentDojo's prompt-injection attacks on its banking suite [2], the same model's attack success rate spans 35–47% across the standard and adaptive conditions (7–70% across all four suites under the standard attack).

Recent work splits into three camps. Deterministic enforcement with manual rules: Reason Less, Verify More [3] interposes four hand-crafted deterministic gates. This keeps the critical path LLM-free, but a human must author and maintain every gate: the bottleneck simply moves from the model to the policy engineer.

Automatic compilation with LLM enforcement: PolicyGuard [4] compiles policy documents into per-tool checklists automatically, but enforces them with an LLM verifier that reads

Corresponding author: Jang Won Choi (jameschoi@corners.co.kr). ORCID: Min-Young Yu, 0009-0007-2325-1469.

This work has been submitted to the IEEE for possible publication. Copyright may be transferred without notice, after which this version may no longer be accessible.

Preprint.

the full dialogue on every state-changing call, adding cost and latency proportional to traffic and degrading when the verifier model is swapped; in our reimplementation this costs +74% mean simulation wall-clock and one LLM call per state-changing decision (347 across 250 airline simulations), against microseconds and zero calls for a deterministic gate (Section 5.7).

Automatic compilation with deterministic enforcement: a recent line couples the two ends by inserting heavyweight formal machinery between them. FORGE [5] (first circulated as PCAS) has an LLM translate the policy document into Datalog, checks the result by manual review and by coverage and entailment checks against the source clauses, and enforces it with a reference monitor; VeriGuard [6] synthesizes policy code offline and discharges per-policy contracts with a Python static verifier in an iterative loop; Zwerdling et al. [7] compile policy documents into per-tool guard code, regenerated until tests that the pipeline derives from LLM-generated compliance and violation examples pass, scored against a separate hand-written suite and enforced at runtime on τ\tau-bench airline; agent instructions have been autoformalized into theorem-prover-checked Cedar policies [8], and tool-use policies into SMT constraints discharged by a solver at each call [9].

What this third line has not measured is which defects the machinery is protecting against, how often they occur, and how much of the machinery is actually necessary. We find that rules extracted by an LLM are not safe to enforce mechanically, that the defects fall into a small number of recurring structural classes whose real-world frequencies can be measured, and that detecting every structural class we observed in the two τ2\tau^{2}-bench compilations requires no prover, no solver, and no LLM, only the candidate rule, the tool schemas and two static tables of the predicate vocabulary, while the behavioral defect we observed needs recorded transcripts instead (Section 3.4).

In our raw extraction output, the clause “authenticate the user before any action” became a rule that blocked all tools while unauthenticated, including the two lookup tools that perform authentication: a deadlock from which no conversation can recover. A confirmation requirement was bound to eight read-only tools, so that merely checking a flight status would have demanded user approval. Other candidates read arguments their target tools do not accept, or referenced enabling tools that do not exist in the domain. An enforcement layer with no judgment of its own will execute these defects exactly as written.

Our system, NOMOS 1^{1} (Figure 1), makes the combination viable by inserting a static verification pass between extraction and enforcement. The compiler has four passes (PARSE, EXTRACT, RESOLVE, MATERIALIZE), of which only EXTRACT invokes an LLM. RESOLVE mechanically checks every candidate rule for self-blocking reachability, argument-signature consistency, domain satisfiability, state contradictions, and write-scope correctness, repairing or rejecting defective candidates; extraction is additionally stabilized by majority voting over repeated samples. The surviving rules drive a runtime gate that evaluates each proposed tool call against facts accumulated only from real tool results and user turns (never from the model's own claims), returning allow/block in microseconds without any LLM call.

References (35)