# WURI: Watching Unfolding Risk in Agent Interactions

*Yiyang Duan, Tiantong Wu, Yurong Hao, Wei Yang Bryan Lim*

[NeurIPS page](https://neurips.cc/virtual/2026/poster/150879) · [Open on the map](../papers.html#p150879)

Category: [AI Safety, Security & Alignment](../pcat/16.md) › [LLM Agent Safety Evaluation](../pgroup/185.md) · Type: new method · Keywords: LLM agent safety, prefix risk detection, metric learning monitoring, early detection, efficient safety

Areas: [AI Agents](../areas/agents.md) › Agent Robustness › Agent Failure Attribution; [Evaluation & Benchmarks](../areas/evaluation.md) › Language Model and Agent Safety › Covert Behavior Detection

## Summary
WURI is a lightweight monitor that detects harmful LLM agent trajectories early by encoding each textual step, learning a trajectory representation through metric learning, and scoring prefixes with a fixed prototype-margin rule, achieving fast and accurate detection without accessing agent model weights.

## Explained to a 5-year-old
We watch what a computer program does step by step. Sometimes the program does things that look okay alone but together are bad. We built a simple watch that looks at the steps and says if something might be dangerous early. It works fast and doesn't need to know the program's secret code. This helps keep people safe from bad actions.

## Explained to a 5-year-old, longer
Imagine a robot that talks and uses tools, like opening a file or calling a website. It does many things one after another to finish a task. Sometimes the robot does small actions that seem harmless by themselves. But when you put all those small actions together, they can cause a problem or be unsafe. Regular safety checks only look at one action at a time, so they miss these hidden dangers. Checking the whole sequence of actions after it finishes is slow and uses a lot of computer power. We created a tiny helper that watches each step as it happens. It stores a simple picture of each step and learns how safe steps look compared to risky ones. When enough steps have been seen, the helper says whether the robot might be heading toward something bad. This early warning works without needing to see the robot’s internal thoughts or secret code. It also does not ask another big AI to judge each step, which saves time. Because it is lightweight, it can run quickly on the same computer that runs the robot, helping keep users safe.

## For a technical reader
WURI monitors multi-step LLM agent interactions by encoding each textual step with a frozen encoder and learning a trajectory representation via metric learning. It scores each prefix using a fixed prototype-margin rule, enabling early detection of harmful sequences without accessing the agent’s model weights. The system requires no external LLM-as-judge calls at inference, making it lightweight and fast. In evaluations across five generalization settings, it achieves the best average prefix-AUDC and detects harmful prefixes within four steps, while providing over two orders of magnitude speedup compared to repeated full-prefix guardrail checks. This makes WURI a practical safety layer for deployed LLM agents.

## Problem
Monitoring multi-step LLM agent interactions for harmful intent is challenging because single-step checks miss risks that emerge across several actions, and repeated full-prefix evaluations are costly and delayed.

## Method
The approach encodes each textual step with a frozen text encoder, learns a trajectory representation via metric learning, and scores each prefix using a fixed prototype-margin rule, requiring no access to the agent’s model weights or hidden states.

## Results
The approach achieves the best average prefix-AUDC across five settings, ranks first on three, detects harmful prefixes within four steps early, and provides over two orders of magnitude speedup compared to repeated full-prefix guardrail evaluation.

## Contributions
It introduces a representation-based prefix scoring method that monitors unfolding risk without needing agent model weights or external LLM judges, and demonstrates superior detection performance and efficiency over existing approaches.

## Practical relevance
It enables fast, low-overhead safety monitoring for deployed LLM agents, allowing early intervention without costly compute or model access.

This page was written by language models from the title and abstract of each paper, and the answers were checked by two other models. It can be wrong: check the paper itself. [Suggest a correction](../feedback/?on=p/150879)
