Using a temporal-logic monitoring tool for agents: MonPoly flagged 71.8% of STAC attack chains, but provenance checks were fooled by a one-line injection in 94%–99% of casesFormal Runtime Verification for Tool-Using LLM Agents: An Offline Same-Benchmark Study on AgentDojo and STAC
In offline replay temporal verification on AgentDojo and STAC, general specifications detect over 70% of attacks but have a benign trigger rate of 29.3%; strengthened provenance can prevent historical poisoning.
The victim system is a tool-calling LLM agent; the attacker controls readable context through indirect prompt injection, inducing multi-step dangerous action sequences or injecting fake structured entries into the trajectory to pollute the monitor's provenance history; the monitor operates at the tool layer, performing post-hoc temporal verification based on offline trajectory event streams.
- Tool-calling agents face prompt-injection-driven multi-step harmful sequences, and existing single-call stateless guardrails struggle to audit cross-step historical dependencies; mainstream safety benchmarks also lack the historical fields and interaction protocols needed for formal verification.
- Normalize existing trajectories into event streams, express general and data-parameterized specifications in first-order metric temporal logic, and monitor offline with unmodified MonPoly; propose a strengthened provenance specification combining call and response binding to defend against historical poisoning, and define a twelve-field execution-ready schema.
- On AgentDojo and STAC, the general specification covers 70.1% and 71.8% of successful attacks respectively, but the benign trigger rate is 29.3%; parameterized provenance specifications significantly reduce benign false positives while maintaining detection; hardened provenance completely reduces the 94%–99% poisoning bypass rate to 0%.
- Limitations include evaluation based on offline replay rather than in-the-loop interception, without testing agent adaptation after defense; coarse keyword normalization has no structural coverage for text-semantic harms; parameterized specifications were evaluated only on two suites; temporal specifications were validated only on synthetic logs; and strengthened provenance covers only the tested poisoning family.
- Evaluated models
- GPT-4o (gpt-4o-2024-05-13)Sonnet-3.5
- Benchmarks
- AgentDojoSTACR-Judge𝜏-benchAgentTrace-T
- Metrics
- detection on successful attacksbenign firing rate (BFR)positive likelihood ratio (LR+)false-positive rate (FPR)poison flip rate
The researchers converted recorded trajectories from AgentDojo, STAC, and R-Judge into event streams and replayed them offline with an unmodified MonPoly monitor to test whether metric first-order temporal logic (MFOTL) can serve as a reusable guardrail for tool-based LLM agents. Five general obligations flagged 71.8% of attack chains on STAC and 70.1% of successful attacks on AgentDojo, but also hit 29.3% of normal runs, because these corpora rarely record approvals and never record timestamps, so history-dependent obligations degenerate into risk-action-type recognition. When trajectories include relational context, provenance obligations that bind transfer recipients or email recipients to previously structured records improve discrimination, reducing the normal-run trigger rate in the AgentDojo banking scenario from 44.0% to 24.0% and the detection rate from 79.2% to 70.0%. Based on this, the authors propose a twelve-field enforcement-ready trajectory schema and note that current benchmarks lack fields such as timestamps, approval IDs, session IDs, state pairs, and trust domains.
Why it was selectedThe paper uses recorded trajectories from AgentDojo, STAC, and R-Judge for offline replay formal monitoring, quantifying the detection rate and false positive cost of temporal guardrails.
Related events and news
1 events · 1 news mentions
- This event's paper
时序逻辑监控可标出七成Agent攻击但误报近三成正常运行
News that mentions this paper
- 公众号 大模型安全研究cites the paper's id or link大模型安全周报:决策性模型护栏也能被攻击者绕过
Formal Runtime Verification for Tool-Using LLM Agents(https://arxiv.org/abs/2610.09793)
Paper analysis
What problem does this paper attempt to solve?
Studies formal temporal verification of multi-step security policies for tool-calling agents and the support capability of existing benchmarks.
The core problem is that existing guardrails for tool-calling agents are mostly stateless or single-call rules, making it difficult to declaratively express and audit cross-step, data- and time-dependent historical security policies, and mainstream safety benchmarks fail to record sufficient execution and confirmation history.
- Scenario and importance: Large language model agents have been connected to email, transfers, document modification, and physical device control; under indirect prompt injection threats, attackers can induce agents through untrusted text to execute a chain of tool calls that are individually normal but harmful in combination.
- Insufficiency of existing defenses: Existing guardrails (such as AgentSpec, Progent, GuardAgent, and heuristic filters) are mostly stateless or single-call rule checks; for multi-step data dependencies, they can only hardcode limited local state via imperative code, lacking general, auditable, and reusable declarative temporal semantics.
- Core observation and hypothesis: First-order metric temporal logic (MFOTL) in runtime verification (RV) is naturally suited to characterizing historical constraints with data quantification and time windows; however, on existing attack benchmarks lacking approvals and timestamps, temporal specifications degrade to dangerous action type detection, and only with data-parameterized provenance and full trajectory context can they achieve discriminative power.
- Proposed approach: The authors propose an offline runtime verification evaluation method based on MFOTL and the standard monitor MonPoly, and evaluate 5 general and parameterized specifications on AgentDojo, STAC, and R-Judge trajectories; to address the flaw that trajectories themselves may be poisoned, they propose a lookup-bound strengthened provenance mechanism and provide an execution-ready trajectory schema with 12 fields.
- Threat model:
- Attacker goal: Manipulate the agent through untrusted inputs to trigger chains of actions that violate system security policies, such as unauthorized transfers, data exfiltration, malicious configuration changes, or destructive deletions.
- Attacker knowledge and capability: In a black-box or prompt injection setting, can inject untrusted text into the environment (e.g., emails, webpage content, or forged tool-return-format content), attempting to induce the model or forge structured entries to poison the monitor history; but cannot directly tamper with calls not initiated by the agent, nor control the real tools being queried.
- Victim system: An agent system driven by a large language model with callable external APIs, whose internal reasoning is invisible, and whose externally observable behavior is reflected in interaction messages and tool call logs.
- Security monitoring assumption: The monitor is deployed at the tool execution layer, reading only the structured event stream in input/output trajectories; the evaluation setting is post-hoc offline replay detection.
What related research exists?
Reviews agent guardrails, attack evaluation benchmarks, and temporal verification tools, emphasizing that this work is based on offline replay.
The authors categorize related work and the positioning of this work along dimensions into the following categories:
Rule-based and prompt-based agent guardrails
- AgentSpec (Wang et al., 2026): Provides a customizable runtime enforcement specification language with formal rule semantics; the authors note that it mainly targets the current call, and cross-step historical dependencies often rely on custom encoding.
- Progent (Shi et al., 2025): Proposes privilege-based agent protection, evaluating permission assertions at single-call granularity.
- GuardAgent (Xiang et al., 2024) and Llama Guard (Inan et al., 2023): Respectively use knowledge-base reasoning or content classification models to classify the safety of current calls and message content, lacking temporal reasoning mechanisms for trajectory data quantification.
Agent safety evaluation benchmarks with trajectory records
- AgentDojo (Debenedetti et al., 2024): Provides a dynamic injection attack environment with suites such as banking and workspace, and open-sources complete tool-call run records with attack success and utility labels.
- STAC (Li et al., 2025): Derives 483 multi-turn attack chains from SHADE-Arena (Kutasov et al., 2025) and Agent-SafetyBench (Zhang et al., 2024), testing multi-step attacks by hiding the final harmful step.
- R-Judge (Yuan et al., 2024): Provides a safety risk awareness benchmark covering multiple domains such as IoT and mobile, including real benign and unsafe behavior trajectories.
- 𝜏-bench (Yao et al., 2025): A real human-computer interaction task benchmark whose domain policies require agents to obtain user confirmation before state changes, providing multi-turn interaction and high-density confirmation trajectories.
First-order and metric temporal logic runtime verification
- MonPoly (Basin et al., 2011) and its formally verified kernel VeriMon (Basin et al., 2022): Support data stream monitoring of safety-scoped first-order metric temporal logic (MFOTL) with rigorous formal semantics.
- DejaVu (Havelund et al., 2018): A BDD-based first-order past-time temporal logic monitor used for cross-checking non-metric temporal properties.
- Maris (Cui et al., 2025): Invokes MonPoly within an agent's internal runtime to enforce privacy policies, but evaluates on 3 self-built applications (each with 20 synthetic queries); the authors note that it has not been evaluated on community-public real attack trajectory corpora.
Baseline methods and comparison benchmarks
- Evaluation comparison objects: AgentDojo's built-in defenses (tool filters, prompt focusing, etc.), AgentSpec, Progent, GuardAgent, and keyword-based action-type detection rules; evaluation benchmarks include AgentDojo, STAC, R-Judge, and the control benchmark 𝜏-bench.
Distinct positioning of the authors The authors note that existing systems are either single-call local rules or embed logic in synthetic small-scale scenarios; this paper is the first to use an unmodified general RV monitor to consistently benchmark declarative, parameterized, and metric temporal specifications on existing community full offline attack trajectory corpora.
How does the paper address this problem?
Maps trajectories to event streams and performs offline verification using MFOTL with strengthened provenance mechanisms.
The authors propose normalizing tool call trajectories into typed first-order event streams and using metric first-order temporal logic (MFOTL) to express reusable safety obligations, judged by the off-the-shelf MonPoly monitor under offline replay.
Core obligation definitions and formalization
The authors define five categories of general safety obligations, whose core semantics uniformly require that "before a dangerous action of a specific category occurs, a corresponding permission/confirmation precondition must exist in the trajectory history":
- O1 Destructive operations: including deletion, clearing, deactivation, etc.;
- O2 Protection degradation: including disabling protections, unlocking, adding auto-delete rules, etc.;
- O3 Financial submissions: including transfers, payments, settlements, etc.;
- O4 External exports: including sending emails, sharing, public posting, etc.;
- O5 Device control and configuration: including setting parameters, terminal execution, toggling physical devices, etc.
Formally, taking destructive actions as an example, the violation monitoring form is defined as the action occurring and never having been approved in the past:
destructive(a) \land \neg \blacklozenge approved(a)where\blacklozengedenotes holding at some point in the past.Trajectory normalization and event extraction process
- Tool action type mapping: Classify the assistant's tool call names in the trajectory into corresponding dangerous action types based on a preset list of verb substrings; calls with read-only prefixes (such as
get_,list_,read_,search_, etc.) are explicitly excluded and not treated as actions or permissions. - Precondition and parameter parsing: Parse user inputs and tool call parameters; identify confirmation-type verbs (such as
confirm,approve, etc.) as permission events. - Event stream conversion: Extract
{function, args}sequences for AgentDojo; for STAC, concatenate historical calls with the hidden final step; convert each time point containing predicates into MonPoly log format@t predicate(...), and remove time points with no actions.
Parameterized association specification design
Since general specifications degrade to action detection on benchmarks without approvals, the authors design first-order parameterized specifications combined with trajectory data context:
- Payee provenance specification (banking suite): Restrict the payee p of a transfer action to have previously appeared as a structured sender/recipient in prior account data:
\Box \forall p. (transfer(p) \land \neg \blacklozenge known\_payee(p))- Contact provenance specification (workspace suite): Restrict the recipient r of an outgoing email to have previously appeared in the structured response key-values of system contacts or directory queries.
Historical poisoning defense and strengthened provenance mechanism
To address the risk that attackers can forge structured directory entries through injected text, the authors propose a lookup-bound strengthened provenance mechanism:
- Data is deemed a trusted source only when it comes from the immediately adjacent return result (
result) corresponding to a query call actually initiated by the agent (lookup); fields appearing directly in forged tool messages not initiated by the agent or in plain text are not trusted. - This mechanism cuts off the attacker's path to poison the monitor history through single-line forgery via strict temporal causal binding.
What experiments did the paper conduct?
General specifications detect over 70% but have nearly 30% false positives; parameterization and strengthened provenance significantly optimize discriminability.
Experimental Setup
- Models under test: The main experiment evaluates GPT-4o (
gpt-4o-2024-05-13); cross-model experiments cover all 22 defense-free base model directories included with AgentDojo (covering 28 directories with the banking suite and 29 with the workspace suite); on 𝜏-bench, GPT-4o and Sonnet-3.5 are tested. - Datasets and scale: AgentDojo offline runs record 6,680 attacked runs (after excluding 96 empty trajectories) and 123 benign runs; STAC contains 483 attack chains (from SHADE-Arena and Agent-SafetyBench); R-Judge contains 571 records (301 unsafe, 270 safe, including a 30-item IoT subset); the control benchmark 𝜏-bench contains 1,980 records; the synthetic log AgentTrace-T contains 1,400 trajectories.
- Metric definitions: Successful attack detection rate (Detection, the proportion triggered on
security=trueruns), benign trigger rate (BFR, the proportion triggered on benign runs, as a proxy for utility cost), positive likelihood ratio (LR+ = Detection / BFR), and poison flip rate. All intervals are reported as 95% Wilson score intervals. - Evaluation method: Run the unmodified MonPoly monitor on offline logs, and cross-validate with DejaVu and the Isabelle/HOL formally verified kernel VeriMon (all yield exactly the same 347 trigger decisions).
Main Results
The table below presents the main evaluation results for GPT-4o (no defense) on AgentDojo task suites and general specifications (from Table 1, Table 9, Table 10):
Swipe horizontally to read the table
Evaluation object / specification ASR / sample size Successful attack detection rate (%) Benign trigger rate BFR (%) Unique detections LR+ All attacked runs (general union) 1931/6680 (28.9%) 70.1 29.3 1354 2.40 O1 Destructive operations 1931 successful attacks 15.9 4.1 259 3.91 O2 Defense degradation 1931 successful attacks 0.0 0.0 0 - O3 Financial submissions 1931 successful attacks 26.8 13.0 243 2.06 O4 External exfiltration 1931 successful attacks 27.9 10.6 491 2.64 O5 Device control and configuration 1931 successful attacks 16.2 6.5 38 2.49 Banking suite (banking union) ASR: 40.1% 97.4 79.2 Not reported 1.23 Workspace suite (workspace union) ASR: 19.9% 62.9 21.7 Not reported 2.90 - The authors note that the general specification covers 70.1% of successful attacks on AgentDojo, but the benign trigger rate is 29.3%, and on the banking suite the benign trigger rate is as high as 79.2%, indicating that the general layer is better suited as a triage tool for human review rather than an automatic blocking gate.
- The authors note that because the benchmark lacks approval events, the general specification essentially degenerates into action-type detection; detection contributions are distributed across multiple specifications, with the exfiltration specification contributing the most unique detections (491), while the destructive operations specification has the highest discrimination (LR+=3.91).
- On the STAC benchmark, the general specification detects 347 hidden final steps out of 483 chains (71.8%, 95% CI [67.7, 75.7]), with four independent monitors yielding identical decisions.
Earliest Warning Analysis
- What was measured: The position of the monitor trigger time relative to the final harmful call.
- Results: Among 1,931 successful GPT-4o AgentDojo attacks, 52.4% (1012) achieved preventive warning before the final harmful action, 17.7% (342) triggered at the moment of the final harmful action, and 29.9% (577) never triggered; the median lead time for preventive warnings was 1 tool call (mean 2.19, max 13). On STAC, 11.8% were preventive, 61.5% triggered at the moment of occurrence, and 26.7% did not trigger.
- Authors' interpretation: The warning lead time indicates that the method provides a time window for intervention before harm occurs, rather than serving only as a post-hoc residual.
Parameterized Specifications and Provenance Poisoning Defense Experiments
- What was measured: Evaluate the reduction of false positives by parameterized specifications in banking and workspace, and test the effect of attacker-injected fake directory rows on deceiving the monitor and the effect of hardening.
- Results: In banking tasks, the parameterized payee specification reduced BFR from 44.0% to 24.0%, with detection rate changing from 79.2% to 70.0% (LR+ rising from 1.80 to 2.92); in workspace, BFR decreased from 15.2% to 10.9%, with detection rate changing from 42.5% to 39.2% (LR+ rising from 2.79 to 3.61). Both reductions are statistically significant under McNemar's test (banking p=5.3× 10−23, workspace p=1.5× 10−11).
- Poisoning and hardening: Under naive provenance, single-row structured or reference-forwarding poisoning flips 94.0% (379/403) of violation flags in banking and 99.0% (201/203) in workspace to compliant; with hardened provenance using call-response binding, both flip rates drop to 0.0% (Table 3), with no change in detection rate or benign trigger rate.
Benchmark Readiness and Confirmation Event Review (Census)
- What was measured: For AgentDojo, STAC, R-Judge, and 𝜏-bench, count the availability of fields such as approvals, senders/receivers, objects, and timestamps.
- Results: AgentDojo contains explicit approvals in 0% (0/6899) of cases, STAC in 1.2% (6/483), and R-Judge in 0.4% (2/571); none of the three contain real timestamps and structured state (Table 4). On the multi-turn 𝜏-bench, the proportion of trajectories with explicit user confirmation before state changes is 52.5% (1039/1980) (Table 5).
- Authors' interpretation: The authors believe that the absence of approvals is not an inherent property of agent trajectories, but rather a toolchain design gap caused by the single-turn interaction protocol of attack benchmarks.
Other Ablations and Analyses
- Tool mapping sensitivity: Under conservative mapping, AgentDojo detection rate is 69.0% and BFR is 26.0%; under extended mapping, detection rate is 79.9% and BFR is 43.9% (Table 12).
- Keyword classification accuracy for 54 manually annotated tools: micro-averaged precision 0.90, recall 0.84, F1 0.87, and exact match rate for main categories 87.0% (Table 11).
- Trajectory field ablation: Actions only (R0) LR+ is 1.80; adding recipient identity (R1) raises LR+ to 2.92; adding anti-poisoning provenance (R2) maintains this value but reduces the flip rate under attack from 94% to 0% (Table 6).
- Throughput and memory: MonPoly achieves 52k–179k events/second on 1× STAC logs, 429k events/second under 50× replication, with peak resident memory staying at 8–14 MB (Table 13).
- Cross-model consistency of parameterized effects: Across 22 model directories, the parameterized payee specification reduces benign trigger rate in 20 directories, keeps it unchanged in 2, and increases it in 0; two-sided sign test p=1.9× 10−6.
Negative Results and Exceptions
- On R-Judge, the general specification detects only 23.6% (71/301) of unsafe records, with a false positive rate of 16.3% (44/270) on safe records; the authors explain that this is because the vast majority of R-Judge cases are purely textual semantic risks (privacy leakage, incorrect advice) lacking structured trajectory features.
- About 29% of STAC failures are textual semantic patterns, and 136 chains terminate in actions outside the five general specifications (e.g., calendar modifications, editing spam rules), which the monitor does not cover.
- The travel suite under the general specification has a detection rate of only 16.5% and a benign trigger rate of 11.1%; the authors note that this is because the suite rarely involves money transfers or data exfiltration actions.
- Models under test: The main experiment evaluates GPT-4o (
What are some points that can be further explored?
The authors point out the limitations of offline replay and semantic blind spots; metric temporal logic is only verified on synthetic logs.
Limitations and future directions noted by the authors
- Evaluation based on offline replay rather than in-the-loop interception: Experiments measure the trigger rate of specifications on offline recorded trajectories, and do not test the agent's adaptation and replanning behavior after an in-the-loop defensive barrier intercepts (Section 1 Scope, Section 7 Limitations).
- Benign trigger rate is only a proxy for utility cost: The benign trigger rate only counts the proportion of benign runs flagged by the specifications; because blocked tasks were not re-executed, the actual task failure rate was not directly measured (Section 4, Section 7 Limitations).
- Coarse keyword mapping and plain-text semantic blind spots: Tool classification uses substring matching, which is relatively coarse; about 29% of STAC cases and most R-Judge cases manifest only in harmful text content, and purely structural temporal verification cannot adjudicate such semantic risks (Section 7 Limitations).
- Limited parameterization and cross-model coverage: Refinement of parameterized specifications was evaluated only on the banking and workspace suites; cross-model analysis covered only the models bundled with AgentDojo (Section 7 Limitations).
- Metric temporal operators not validated on real attack corpora: Because existing attack benchmarks lack timestamps, the sliding windows and rate limits of metric temporal logic were validated for expressiveness only on manually constructed CPS/IoT logs, and do not reflect actual violation frequencies in real attacks (Section 6.2, Section 7 Limitations).
- Strengthened provenance validates only a specific attack family: The strengthened provenance specifications with lookup binding are effective only against the tested forged return-value injection attacks; if an attacker can forge matching query calls or directly compromise the queried tool itself, that falls outside the protection scope of the mechanism (Section 5.2, Section 7 Limitations).
Experimental coverage
- Model scope tested: The main experiments focus on GPT-4o (
gpt-4o-2024-05-13); cross-model analysis covers the 22 undefended model directories bundled with AgentDojo, and the control baseline includes Sonnet-3.5, for a total of 23 model directories. - Benchmarks and task suites: Experiments cover AgentDojo (banking, slack, travel, workspace — 4 suites), STAC (483 chains), R-Judge (571 records, including 30 IoT records), and 𝜏-bench (airline and retail domains, 1,980 records total).
- Specification coverage: Formally defined and evaluated 5 general first-order temporal specifications (O1–O5), 2 suite-specific parameterized data provenance specifications, and 3 manual rules for metric time testing.
- Dimensions not reported in experiments: The paper does not report model task retry success rates under in-the-loop interception, execution latency overhead, or agreement statistics between LLM judges and human annotations.
Summarize the main content of the paper
Formal verification can effectively identify multi-step attacks, but its effectiveness depends heavily on a trustworthy historical record of trajectories.
This paper conducts a formal temporal verification study of security monitoring for tool-calling LLM agents.
- Core positioning and problem: Addressing the issues that existing agent guardrails are mostly stateless single-call rules, cannot declaratively express cross-step data dependency security policies, and mainstream security benchmarks lack time and approval records, it evaluates the monitoring effectiveness of first-order metric temporal logic (MFOTL) under offline replay.
- Core method: Proposes an offline runtime verification evaluation framework that maps trajectories to typed event streams, uses the unmodified MonPoly monitor to judge 5 general operation specifications; for false positives, designs parameterized provenance specifications based on historical data, and proposes a lookup binding mechanism to resist poisoning attacks against the monitor's history.
- Key quantitative results:
- On AgentDojo (GPT-4o, no defense), the general specification detects 70.1% of successful attacks, with a benign trigger rate of 29.3% (Table 1); on STAC, it detects 71.8% of hidden harmful steps (Section 4.1).
- Among successful attacks, 52.4% of detections occur before the final harmful call, providing an intervention window (Section 4.1).
- Parameterized provenance reduces the benign trigger rate in the banking suite from 44.0% to 24.0% (p=5.3× 10−23), and in the workspace from 15.2% to 10.9% (p=1.5× 10−11) (Table 2).
- Against injected poisoning, naive provenance yields 94%–99% specification flips, while hardened provenance completely eliminates flips to 0.0% without sacrificing detection (Table 3).
- Existing attack benchmarks have extremely scarce approval fields (AgentDojo 0%, STAC only 0.6% before harmful steps), but the multi-turn benchmark 𝜏-bench has an explicit confirmation rate of 52.5% (Table 5).
- Conclusion and implications: The authors believe that the value of formal temporal monitoring depends on whether trajectories carry trustworthy history; current attack benchmarks, due to interaction protocol flaws, cause specifications to degenerate into action detection; future benchmarks should adopt multi-turn interaction protocols that support user confirmation and record a twelve-field specification including timestamps and provenance.