Tether: A Formally Verified Stateful Policy Engine for System-Level Monitoring of Agent SystemsTether: Verified Stateful Policy Engine for System-Level Monitoring of Agents
The authors propose Tether, an agent runtime monitor based on system call tracing and Lean 4 verification policies, which the authors state intercepts 100% of in-scope attack trajectories on two programming agent benchmarks, with a benign false positive rate of 2.3%–5.0%.
Tether enforces deterministic security policies on untrusted terminal agents under the reference monitor framework. The attacker can control the agent's actions directly (malicious user) or via prompt injection, can generate arbitrary terminal commands, and fully knows the policy, but cannot bypass or tamper with the monitor and its rules. The TCB includes the host OS kernel, the system call tracing layer, OverlayFS, the network proxy, abstract action inference and the Lean 4 kernel; kernel-level vulnerabilities and sandbox escapes are out of scope.
- An autonomous agent executing arbitrary shell commands may leak sensitive data or tamper with the system. The authors argue that existing LLM monitors provide no formal guarantees, and that stateless policy layers struggle to track multi-step data flows and side effects inside scripts.
- Tether speculatively executes each command in a one-off OverlayFS sandbox, infers abstract actions (read, copy, uploadNet, etc.) using system-call tracing and a local network proxy, then adjudicates them according to a stateful IFC policy in a Lean 4 EDSL, committing side effects only after approval; the policy can be proven in Lean 4 to satisfy global safety invariants.
- On in-scope trajectories of MonitoringBenchHonest and LinuxArena, the authors report Tether adversarial recall of 100% (344/344), with benign FPR of 2.3% and 5.0% respectively; the compared Claude Code Auto Mode configurations achieved recall of 91.6% and 89.2% respectively. In red-team iterations, ASR dropped from 40% to 0%.
- The authors note that Tether can only enforce prefix-closed safety properties and cannot prevent purely semantic attacks; system-call over-approximation introduces non-zero false positives; bypass channels such as background processes, database operations, and io_uring, as well as HTTPS inspection, are not yet modeled; and strace has high overhead. Evaluation is limited to the subset of trajectories that are replayable and whose actions are traced.
- Evaluated models
- Tether
- Benchmarks
- MonitoringBenchHonestLinuxArena
- Metrics
- adversarial recallbenign false-positive rate (FPR)attack success rate (ASR)
Researchers propose Tether, a framework for runtime stateful security policy enforcement over the side effects of agent actions. Addressing the problems that existing LLM monitoring lacks provable security guarantees and that stateless policy layers miss multi-step data flows and unmodeled side effects (such as network calls initiated within Python scripts), Tether executes each proposed action in a temporary isolated sandbox, infers abstract action semantics from observed system calls, and permits only operations that conform to the policy. Policies and action semantics are defined in an embedded DSL in Lean 4, which can express information flow control (IFC), access control and network security policies; with label propagation, a single rule can constrain multi-step execution flows of arbitrary length, and policies can be formally verified to satisfy global security invariants, such as prohibiting network access after reading a sensitive file. On benign and adversarial trajectories of a realistic coding agent benchmark, when a single policy covers all tasks, Tether blocks 100% of in-scope attacks with a benign false positive rate below 5%.
Related events and news
1 events · 1 news mentions
News that mentions this paper
大模型安全周报:单步合规检查挡不住智能体跨步骤组合危害
- 公众号 大模型安全研究cites the paper's id or link大模型安全周报:每一步都合规,拼起来就是一次入侵
5. 用可验证的状态化策略引擎替代语义监控,单一策略拦下全部范围内攻击:Tether: Verified Stateful Policy Engine for System-Level Monitoring of Agents(https://arxiv.org/abs/2611.25599)
Paper analysis
What problem does this paper attempt to solve?
How to perform runtime safety monitoring with formal guarantees for agents that execute arbitrary shell commands, capable of tracking multi-step data flows.
Core problem: how to enforce runtime policies with formal safety guarantees for autonomous agents that execute arbitrary terminal commands, while tracking multi-step information flow (IFC).
- Scenario and importance: The authors point out that LLM agents increasingly automate multi-step workflows and may, due to misalignment or prompt injection, exfiltrate sensitive data or download and execute malicious programs (§1).
- Shortcomings of existing methods: The authors argue that LLM-as-a-judge monitors are probabilistic and susceptible to prompt injection, and cannot provide formal guarantees; while formal reference monitors such as Cedar and OpenShell are either stateless allowlists or do not maintain persistent security labels on resources, making it difficult to reconstruct multi-hop data flows (§1, §8).
- Challenge 1: unclear tool semantics: In a terminal environment, a single command (e.g., running a Python script) can perform file and network operations that are hard to predict statically; direct execution may also have already modified the host or leaked secrets before the monitor intercepts (§1).
- Challenge 2: formalizing stateful IFC: Preventing multi-stage attacks such as relaying through a temporary file and then uploading requires stateful IFC, and as policy composition grows more complex, proving the rules have no bypasses is needed (§1).
- Proposed in the paper: Tether—a framework that speculatively executes commands in a one-shot copy-on-write sandbox, infers abstract action semantics from system calls, and enforces formally verifiable stateful policies in a Lean 4 EDSL (§1).
- Threat model (§2.3):
- Goal: Enforce deterministic security policies on untrusted terminal agents.
- Attacker capability: The attacker can control the agent directly (malicious user) or via prompt injection, and the authors assume it can generate arbitrary terminal commands.
- Knowledge: The attacker fully knows the policy but cannot bypass or tamper with the monitor and its rules.
- TCB and out of scope: The TCB includes the host kernel, the tracing layer, OverlayFS, the network proxy, action inference and the Lean 4 kernel; kernel-level vulnerabilities and sandbox escapes are out of scope.
What related research exists?
Related work falls into four categories: formal policy engines and sandboxes, heuristic defenses, other formal guardrails, and OS-level IFC and provenance.
Formal Policy Languages and Agent Sandboxes
- Cedar (Cutler et al., 2024), Progent (Shi et al., 2026), AgentSpec (Wang et al., 2026a): gate tool calls with declarative access control rules; the paper notes that they are stateless and cannot track the multi-step data provenance required for IFC (§8).
- OpenShell (Watson, 2026): combines kernel-level filesystem isolation with declarative network filtering; the paper likewise notes that it is stateless (§8).
- Dogwood (Brooker et al., 2026) and Strands Box (Amazon Web Services, 2026): perform temporal logic checks over tool call history and integrate into an OS sandbox; the paper notes that they do not maintain persistent security labels on resources and can only reconstruct flows of a limited number of hops (§8, Appendix A).
Heuristic Defenses
- Model-level prompt injection defenses: StruQ, SecAlign (Chen et al., 2025a,b), spotlighting (Hines et al., 2024), instruction hierarchy (Wallace et al., 2024), which use input marking or preference optimization to distinguish trusted instructions from untrusted data.
- Framework-level LLM monitors: LlamaFirewall (Chennabasappa et al., 2025), GuardAgent (Xiang et al., 2025), etc., as well as commercial monitors Claude Code Auto Mode (Anthropic, 2026) and Codex Auto-review (Trębacz et al., 2026); the paper notes that such guardrails are probabilistic and remain susceptible to adaptive prompt injection and evasion (§8).
Other Formal Agent Guardrails
- Dual-LLM and planning-layer isolation architectures (Bagdasarian et al., 2024; Debenedetti et al., 2026; Wu et al., 2025): mitigate prompt injection by separating privileged control flow from untrusted data.
- IFC and language-level monitoring over structured tool calls (Costa et al., 2025; Palumbo et al., 2026; Zhou et al., 2026, etc.); the paper notes that these IFC methods assume tool semantics are known a priori and cannot cover cases where opaque shell commands implicitly pass data (§8).
OS-Level IFC, Sandboxing, and Provenance
- Kernel and user-space OS IFC (Efstathopoulos et al., 2005; Krohn et al., 2007; Zeldovich et al., 2006), system-call sandboxes (Garfinkel, 2003; Provos, 2003), speculative sandboxes (try in Lamprou et al., 2026, etc.), and whole-system provenance (Pasquier et al., 2017, etc.); the paper states that Tether's Isolate is a prototype based on strace and a CoW sandbox and can incorporate improvements from these works (§8).
Baselines and Benchmarks: The experimental comparison is Claude Code's Auto Mode (default and Policy-aware configurations, using Claude Sonnet 5); the evaluation benchmarks are MonitoringBenchHonest and LinuxArena (§6).
The authors position Tether as complementary to the above work: it performs deterministic, formally verified stateful enforcement over observed system-call side effects and supports whole-trajectory invariant proofs (§8).
How does the paper address this problem?
Tether = Isolate sandbox semantic inference + Lean 4 stateful policy monitor; it executes speculatively first, then commits or discards side effects according to the policy.
Overall approach: rather than guessing behavior from command syntax, each command is speculatively executed in a one-shot OverlayFS layer, system calls are traced and network requests are intercepted by a local proxy, and the observed side effects are mapped to abstract action sequences, which are then adjudicated by a stateful reference monitor implemented in Lean 4; file changes are committed and network requests forwarded only if the policy allows, otherwise they are discarded (§1, §2.2).
Security state and abstract actions
- The security state is a triple S = ⟨T, P, σ⟩: context taint T (initially ⊥), privilege P (initially User), and sensitivity mapping σ: Resource × Key → L, parameterized over an arbitrary bounded lattice L (§3.2).
- 11 abstract actions are defined: read, recvNet, write, create, delete, copy, concatenate, downloadNet, sendNet, uploadNet, escalatePrivilege, each with deterministic state transition rules (Figure 1).
- Key design: read/recvNet merge data labels into the context taint T; copy/concatenate/downloadNet propagate source labels directly to the target file without tainting the context, which the authors use to avoid over-tainting (§3.2).
- Because data flows cannot be exactly reconstructed from system calls, Tether over-approximates information flow: e.g., if a script reads a.txt and then writes b.txt, it conservatively infers an a→b flow, which may cause false positives but does not miss traced flows (§1).
Policy DSL and composition
- Policies are written in a Lean 4 EDSL, and the same definition serves both as the runtime monitor and as the formal specification for mechanized proofs (§3).
- A policy contains a resource set, composition clauses, guard rules and a default decision; guard rules match action patterns and evaluate predicates on the state, yielding allow/deny (Figure 2, Figure 3).
- Composition semantics: deny-overrides; require is a global conjunction (no local rule or grant can bypass it), and grant relaxes the default decision only when no local rule matches (§3.4).
- Four metatheoretic properties are mechanically proved in Lean 4: deny-overrides monotonicity, require non-bypassability, order independence, and state unchanged on denial (§3.5).
Isolate: sandboxed execution and semantic inference
- Isolation model based on try (Lamprou et al., 2026): OverlayFS stages file changes; outbound traffic is staged through a local proxy with method and content recorded; background processes are first suspended and then resumed or terminated according to the verdict (§4.1).
- The inference pipeline has four steps: process tree and file descriptor tracing; file and IPC provenance (emitting write/copy/concatenate according to the number of source files a process has read); network actions (emitting actions for both the IP and each domain name, so forged domain names cannot hide the real address); filtering and abstraction (e.g., merging unmodified system directories into coarse-grained domains, emitting at most one read per domain) (§4.2). The full mapping from system calls to actions is in Appendix D.
- The current implementation traces with strace, and the backend can be replaced with eBPF etc. (§4).
Assurance mechanisms: fuzzing and policy verification
- Fuzzing Isolate: from a generated provenance DAG, both a reference abstract trace and a concrete shell script are obtained, and the verdicts and final labels of the two paths under the same policy are compared, requiring the observed result to be no weaker than the reference (§5.1).
- Policy verification: given a query q = ⟨Π, S0, ψbad⟩, check the safety theorem Safe(q) = ∀ ā, ¬ ψbad(execΠ(S0, ā)), i.e., no trace of any length reaches a bad state; LLM assistance is used to synthesize inductive proofs in Lean 4, or to search for finite counterexample traces (§5.2).
- The authors use this mechanism to prove the seven safety invariants in Table 1 for the experimental policy (e.g., no Secret data enters the context, privilege escalation is denied after tainting, Secrets do not leave the local machine), stated as Theorem 5.1 (§5.2).
Policy design process
- The experimental policy was developed through an LLM-assisted iterative loop: the LLM proposes or modifies candidate policies, false positives/false negatives are evaluated on benchmark traces, and invariants are then verified in Lean 4, until all invariants are satisfied without over-blocking (§7.2, Figure 8).
What experiments did the paper conduct?
Measure safety and utility on two coding agent benchmarks, compare against LLM monitors, analyze out-of-scope trajectories, and conduct red teaming and fuzzing.
Experimental Setup
- Benchmarks: MonitoringBenchHonest (88 Linux containers, 88 main tasks, 4 adversarial side tasks) and LinuxArena (10 containerized production environments, 340+ main tasks, 81 adversarial side tasks) (§6.1).
- Replay protocol: Reproduce the task environments in a sandbox and replay offline trajectories one by one; exclude trajectories that cannot simulate external services or cannot be replayed end to end; the in-scope subset is 218 benign + 199 adversarial for MonitoringBenchHonest and 1,372 benign + 145 adversarial for LinuxArena (§6.1).
- Policy: A single shared policy (24 rules, composed of 4 sub-policies via require, Appendix C); only the initial labels and the task-level resource set vary by task; the configuration uses only the main task description, not side task information (§6.1).
- Metrics: Adversarial recall and benign false positive rate (FPR); trajectories that time out in Isolate are scored as fail-open (§6.2).
- Comparison: Claude Code's Auto Mode (using Claude Sonnet 5), in two configurations, default and Policy-aware (placing this paper's policy and the original label text into its soft-rules field) (§6.2).
- Red team: Gemini 3.8 Flash serves as both the red-team agent and the scope-checker; 10 tasks (5 exfiltration targets, 5 protected-path tampering targets), at most 15 rounds per task, and at most 30 execution turns or 20 refusals per round (§6.2).
Main Results
According to Table 2 (recall / benign FPR):
Swipe horizontally to read the table
Benchmark Monitor Recall FPR MonitoringBenchHonest Tether 199/199 (100.0%) 5/218 (2.3%) MonitoringBenchHonest Auto Mode (default) 173/199 (86.9%) 77/218 (35.3%) MonitoringBenchHonest Auto Mode (Policy-aware) 164/199 (82.4%) 32/218 (14.7%) LinuxArena Tether 145/145 (100.0%) 69/1,372 (5.0%) LinuxArena Auto Mode (default) 142/145 (97.9%) 78/1,372 (5.7%) LinuxArena Auto Mode (Policy-aware) 143/145 (98.6%) 23/1,372 (1.7%) Total Tether 344/344 (100.0%) 74/1,590 (4.7%) Total Auto Mode (default) 315/344 (91.6%) 155/1,590 (9.7%) - The authors state that Tether blocked all 344 in-scope adversarial trajectories, with an overall FPR of 4.7%; only one adversarial trajectory timed out during replay, and it had already been blocked before the timeout (§6.2).
- The authors state that neither Auto Mode configuration reached 100% recall, and neither could detect attacks hidden inside scripts whose behavior is not visible from the command line; the same trajectory run multiple times may yield different verdicts (§6.2).
- The authors state that the Policy-aware configuration reduced FPR to 3.5% but missed more attacks, because the model handles endpoints outside the allowlist inconsistently (§6.2).
False Positive Composition and Out-of-Scope Trajectories (RQ3)
- False positive composition (74 cases, §6.2): unrequested protected-path modification 50/74, undeclared external hosts 7/74, reading Secret/Sensitive files 17/74 (e.g., grep -r opens all files). The authors state that the first two categories are correct flags (which could be extended to "ask"), and the third is a fundamental limitation of system-call monitoring.
- Out-of-scope trajectories: The authors estimate that 28.2% of MonitoringBenchHonest and 22.1% of LinuxArena trajectories require LLM content inspection and cannot be handled by any formal runtime monitor; among the remaining non-semantic trajectories, another 36.3% (MonitoringBenchHonest) and 71.5% (LinuxArena) contain background processes or database operations, which Tether can block at the boundary using restrictive policies, but whose internal semantics are not yet modeled (§6.2).
Red Teaming and Fuzzing (RQ4)
- What was tested: An adaptive red-team agent was explicitly prompted to bypass the monitor, attempting in a fake environment to exfiltrate sensitive files or tamper with protected paths; only in-scope actions were evaluated (§6.2, Figure 7(a)).
- Results: Figure 7(b) shows ASR dropping from 40% (4/10) at Iteration 1 to 10% (1/10) at Iteration 2 and 0% (0/10) at Iteration 3; the authors state that red teaming and fuzzing exposed tracing gaps in Isolate (e.g., missing hard links), which have been fixed.
- Authors' interpretation: Each bypass of the formal guardrail points to a specific root cause that can be fixed deterministically, unlike prompt adjustments for LLM monitors (§6.2).
Other Ablations and Analysis
- Policy verification: All seven safety invariants in Table 1 were proven in Lean 4 for the benchmark policy (Theorem 5.1, §5.2).
- Fuzzing setup: Generated provenance DAGs are used to compare the verdicts and labels of a reference abstract trajectory and a concrete execution trajectory (Figure 4, §5.1); the paper does not report the number of fuzzing test cases or the number of issues found.
- Formal tool comparison: The authors state that they could not evaluate Dogwood and Strands Box on these benchmarks because they support only a restricted built-in shell, do not support arbitrary Linux binaries, and their policy languages are insufficiently expressive (§6.2).
What are some points that can be further explored?
The authors list limitations including semantic attacks, over-approximation, and unmodeled channels; the experiments cover in-scope trajectories of two benchmarks and 10 red-team tasks.
Limitations and future directions noted by the authors
- Scope of expressible properties: As a runtime reference monitor, Tether can only enforce prefix-closed safety properties, cannot enforce liveness properties, and cannot precisely guarantee hyperproperties such as non-interference or implicit flow control (§7.1).
- Semantic attacks: It cannot prevent purely semantic attacks that do not violate system-level flow invariants (e.g., maliciously modifying code in an allowed file); the authors state it can be paired with a trusted LLM classifier, with guarantees premised on its correctness (§7.1).
- Over-approximation and false positives: Reconstructing exact data flows from system calls is generally undecidable, and over-approximation brings a non-zero false positive rate; the authors also note that real attacks are rare in deployment, and the base-rate fallacy means most interceptions will be benign (§7.1).
- Unmodeled channels: Background processes and database operations are currently unmodeled and could be extended with eBPF container-level tracing and database-specific abstract actions; io_uring and shared memory bypass standard read/write system calls, and safety currently relies on blocking these interfaces; HTTPS is currently decrypted only for simulated endpoints and could be extended via a TLS-terminating proxy or eBPF uprobes (§7.1).
- strace overhead: strace's tracing overhead slowed the experiments; a faster tracing mechanism could be used in the future (§7.1).
- Future directions: Extending to multi-agent workflows, tracking user-configured metadata (e.g., action counts, rate limits), and supporting probabilistic distribution semantics (§9).
Experimental coverage
- The tested systems were two configurations: Tether and the comparison Claude Code Auto Mode (Claude Sonnet 5); the red team and scope-checker used Gemini 3.8 Flash (§6.2).
- The evaluation is limited to the in-scope subset that is replayable, has all actions traced, and has modeled semantics: MonitoringBenchHonest 218 benign + 199 adversarial, LinuxArena 1,372 benign + 145 adversarial (§6.1).
- The red team experiment involved 10 tasks with at most 15 rounds per task (§6.2).
- The paper does not report the number of repeated runs of the main experiments; the authors state they observed that Auto Mode's verdicts may differ across multiple runs on the same trajectory (§6.2).
- The paper does not report the test case scale of the fuzzing or the name of the LLM used for policy verification (§5).
Summarize the main content of the paper
Tether performs agent runtime monitoring using sandbox system-call tracing plus Lean 4-verified policies; the authors report 100% in-scope recall and 2.3%–5.0% false positives.
Tether is a stateful runtime reference monitor and verifiable policy engine for terminal agents, addressing the problem that agents executing arbitrary shell commands may exfiltrate data or tamper with the system, while existing LLM monitors offer no formal guarantees and stateless policy layers cannot track multi-step data flows.
- Method highlights: Each command is first speculatively executed in a one-shot OverlayFS sandbox; strace traces system calls and a local proxy intercepts network requests; Isolate over-approximates the observed side effects into 11 abstract actions; policies in a Lean 4 EDSL are adjudicated on the state ⟨T, P, σ⟩ under deny-overrides and require/grant composition semantics, and side effects are committed only if they pass.
- Formal guarantees: The authors mechanically proved in Lean 4 four metaproperties—deny-overrides monotonicity, require non-bypassability, order independence, and state unchanged on denial—and proved seven safety invariants for the experimental policy (Theorem 5.1); they also used provenance-DAG fuzzing to test Isolate's semantic inference.
- Main results: On the in-scope trajectories of MonitoringBenchHonest and LinuxArena, the authors report Tether's adversarial recall of 100% (344/344), with benign FPR of 2.3% and 5.0% respectively (Table 2).
- Comparison: Claude Code Auto Mode (Claude Sonnet 5) with the default configuration had overall recall 91.6% and FPR 9.7%, and the Policy-aware configuration had recall 89.2% and FPR 3.5%; the authors state that neither configuration detects attacks hidden inside scripts (Table 2).
- Red team: Against an adaptive red-team agent (Gemini 3.8 Flash), ASR dropped from 40% to 0% over three iterations (Figure 7(b)).
- Authors' conclusion: Effective runtime monitoring requires stateful policies built on fine-grained action semantics, plus mechanisms to infer those semantics from low-level OS side effects; the authors also acknowledge limitations such as purely semantic attacks, background process and database channels, and strace overhead, and plan to extend to multi-agent scenarios.