# ContractBench: Can LLM Agents Preserve Observation Contracts?

*Jicheng Wang, Yifeng He, Zili Wang, Hanwen Xing, Arkaprava De, Hao Chen*

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

Category: [LLM Agents, Evals & Benchmarks](../pcat/17.md) › [LLM Agent Evaluation Benchmarks](../pgroup/698.md) · Type: benchmark or dataset · Keywords: LLM agents, observation contracts, benchmark, API security, evaluation

Areas: [Evaluation & Benchmarks](../areas/evaluation.md) › Language Model and Agent Benchmarks › Agent Evaluation; [Benchmarks for LLMs & Agents](../areas/bench-llm-agents.md) › Cross-Domain Agent Evaluation › Agent Benchmarking

## Summary
ContractBench is a benchmark of 33 dual-axis tasks that measures LLM agents' ability to preserve observation contracts, revealing widespread compliance failures across models.

## Explained to a 5-year-old
Some computer helpers use special codes that only work for a short time. The paper makes a game to check if these helpers remember to use the codes before they expire and without changing them. It tests many different helpers and finds they often forget or mess up. The results show that even the smartest helpers still make mistakes. This helps people build better helpers.

## Explained to a 5-year-old, longer
Imagine a robot assistant that talks to other computers and gets temporary tickets to enter a building. Those tickets have an expiration time and must stay exactly the same, otherwise the building won’t let the robot in. The paper creates a big test with many different kinds of tickets and asks many robot assistants to use them correctly. It watches whether the robots use the tickets after they have expired or whether they accidentally change the ticket’s code. The test shows that many robot assistants fail these simple checks, even the most advanced ones. It also discovers that some robots improve a little but then get worse again. The paper also suggests a way to give the robots feedback based on their mistakes, which helps them do better next time. This test helps researchers understand how reliable these assistants are and gives them ideas for making them safer.

## For a technical reader
The work introduces a deterministic benchmark that uses a virtual clock and SHA-256 hashing to verify that LLM agents preserve the validity and integrity of API artifacts. It evaluates 38 models across 33 tasks probing expiration and byte-level tampering, revealing that no model reaches 80% compliance. The benchmark also provides a failure taxonomy that can be used as an in-context reward to improve model performance.

## Problem
LLM agents often use temporary artifacts such as tokens and URLs that must stay valid and unchanged, yet current models do not consistently maintain the temporal validity and byte-level integrity of these artifacts.

## Method
The approach creates a deterministic evaluation suite with a virtual clock and SHA-256 integrity checks to test agents on validity and integrity failures. It runs agents through 33 tasks that probe expiration and byte-level tampering, labeling outcomes according to real-world API specifications.

## Results
The evaluation found that no model cleared 80%, with Claude-Opus-4.6 leading at 77.8%. Qwen 3.5 showed a steep increase from 0% at 4B to 56.6% at 9B, while GPT-5 models displayed non-monotonic scaling, and an in-context reward based on the failure taxonomy raised GPT-5.1 performance by 7.1 percentage points.

## Contributions
The paper identifies observation contract compliance as a critical, currently unmet capability for LLM agents and proposes a systematic benchmark to measure it. It also provides a failure taxonomy that can serve as an actionable reward signal for improving compliance.

## Practical relevance
The benchmark and failure taxonomy give practitioners a concrete tool for assessing and improving the reliability of LLM agents in real-world API usage.

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/139770)
