NeurIPS 2026QuestionsPapersAreasAboutMarkdown

Safe Actions Can Form Unsafe Traces: Benchmarking and Shielding Compositional Emergent Risk in AI Agents

Zhongze Wu, Xiu Su, Hongyan Xu, Yichao Cao, Yueyi Luo, Jun Long

NeurIPS page · OpenReview · Open on the map

Category: AI Safety, Security & Alignment › Chain-of-Thought Monitoring · Type: new method · Keywords: AI agent safety, compositional emergent risk, benchmark, runtime shield, trace-level safety, conformal calibration

Areas: AI Agents › Agent Robustness › Agent Failure Attribution; Safety & Security › Safety Benchmarking › Safety risk benchmarks; Evaluation & Benchmarks › Language Model and Agent Safety › Agent Safety Benchmarks; Benchmarks for LLMs & Agents › Agent Trustworthiness Benchmarks › Unsafe Agent Behaviors

Summary

We identify compositional emergent risk in AI agents, introduce CER-Bench to benchmark this failure mode, and propose a runtime shield that learns trace-risk boundaries and mitigates unsafe action compositions.

Explained to a 5-year-old

AI helpers sometimes do many small things that each seem safe. When they do several of these things together, they can accidentally cause a dangerous result. The researchers made a test that shows how often this happens. They also built a safety guard that watches the whole sequence of actions and stops bad ones. This helps keep people safe when using AI helpers.

Explained to a 5-year-old, longer

AI assistants can use tools like browsers, code editors, and other programs. They follow a series of steps to finish a task. Each step might look safe on its own. But sometimes two or more safe steps together can cause a problem. The researchers noticed this problem and called it compositional emergent risk. They created a big test called CER-Bench that has many tasks and many possible actions. They ran many different AI assistants on this test and found that many of them made unsafe mistakes. Then they built a safety shield that watches the whole sequence of actions and replaces risky parts while keeping the good parts. This shield helps prevent dangerous outcomes before they happen. The researchers also showed that the shield works well on new tasks and in other safety tests. By using this shield, AI helpers can be safer for people to use.

For a technical reader

The paper shows that safety checks limited to short windows can miss dangerous interactions across longer action sequences. A new benchmark (CER-Bench) quantifies this compositionality gap across many agents. A runtime shield learns risk boundaries from traces, evaluates future steps, and substitutes risky suffixes while preserving safe prefixes, effectively reducing the gap to near zero. The approach maintains task completion rates and outperforms existing safety baselines.

Problem

AI agents performing sequences of individually safe actions can inadvertently produce unsafe outcomes due to interactions across time, and existing safety filters that examine only limited windows may miss such compositional risks.

Method

We create a controlled long-horizon benchmark covering multiple risk domains and compositional mechanisms, and we develop a runtime shield that learns trace-risk boundaries, evaluates planned continuations before commitment, and substitutes risky suffixes while preserving safe prefixes.

Results

All evaluated agents showed a compositionality gap ranging from 44.4% to 100%, averaging 82.2%. The proposed approach reduces the mean compositionality gap from 69.9% to 0.0% across held-out models, with no failures observed in 763 evaluations and a 95% upper confidence bound of 1.6%, while maintaining 78.4% task completion.

Contributions

We identify compositional emergent risk as a failure mode for AI agents, introduce a comprehensive benchmark (CER-Bench) to study it, and propose a runtime shield that learns trace-risk boundaries and mitigates unsafe compositions.

Practical relevance

Provides tools and benchmarks to improve safety of AI agents that use external tools and APIs by detecting and preventing emergent unsafe behavior.

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