{"id":"052f7cd7-cf95-417f-a4f0-88fc06bf357e","arxiv_id":"2609.18128","paper_version":1,"verdict":"ACCEPT","confidence":"HIGH","novelty_score":7.0,"correctness_risk":"low","formal_verification":"none","parameter_count":0,"one_line_summary":"ContrAgent uses assume-guarantee contracts in LTLf, compiled to DFAs, to provide deterministic, model-agnostic online enforcement and offline evaluation of LLM agent tool calls with orders-of-magnitude lower latency than LLM-based judges.","lead":"ContrAgent formalizes safety rules for LLM agent tool calls as temporal logic contracts, then compiles them into deterministic automata that block unsafe actions instantly or score completed trajectories. It provides the same deterministic verdict regardless of which LLM powers the agent, at microseconds per check instead of milliseconds.","discovery_kind":"new_method","skeptic_critique":{"model":"deepseek/deepseek-v4-flash","headline":"AgentDojo 'matches SOTA' relies on trace-learned contracts mined from the attack traces being evaluated; the fair no-detector variant is worse than LlamaFirewall and tool_filter on ASR.","rationale":"The paper's substantive contribution—compiling ALTLf contracts into deterministic monitors that gate online and score offline—is real, and the SOPBench, R-Judge, and tau2-bench results, plus the released implementation, support that contribution. The reader's weakest assumption about predicate coverage is honestly acknowledged by the authors and is not the place where the central claim is least secure: a coverage gap weakens completeness but not the parity claim with baselines. The load-bearing point is the AgentDojo evidence for 'matches state-of-the-art guardrails.' In Table 3, the only clean, no-attack-knowledge variant has higher ASR than three published guardrails, and the variant that beats them is built from the very attack traces on which it is scored. A split evaluation or a no-detector-only comparison would settle whether the parity claim holds. Because this affects the headline but not the framework's validity, I would move from ACCEPT to CONDITIONAL rather than reject.","tokens_in":18556,"tokens_out":7154,"duration_ms":56479,"concrete_test":"Split AgentDojo tasks into two halves: mine trace-learned contracts from one half, then evaluate on the held-out half, and re-run LlamaFirewall and tool_filter in the same harness on the same held-out tasks. If held-out trace-learned ASR materially exceeds 0.79%, or no-detector ASR remains about 11% versus about 1.75% for LlamaFirewall, the headline parity claim should be qualified.","verdict_should_be":"CONDITIONAL","load_bearing_attack":"The headline claim is that ContrAgent 'matches state-of-the-art LLM-judge and rule-based guardrail baselines.' AgentDojo is the benchmark that directly tests this against guardrails, and it is also where the claim is least secure. In Table 3, the no-detector setting—the only variant whose contracts are built without knowledge of the attacks—has ASR 11.1% on gpt-4o, versus 7.95% for pi_detector, 6.84% for tool_filter, and 1.75% for LlamaFirewall. On the safety axis, ContrAgent(ND) is therefore not matching the best guardrails. The 0.79% ASR that beats all baselines comes from the trace-learned variant, whose contracts are 'mined from the recorded traces of the attacks themselves' (§6.2) and then evaluated on those same recorded traces. That is test-set leakage: the contract library encodes the attacks it is then scored against. The comparison is also asymmetric—baseline rows are AgentDojo's published numbers, while ContrAgent rows are replayed through the authors' harness—so the parity claim is not established under identical conditions. This does not undermine the deterministic, low-latency monitor itself, but it removes AgentDojo as support for the central parity claim.","agreement_with_reader":"disagree"},"referee_report":{"model":"deepseek/deepseek-v4-flash","summary":"The paper presents ContrAgent, a framework that formalizes trajectory-level safety requirements for LLM agents as assume-guarantee (A/G) contracts in Linear Temporal Logic on finite traces (LTLf), compiles each contract into a deterministic finite automaton (DFA), and uses the DFA to both gate agent actions online and evaluate recorded traces offline. The framework is model-agnostic and deterministic. It is evaluated on four benchmarks: SOPBench (SOP enforcement), AgentDojo (indirect prompt injection), R-Judge (risk evaluation), and τ2-bench (procedural compliance). The central claim is that ContrAgent matches state-of-the-art LLM judge and rule-based guardrail baselines while providing deterministic, reproducible verdicts and orders-of-magnitude lower per-call latency.","tokens_in":18734,"tokens_out":2465,"duration_ms":24474,"significance":"If the claims hold, the paper addresses a genuine gap: existing safeguards are either stochastic (LLM judges) or single-action (per-action rule checkers); no single artifact provides both online enforcement and offline evaluation while remaining deterministic and model-agnostic. The use of A/G contracts and LTLf is a principled way to capture temporal properties (order, history, count) that stateless guards miss. The deterministic nature and low latency are practical advantages. The evaluation spans multiple benchmarks and models, and the limitations are explicitly discussed. The work is significant for the safety of tool-augmented LLM agents and builds on a mature formal-methods tradition.","major_comments":[{"comment":"The central claim that ContrAgent 'matches state-of-the-art LLM-judge and rule-based guardrail baselines' is not uniformly supported by the AgentDojo results. The no-detector (ND) variant, which uses contracts built without knowledge of attacks, achieves an ASR of 11.1% on gpt-4o, which is worse than tool_filter (6.84%) and much worse than LlamaFirewall (1.75%). The trace-learned (TL) variant achieves 0.79%, but this variant mines contracts from the attack traces themselves (§6.2: 'Contracts can also be mined from the recorded traces of the attacks themselves'). This creates a form of test-set leakage: the contracts encode the attacks they are later scored against. Furthermore, the baseline ASR and utility numbers are AgentDojo's published numbers, while ContrAgent's numbers are replayed through the authors' harness, so the comparison is not under identical conditions. The paper should clearly distinguish between the ND and TL settings in the abstract and conclusions, and either adjust the parity claim or provide a fairer comparison (e.g., re-running baselines under the same harness or restricting the claim to the ND setting for the matching claim).","section":"§6.2, Table 3"},{"comment":"The paper states that the contract library is built from the task and environment specifications of AgentDojo's four suites 'without knowledge of the attacks' for the no-detector setting. This is fine, but the trace-learned contracts are then presented in the same table (Table 3) as a variant of ContrAgent, and the text says 'ContrAgent matches state-of-the-art'. This conflates two fundamentally different modes: one that uses only independent specification knowledge and one that uses attack knowledge. The paper should explicitly label the TL variant as an oracle-like upper bound and discuss that it does not represent a deployable guardrail because it requires knowledge of specific attacks. The comparison to baselines should focus on the ND variant for fair evaluation of the framework's inherent capabilities.","section":"§6.2"}],"minor_comments":[{"comment":"The joint-k metric (combining outcome and zero contract violations) is useful, but the paper should clarify how 'zero contract violations' is defined across retries: is it zero rule fires summed over all k retries, or zero in each individual retry? Table 9 suggests it is per-retry, but Figure 6's caption should be more explicit.","section":"§6.4, Figure 6"},{"comment":"The description of the bidirectional enforcement (blocking calls and suppressing returns/inputs) is clear, but it would be helpful to give an example of a return event that would falsify an assumption and how that is handled concretely.","section":"§5.2"},{"comment":"The column 'Utility' for LlamaFirewall is listed as 'n/a' with a footnote in the text saying 'every utility value is computed from the published runs'. It should either provide an approximate value from the published data or explain why it is not available.","section":"Table 3"},{"comment":"The average runtime for ContrAgent is reported as 0.135s extra over base. It would be useful to show the absolute median runtime per task for all conditions, not just the extra time.","section":"§6.1, Table 2"},{"comment":"The figure caption says 'ContrAgent monitors the tool-call interface'. It could be improved by noting that returns are also monitored for assumption checking.","section":"§1, Figure 1"},{"comment":"The column 'recall' is defined as 'unsafe caught'. It should be clarified that this is the fraction of unsafe traces (where the agent attempted a forbidden action) that were correctly blocked. The definition might be confused with trace-level recall versus event-level recall.","section":"Appendix C, Table 6"}],"recommendation":"major_revision"},"author_rebuttal":null,"desk_editor":{"model":"deepseek/deepseek-v4-flash","letter":"Thanks for the heads-up on this one.  Quick take: the paper does real engineering well, but it overclaims on one benchmark in a way that will get flagged in review.\n\nWhat's actually new:  They formalize assume-guarantee contracts over LTLf for LLM agent supervision—that combination is new, and the two-role (online/offline) use of compiled DFAs is clean.  The contract library concept is also genuinely portable: same DFAs work across models.  SOPBench is where the paper shines—model-agnostic safety enforcement with sub-millisecond latency, and the constraint scaling analysis shows real advantage over prompting.  R-Judge and tau2-bench evaluations are solid too.\n\nSoft spots:  The headline claim that ContrAgent 'matches state-of-the-art…baselines' rests heavily on AgentDojo, and there the evidence is shaky.  The no-detector variant (the fair one, no knowledge of attacks) gets 11.1% ASR versus 1.75% for LlamaFirewall and 6.84% for tool_filter—so it doesn't match the best guardrails on safety.  The trace-learned variant that beats everything (0.79% ASR) mines contracts from the attack traces and then evaluates on those same traces.  That's test-set leakage; the paper essentially trains on the test data.  The authors are transparent about this by labeling it as such, but the abstract and conclusion don't qualify the claim.  Also, the baseline comparisons are against published numbers, not co-run in the same harness, which is a minor concern.\n\nOverall: the central contribution—deterministic, low-latency, model-agnostic supervision via compiled contracts—holds up.  The SOPBench results are unambiguous.  But the AgentDojo parity claim needs honest revision.  A serious referee will need to press on this.\n\nRecommendation:  It deserves peer review.  The framework is sound and the other evaluations are strong.  I'd recommend they accept after the authors clean up the AgentDojo claims and clearly separate the no-detector vs. trace-learned results in the abstract and conclusion.  Worth discussing in reading group for the formal methods angle.","headline":"Solid engineering contribution with a genuine new formalization—but the AgentDojo 'matches SOTA' claim is weaker than advertised because the fair variant (no detector) is worse than best baselines and the trace-learned variant leaks test data.","tokens_in":19259,"tokens_out":1181,"duration_ms":13060},"pith_extraction":{"msc":["68Q60","68Q45"],"pacs":[],"model":"deepseek/deepseek-v4-flash","headline":"A single deterministic artifact — a contract compiled to a finite automaton — can both block unsafe tool calls in real time and grade recorded agent traces, matching stochastic LLM judges at sub-millisecond cost.","keywords":["LLM agent safety","assume-guarantee contracts","linear temporal logic on finite traces","deterministic finite automata","runtime enforcement","tool-call trace monitoring","LLM guardrails","procedural compliance"],"falsifier":"Run the compiled contract library over a corpus of purely textual agent failures — harmful replies, denial-of-service diversions, persuasion-only attacks with no side-effecting tool call. The verdicts are computed from tool-call structure alone, so detection must be near zero on such a corpus; a materially nonzero detection rate would contradict how the framework is said to work, while a near-zero rate confirms the boundary the paper draws. A sharper second test: find two recorded traces with identical tool-call event sequences but different free-text content; the checker must return identical verdicts on both, so any real safety difference between such traces would falsify the claim that these verdicts capture the safety-relevant behavior.","tokens_in":20143,"feed_emoji":"🛡️","tokens_out":17031,"duration_ms":114171,"temperature":0.7,"pith_summary":"This paper is trying to establish that safety supervision of tool-using LLM agents need not be stochastic or limited to one action at a time: a single deterministic artifact, an assume-guarantee contract over checkable tool-call predicates compiled to a finite-state automaton, can both block unsafe calls before they execute and replay a recorded trajectory into a reproducible verdict. The framework formalizes an agent's behavior as a trace of tool-call events over a fixed vocabulary of predicates (which tool fired, what its arguments and results matched, what data flowed where, running counts and totals), expresses required behavior as contracts in linear temporal logic on finite traces, and compiles each contract to a deterministic finite automaton. On four benchmarks spanning enforcement and evaluation, it matches or beats LLM-judge and rule-based guardrail baselines while adding about 0.16 ms per call and never invoking a language model at runtime. A sympathetic reader would care because determinism and model-independence change what a verdict is worth: the same trace always yields the same answer, policies transfer across backbone models unchanged, and outcome-only success scores can be paired with verifiable procedural checks.","feed_headline":"One deterministic checker both guards and grades LLM agent runs","feed_subtitle":"Reproducible, model-agnostic verdicts at sub-millisecond cost, matching stochastic judge baselines.","key_machinery":"The carrying object is the interaction predicate: a deterministic Boolean test $P(s,a,c)$ evaluated against the session state $s$, the incoming tool-call event $a$, and a parameter $c$ — structural tests such as $\\mathrm{Call}(T)$, $\\mathrm{ArgHas}(T,f,p)$, and $\\mathrm{Flow}(s,d)$, plus numeric accumulators such as $\\mathrm{Cnt}(T)\\le N$ and $\\mathrm{Tok}\\le c$ that read counters updated at each event. Contracts are assume-guarantee pairs $(\\varphi_A, \\varphi_G)$ in arithmetic linear temporal logic over finite traces, with predicates the agent decides separated from predicates its environment decides; each formula compiles by the standard LTLf-to-DFA construction into a deterministic finite automaton whose alphabet is the set of predicate valuations at an event. At runtime a monitor advances every contract's two automata incrementally on each event, at cost $O(|C|)$ per call independent of trace length, and reads the contract's value on a three-valued scale: assumption failed, still active, or guarantee violated. Two further pieces carry the practical claims: the contract library, a model-agnostic knowledge base loadable across agents that share a tool interface, and a grounding step that evaluates every predicate by pattern match and counter update, with no language model in the loop, which is what makes verdicts deterministic and reproducible.","core_discovery":"The paper's central claim is that a contract library written over tool-call traces gives one deterministic checker two complementary powers that previously required separate mechanisms. Online, the checker advances each contract's automaton one event at a time and blocks the first tool call that would falsify a guarantee, or suppresses the first event that would falsify an assumption, so the agent never executes a violating action and the session continues from the last clean prefix. Offline, the identical automata replay a recorded trace and return a per-contract three-valued verdict (assumption failed, still active, or guarantee violated) with the triggering event named, and the same trace always produces the same verdict. The empirical case is made on four benchmarks: 98% safety at 90% success on SOPBench, pooled attack-success rate on AgentDojo cut from 18.0% to 5.3% and to 1.7% with trace-learned contracts, 91.8% average F1 on R-Judge, and, on tau2-bench, a joint outcome-plus-compliance score showing models that earn high outcome scores still violate procedural rules on every successful run. Because verdicts come from pattern matches and counters rather than model inference, the same library runs across 23 backbone models with false-positive rates under 1% for 19 of them, and a weak agent that collapses a prompted policy's safety from 94% to 45% leaves the compiled contract's enforced safety at 98%.","pith_inferences":["A testable extension the paper names only as future work: compile contracts into reward machines, and because per-event verdicts are deterministic and sub-millisecond, use them as dense reward shaping for post-training — a role stochastic LLM judges cannot fill reliably.","An implicit consequence of the predicate design is that exposing content-level sensors as additional atomic propositions would let the same automata compose semantic and structural checks, closing the free-form-harm gap the paper explicitly leaves to a separate content-level pipeline.","The trace-learned contracts on AgentDojo suggest a self-hardening loop — mining contracts from attack traces, enforcing them, then re-mining — that could shrink the coverage-driven residual gaps behind the paper's roughly 25% SOPBench miss rate without altering the deterministic core.","For multi-agent hierarchies, the assume-guarantee split already classifies other agents' actions as environment events, so the same checkers could supervise delegating agents by monitoring the boundary between them — a decomposition the paper lists as future work."],"forward_implications":["Safety policies become portable: one contract library, compiled once, supervises any agent or model that shares the tool interface, so a domain's policies transfer between models without re-authoring.","Trajectory-level properties — ordering, history, and count constraints like refund-only-after-approval, file immutability after a check, and transfer caps — are enforced online even when every individual call in a violating trace is locally legitimate.","Evaluation becomes deterministic and attributable: the same trace always yields the same verdict, naming the violated contract and the triggering event, which turns audits and policy repair into concrete operations.","Outcome-only benchmark metrics conceal procedural violations; requiring zero contract violations alongside a correct final state exposes reward hacking, as when Claude 3.7's 25–60% outcome score on tau2-bench falls to 0% joint score.","Enforced safety decouples from model capability: swapping in a weaker base model drops a prompted SOP's mean safety from 94% to 45%, while the compiled contract's enforced safety stays at 98%."],"supporting_citations":[{"why":"Supplies the LTLf-to-DFA construction that turns each contract formula into the deterministic checker both supervision roles run on.","marker":"De Giacomo and Vardi 2013"},{"why":"Source of the assume-guarantee contract semantics — valid implementation, valid environment, consistency, compatibility — that the framework adapts to agent traces.","marker":"Benveniste et al. 2018"},{"why":"Provides arithmetic LTLf monitoring, lifting the logic from plain propositions to constraints over counters and accumulated quantities.","marker":"Felli et al. 2023"},{"why":"Supplies the three-valued runtime-verification semantics behind the contract valuation scale.","marker":"Bauer, Leucker, and Schallhart 2006"},{"why":"Residual-formula incremental monitoring is what yields the O(|C|) per-event cost and sub-millisecond online gating.","marker":"Roşu and Havelund 2005"},{"why":"Supplies AgentDojo, the benchmark with the attack scenarios and published baseline defense numbers the framework must beat.","marker":"Debenedetti et al. 2024"},{"why":"Supplies SOPBench, the standard-operating-procedure benchmark used to test online enforcement and the 23-model sweep.","marker":"Li et al. 2025"},{"why":"Supplies R-Judge, the post-hoc safety-risk benchmark whose GPT-4o and human baselines the offline evaluator is measured against.","marker":"Yuan et al. 2024"},{"why":"Supplies tau2-bench, the dual-control conversational benchmark whose outcome-only pass-k metric contract replay supplements with procedural compliance.","marker":"Barres et al. 2025"},{"why":"Defines the LLM-as-judge grading paradigm that the deterministic offline evaluator is contrasted with on reproducibility.","marker":"Zheng et al. 2023"}],"fun_headline_variants":["One automaton guards and grades every tool call","Deterministic contract checker beats stochastic judges","Sub-millisecond guard and grade for LLM agents","Contract library blocks violations before they happen","Model-agnostic verdicts with zero latency variance"],"cache_read_input_tokens":0,"weakest_assumption_plain":"The load-bearing premise is that every safety-relevant fact about an agent's behavior shows up in the tool-call trace and can be expressed in the fixed predicate vocabulary; the paper concedes that purely textual harms, or properties no predicate covers, pass through, and its own residual misses — 82% of the AgentDojo attacks it fails to catch issue no malicious tool call at all — sit exactly on that boundary.","fun_headline_variants_meta":{"raw":{"variants":["One automaton guards and grades every tool call","Deterministic contract checker beats stochastic judges","Sub-millisecond guard and grade for LLM agents","Contract library blocks violations before they happen","Model-agnostic verdicts with zero latency variance"]},"model":"deepseek/deepseek-v4-flash","effort":"low","cost_usd":0.000268,"raw_usage":{"cost":0.000267568,"is_byok":false,"cost_details":{"upstream_inference_cost":0.000267568,"upstream_inference_prompt_cost":0.000126448,"upstream_inference_completions_cost":0.00014112},"total_tokens":1612,"prompt_tokens":1108,"completion_tokens":504,"prompt_tokens_details":{"audio_tokens":0,"video_tokens":0,"cached_tokens":256,"cache_write_tokens":0},"completion_tokens_details":{"audio_tokens":0,"image_tokens":0,"reasoning_tokens":432}},"tokens_in":1108,"tokens_out":504,"cost_source":"openrouter_usage","duration_ms":5990,"image_pages":[],"temperature":1.0,"reasoning_tokens":432,"transport_provider":"openrouter","cache_read_input_tokens":0,"cache_creation_input_tokens":0},"cache_creation_input_tokens":0},"created_at":"2026-09-17T11:43:09.884520+00:00","model_set":{"reader":"deepseek/deepseek-v4-flash"},"pipeline_version":"pith-pipeline@v1.4.1-daily-deepseek-or-medium","input_kind":null,"input_chars":null,"input_total_chars":null,"passes_missing":null,"published_standing":null,"published_confidence":null,"objection_audit":null,"run_record":null,"basis":{"kind":"not_recorded","source":null,"chars_given":null,"chars_total":null},"receipt":null,"falsifier":"Run the compiled contract library over a corpus of purely textual agent failures — harmful replies, denial-of-service diversions, persuasion-only attacks with no side-effecting tool call. The verdicts are computed from tool-call structure alone, so detection must be near zero on such a corpus; a materially nonzero detection rate would contradict how the framework is said to work, while a near-zero rate confirms the boundary the paper draws. A sharper second test: find two recorded traces with identical tool-call event sequences but different free-text content; the checker must return identical verdicts on both, so any real safety difference between such traces would falsify the claim that these verdicts capture the safety-relevant behavior.","supporting_citations":[{"cited_title":null,"cited_arxiv_id":null,"evidence_quote":"Supplies the LTLf-to-DFA construction that turns each contract formula into the deterministic checker both supervision roles run on."},{"cited_title":null,"cited_arxiv_id":null,"evidence_quote":"Supplies AgentDojo, the benchmark with the attack scenarios and published baseline defense numbers the framework must beat."},{"cited_title":null,"cited_arxiv_id":null,"evidence_quote":"Supplies R-Judge, the post-hoc safety-risk benchmark whose GPT-4o and human baselines the offline evaluator is measured against."},{"cited_title":null,"cited_arxiv_id":null,"evidence_quote":"Defines the LLM-as-judge grading paradigm that the deterministic offline evaluator is contrasted with on reproducibility."}],"lane_accuracy":{"status":"not yet measured","lane":{"model":"deepseek/deepseek-v4-flash","input_kind":null},"url":"https://pith.science/accuracy"},"review_version":1}