Testing stateful tool agents
Can a successful agent response conceal an incorrect database or file state?
Method
Checkpoint real SQLite and file state together with a resumable policy state. Change one declared environmental condition, continue execution, and check the resulting state independently.
The selector study compares ten policies over thirty-two seeds and three authored workflow structures. Separate ToolSandbox and local-model cases exercise the testing mechanism beyond the scripted selector evaluation.
Results
| Evidence | Result |
|---|---|
| Locked selector study | 1,280 episodes and 54,619 paired trial occurrences |
| Primary pooled vs independent index | 4.031 vs 3.812 signatures; frozen composite target missed |
| Stronger simple comparator | Schema heuristic finds 4.719 signatures at the primary budget |
| Fresh independent replay | All 7,177 unique pairs checked with zero mismatches |

Interpretation
The stateful failure-evidence mechanism is useful within its supported workflows. The added pooled selector does not earn a general discovery claim and loses to the simpler schema heuristic.
Limitations
- The study holds out parameters within three authored structures, not entire unseen applications.
- Evidence records are unsigned. Consistency checking and fresh replay do not authenticate arbitrary executions or prove every internal policy transition.
Paper & sources
Counterglass: Stateful Counterfactual Failure Evidence and a Budgeted Search Study
Cite this study
@misc{abdulhadi2026counterglass,
author = {Nazeeh Abdul-Hadi},
title = {Counterglass: Stateful Counterfactual Failure Evidence and a Budgeted Search Study},
year = {2026},
url = {https://nazeeh111.github.io/research/counterglass/}
}