Artificial Intelligence · arXiv:2609.18128 v2 · submitted 16 Sep 2026
Symbolic Temporal Supervision of LLM Agents Using Contracts
The paper says
“Large language model (LLM) agents augmented by tools can automate complex, multi-step tasks, such as web navigation, code generation, and workflow orchestration, by acting on external systems through tool calls.”
more of the abstract
However, hallucinations, distributional instability, and adversarial manipulations in LLMs, and the irreversible consequences of certain tool calls can lead to harmful outcomes. These risks call for safeguards that can check requirements across a trajectory, both before actions execute and when recorded behavior is evaluated. We present ContrAgent, a contract-based framework for symbolic temporal supervision of LLM agents. ContrAgent captures an agent's behavior as a sequence of tool calls and formalizes it as a trace over a fixed set of checkable predicates. It then specifies required behaviors using assume-guarantee contracts in linear temporal logic over finite traces (LTLf). Each contract is compiled to a deterministic finite automaton (DFA) that serves two roles: gating agent actions online and evaluating recorded traces offline. A contract library, acting as a reusable knowledge base, is maintained independently of the agent's model and can be applied across different agents within the same task domain. We show the effectiveness of our approach on four benchmarks spanning both roles, where ContrAgent is competitive with LLM-judge, classifier, and guardrail baselines while producing deterministic, reproducible verdicts and, in the online mode, orders of magnitude lower per-call latency.
from the abstract
Pith says
Machine review · deepseek-v4-flash · 17 Sep 2026 · of version 1 of the paper; version 2 is newer · what was read was not recorded · not checked by a person
It can be wrong. Challenge this review or reply to it.
The passes disagreed. Reader: holds up. Skeptic: holds up only with conditions. Referee: major revision.
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. This line is wrong
2 major objections · 6 minor
How often objections from reviews like this one are right: not yet measured
Not checked: figures, code, what the references say.
The paper says, at §6.2, Table 3
The review did not quote this passage.
Pith says: Objection 1 of 2 · major
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%).
more of objection 1
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).
The paper says, at §6.2
The review did not quote this passage.
Pith says: Objection 2 of 2 · major
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'.
more of objection 2
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.
6 minor objections
The paper says, at §6.4, Figure 6
Pith says: minor objection 1 of 6
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.
The paper says, at §5.2
Pith says: minor objection 2 of 6
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.
show 4 more
The paper says, at Table 3
Pith says: minor objection 3 of 6
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.
The paper says, at §6.1, Table 2
Pith says: minor objection 4 of 6
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.
The paper says, at §1, Figure 1
Pith says: minor objection 5 of 6
The figure caption says 'ContrAgent monitors the tool-call interface'. It could be improved by noting that returns are also monitored for assumption checking.
The paper says, at Appendix C, Table 6
Pith says: minor objection 6 of 6
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.
What would settle it
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.
from the skeptic's reading
How the review went
4 readings by deepseek-v4-flash · 17 Sep 2026
- Reader holds up
- Skeptic disagrees: says it holds up only with conditions 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.
- Editor wrote the verdict above
- Referee major revision: 2 major objections, 6 minor
Not run on this paper: the simulated authors' defence.
Pith did not check this review's objections against the paper.
The review in full
The review in brief, machine-written
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.
What'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.
Soft 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.
Overall: 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.
Recommendation: 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.
The strongest objection
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.
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.
The referee's report
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.
Pith's reading of the paper (a machine's summary, not the authors')
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.
What carries the argument. 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 claim. 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%.
The premise it rests on. 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.
If the paper is right (Pith's inferences, not the authors')
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%.
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.
Check this review
Pith stored no record of this review's passes and took no fingerprint of it. Reviews made by code from 13 Nov 2026 on carry both.
How often reviews like this one are right
Reviews like this one: written by deepseek-v4-flash, where what was read was not recorded.
How often objections from reviews like this one are right: not yet measured
Reviews by people
This review was written by a machine. No person has reviewed this paper on Pith yet. A scientist listed on Pith can review it for a fee, and their review is published here whatever it concludes.
The paper
Abstract
Large language model (LLM) agents augmented by tools can automate complex, multi-step tasks, such as web navigation, code generation, and workflow orchestration, by acting on external systems through tool calls. However, hallucinations, distributional instability, and adversarial manipulations in LLMs, and the irreversible consequences of certain tool calls can lead to harmful outcomes. These risks call for safeguards that can check requirements across a trajectory, both before actions execute and when recorded behavior is evaluated. We present ContrAgent, a contract-based framework for symbolic temporal supervision of LLM agents. ContrAgent captures an agent's behavior as a sequence of tool calls and formalizes it as a trace over a fixed set of checkable predicates. It then specifies required behaviors using assume-guarantee contracts in linear temporal logic over finite traces (LTLf). Each contract is compiled to a deterministic finite automaton (DFA) that serves two roles: gating agent actions online and evaluating recorded traces offline. A contract library, acting as a reusable knowledge base, is maintained independently of the agent's model and can be applied across different agents within the same task domain. We show the effectiveness of our approach on four benchmarks spanning both roles, where ContrAgent is competitive with LLM-judge, classifier, and guardrail baselines while producing deterministic, reproducible verdicts and, in the online mode, orders of magnitude lower per-call latency.
The paper's own sentences, arranged, kept beside the review and separate from it. Each label is drawn from a closed vocabulary; the number beside it is the probability the classifier gave that label. No sentence in this record was written by a model.
abstract compiled · 2026-09-23
The authors' main claim, as the classifier picked it out 1.00
“We show the effectiveness of our approach on four benchmarks spanning both roles, where ContrAgent matches state-of-the-art LLM-judge and rule-based guardrail baselines while producing deterministic, reproducible verdicts and, in the online mode, orders-of-magnitude lower per-call latency.”
How the main claim is stated: asserted 1.00
What the abstract itself states, as probabilities: claims first 0.22 · states limitation 0.10 · human participants 0.04 · controlled comparison 0.86 · randomized assignment 0.01 · states quantitative result 0.45 · compares with prior results 0.98 · mentions code or data availability 0.04
The abstract, sentence by sentence
This table labels the abstract only (arXiv listing abstract v1). The number is the probability the classifier gave the label.
| Sentence | Role | The authors' own work | States the main conclusion | Strength |
|---|---|---|---|---|
| Large language model (LLM) agents augmented by tools can automate complex, multi-step tasks, such as web navigation, code generation, and workflow orchestration, by acting on external systems through tool calls. | background 1.00 | 0.06 | 0.02 | asserted 0.97 |
| However, hallucinations, distributional instability, and adversarial manipulations in LLMs, and the irreversible consequences of certain tool calls can lead to harmful outcomes. | background 0.99 | 0.04 | 0.02 | asserted 0.62 |
| Existing safeguards either grade recorded trajectories post hoc with stochastic LLM judges or block unsafe actions one call at a time, and no single deterministic artifact supports both roles. | gap 0.98 | 0.05 | 0.03 | asserted 1.00 |
| We present ContrAgent, a contract-based framework for symbolic temporal supervision of LLM agents. | contribution 1.00 | 0.90 | 0.16 | asserted 0.99 |
| ContrAgent captures an agent's behavior as a sequence of tool calls and formalizes it as a trace over a fixed set of checkable predicates. | method 0.94 | 0.88 | 0.04 | asserted 1.00 |
| It then specifies required behaviors using assume-guarantee contracts in linear temporal logic over finite traces (LTLf). | method 0.96 | 0.86 | 0.04 | asserted 0.99 |
| Each contract is compiled to a deterministic finite automaton (DFA) that serves two roles: gating agent actions online and evaluating recorded traces offline. | method 0.96 | 0.85 | 0.14 | asserted 1.00 |
| A contract library, acting as a reusable knowledge base, is maintained independently of the agent's model and can be applied across different agents within the same task domain. | method 0.77 | 0.67 | 0.04 | asserted 1.00 |
| We show the effectiveness of our approach on four benchmarks spanning both roles, where ContrAgent matches state-of-the-art LLM-judge and rule-based guardrail baselines while producing deterministic, reproducible verdicts and, in the online mode, orders-of-magnitude lower per-call latency. | result 1.00 | 0.97 | 0.78 | asserted 1.00 |
What kind of paper the classifier reports this is: method or tool 1.00 · evidence from observation or experiment 0.96
What was examined, and what was not
Sources read
- arXiv listing abstract v1
Not examined
- full text
- figures and tables
- references and citing sentences
- relations to other papers
Levels run
- P abstract
Not run
- S sections
- T body sentences
- C citations
- R cross-paper relations
How the labels were made
Compiled by classifier-1.13.0 via TypeSafe API, question bank abstract-p1-20260923, 2026-09-23: 1 request, 7,017 input tokens.
Every quoted sentence on this record is the authors'. Every label is from Pith's closed vocabulary, with the probability shown beside it. This record as JSON
Figures (5)
Figures are the authors', reproduced from the paper.
Cited by 1 Pith paper
Reviewed papers on Pith that cite this one. The full citation record
Challenges and discussion
Disagree with the review, or know something it missed? Leave a comment, or challenge this review formally: a challenge becomes a permanent entry in this paper's record, and its decision is published here.
Come back by email
A short list of the week's newly reviewed papers. Nothing is sent until you confirm from your inbox, and every email has a link that stops it. No account.
No comments yet.
Sign in to comment