Sequential Behavioral Watermarking for LLM Agents

Hyeseon An, Shinwoo Park, Dongsu Kim, Yo-Sub HanNeurIPS 2026

TL;DR

LLM agents don't just write text; they take sequences of actions—calling tools, navigating environments, and interacting with APIs—often hiding their underlying reasoning tokens from the outside world. Standard text watermarks vanish at this boundary, and existing behavioral watermarks shatter if even a single action in the log goes missing. Enter SeqWM, a clever framework that hides cryptographic signatures directly inside how an agent transitions from one action to the next, making agent provenance verifiable even from chopped-up, corrupted action logs.

What Problem Does This Paper Address?

As autonomous agents move into production, both the agents and the trajectories they generate have become expensive intellectual property (a single high-quality SWE-Bench trajectory can cost around $100 to produce). Naturally, you want to verify if an observed stream of actions came from your agent—whether to catch an adversary scraping your API to train a copycat, or to detect automated bots on social platforms.

Why not just use standard LLM text watermarking (biasing "green/red" token vocabularies)? Because over 82% of commercial agent platforms conceal internal reasoning traces and expose only the final sequence of executed actions. The token-level signal is lost before a detector ever sees it.

Recent behavioral watermarks fix this by biasing action choices directly, keying each bias to the absolute step number (Step 1, Step 2, Step 3...). While neat, this creates a domino-effect vulnerability: if a log is truncated, partially observed, or an attacker deletes Step 2, Step 3 gets checked against Step 2's key, Step 4 against Step 3's key, and the entire downstream watermark collapses into noise.

Methods

Instead of tying the watermark to when an action happens, SeqWM ties it to what just happened. The framework relies on three interlocking pieces:

Overview of the SeqWM injection and detection pipeline
  1. History-Conditioned Multi-Channel Encoding: At each step, SeqWM looks at a small window of the agent's $w$ most recent actions (say, the last 3 actions). Using a secret key and a cryptographic hash (HMAC), it generates $m$ independent "guided subsets" of candidate next-actions. Actions appearing in more subsets get a gentle upward probability nudge (an exponential tilt) before the agent samples its next move.
  2. Sliding-Window Detection: Because the bias depends only on local action history, the detector doesn't care about absolute step numbers. It simply slides a window of length $w+1$ across whatever fragment of the trajectory it observes, counting how often an action matches the guided subsets dictated by its preceding $w$ actions.
  3. Random-Key Calibration ("The Wrong-Key Trick"): You can't use a simple textbook binomial $z$-test here—agent actions naturally correlate with one another, and sliding windows overlap, which would wildly inflate false positives. Instead, SeqWM scores the exact same observed sequence using $M$ (e.g., 1,000) wrong random keys. Because wrong keys experience the exact same natural quirks and correlations of the trajectory without the true watermark alignment, they form a clean, assumption-free empirical null distribution to compute an exact finite-sample $p$-value.

Datasets

The authors evaluate SeqWM across three existing, diverse agent benchmarks (using LLaMA-3.2 3B, Gemma 4 E4B, and Qwen3-4B backbones):

  • ToolBench: 200 API/tool-use queries executed in a ReAct loop (up to 6 steps).
  • ALFWorld: 50 embodied household text-game tasks requiring longer-horizon planning (up to 50 steps).
  • OASIS Reddit: 100 open-ended social media simulation steps involving a user agent and NPCs, acting as a tough stress test due to short trajectories and a tiny action vocabulary.

No new datasets were introduced in this paper.

Key Insights and Ideas

  • The Encoder–Decoder Asymmetry: Much like cryptographic message authentication codes, watermark generation must follow a sequential chain, while verification doesn't have to reconstruct the chain at all—it can just scoop up local $(w+1)$-length chunks in any order.
  • Deletions Become Local Scratches, Not Global Crashes: Mathematically, if a trajectory of length $T$ loses a fraction $\rho$ of its actions, a round-indexed detector's useful signal shrinks to $O(1/\rho)$, vanishing relative to $T$. Under SeqWM, deleting $d$ actions can invalidate at most $d(w+1)m$ local checks, leaving the rest of the sequence completely intact.
  • Stealth via Transition Statistics: Because SeqWM nudges conditional transitions rather than overall action counts, an attacker who only profiles first-order behavior (how often an agent calls Tool A vs. Tool B overall) won't spot—or easily scrub—the watermark.

Key Results

  • Reliable Detection Everywhere: Across all 9 model-benchmark combinations, SeqWM is the only method to consistently reject the null hypothesis ($p \le 0.01$, with $z$-scores ranging from 2.53 to 11.44), whereas baselines (AgentGuide and AgentMark) frequently fail to separate from unwatermarked noise.
  • Zero Utility Degradation: Because SeqWM spreads its watermark thinly across multiple channels and steps rather than forcing awkward single-step choices, agent performance holds steady. On ToolBench, SeqWM slightly exceeds unwatermarked task success rates across all models (e.g., 47.3% vs. 45.3% on Gemma), and preserves high behavioral entropy (96.0%–97.6%) on OASIS.
  • Deletion & Corruption Resilience: When actions are randomly deleted, round-indexed AgentGuide plummets near zero True Positive Rate (TPR) almost immediately. SeqWM degrades gracefully, maintaining near-perfect detection at low deletion rates and retaining 100% TPR on ToolBench and ALFWorld even under 20% random action insertion or substitution.

Limitations and Future Work

  • Short-Trajectory Sensitivity: Because evidence accumulates across transitions, detection power naturally weakens when trajectories are very short—such as on OASIS or when an agent calls Finish after just a couple of steps.
  • Verifier Assumptions: The theoretical deletion analysis assumes the verifier knows or can reconstruct the candidate action set available at each scored transition.
  • Stronger Adversaries: While SeqWM handles random deletions, insertions, and substitutions well, the authors note that defending against stronger adaptive adversaries and semantic "paraphrase-style" trajectory edits (e.g., swapping an entire sub-sequence of tool calls for a functionally equivalent workflow) remains an open frontier for future work.

Summary updated

Abstract

LLM-based agents act through sequences of executable decisions, but their trajectories provide little evidence of which agent or policy produced them, making provenance, ownership, and unauthorized reuse difficult to establish from observed behavior alone. This motivates watermarking signals embedded directly into agent behavior rather than only into generated text, since text watermarking cannot capture the action-level decisions that define agent execution. Recent agent watermarking methods address this gap by moving the watermark from generated text to behavioral choices. However, by treating each action step as an independent trial, they overlook trajectory structure and become fragile when trajectories are perturbed, truncated, or observed without reliable alignment. We propose \texttt{SeqWM}, a sequential behavioral watermarking framework that embeds signals into history-conditioned transition patterns and verifies trajectories position-agnostically against random-key baselines. Experiments across diverse agent benchmarks and LLM backbones show that \texttt{SeqWM} consistently achieves reliable detection while preserving agent utility, and remains robust under trajectory corruption where round-indexed behavioral watermarks collapse. Our code is available at https://anonymous.4open.science/r/seqwm-0897.
BibTeX
@inproceedings{an2026sequential,
  author = {Hyeseon An and Shinwoo Park and Dongsu Kim and Yo-Sub Han},
  title = {{Sequential Behavioral Watermarking for LLM Agents}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2026},
  url = {https://openreview.net/forum?id=ehO9ULukTj},
}
Figure