Skip to content

Stale Does Not Mean Unsafe: Measuring Commit-Guard Precision for Tool-Using LLM Agents in Simulated and Transactional Infrastructure

Zihao Zheng, Jiayu Long, Baichuan Li, Junyi Yao

cs.AI

Abstract

Tool-using language models act on state that can change while they plan. A version check detects that change, but an audit update and a revoked approval have different consequences for a pending action. We study how commit guards distinguish changes that preserve an action's safety conditions from changes that invalidate them. ShiftGuard pairs both types of race across sixteen infrastructure operations and replays identical proposals under alternative guards. The primary simulator grid contains 3,456 frozen proposals from three models, with a separate 1,152-proposal replication on a fourth. We implement the same operations on PostgreSQL and score persisted effects with a requirements-based checker. Among benign races in the scripted PostgreSQL benchmark, the runtime-held version and global-epoch guards block 80% and 100%, respectively, while the row-local predicate guard blocks none. The predicate guard records zero unsafe writes on the declared benchmark conditions, and all five additional hazards outside its declared contract escape it. A version guard using the model's expected version permits unsafe writes on 4.9% of primary replay decisions. The runtime-held version guard records zero in the same replay. These results identify two design choices for agent tools: bind freshness tokens to runtime observations, and represent safety conditions explicitly at the point where the effect is applied.

Create a lesson

Metadata

Comments
Expanded revision with a PostgreSQL testbed, a comparison of version-token provenance, cross-table concurrency experiments, and additional results and reproduction details