EnterpriseSim checks what AI agents actually commit to the database
An open-source PostgreSQL benchmark uses ambiguous timeouts, concurrent workers and SQL assertions to test agents that issue refunds, update inventory or change shared records.
A refund request returns an HTTP 504. The agent sees a timeout, but the refund may already be in the ledger. If the agent retries blindly, it can pay the customer twice and still close the support ticket with a plausible success message. EnterpriseSim, an open-source benchmark introduced in a December 1 arXiv preprint, tests this class of failure by grading the records an agent leaves behind. For teams giving agents access to billing or inventory tools, it offers a way to measure whether a workflow completes safely when the tool response leaves the outcome uncertain. EnterpriseSim preprint

Two database outcomes can produce the same timeout
The benchmark runs 83 tasks across six connected departments on PostgreSQL 16. It includes 30 single-incident tasks and 53 with multiple hazards. Four background workers can operate on shared records. In the benchmark’s timeout scenarios, the same 504 can follow a rollback or a successful commit whose acknowledgment never reached the caller. The evaluator checks database state directly with SQL, so it can count the actual writes even when the agent’s final message sounds right. EnterpriseSim repository
The task specifications show how far those checks can reach. In one warehouse case, an interrupted transfer leaves stock in transit, then another worker’s intake changes the destination’s remaining capacity. The expected state calls for resolving the transfer, clearing the in-transit quantity and preserving existing reservations. An agent could update the order to the desired status and still fail the inventory checks. The authors publish seeded state, fault checkpoints and final-state assertions in the dataset so evaluators can inspect what each task measures. EnterpriseSim dataset on Hugging Face
The runtime changes what reaches PostgreSQL
In the authors’ guided evaluation on the 53 multi-hazard tasks, strict safe pass rates ranged from 47.2% to 98.1%. All seven evaluated models failed one unguarded race involving a concurrent security patch. In a separate comparison, the authors replaced guided instructions with brief inbox alerts and added a larger tool console, distraction tickets and live contention. Pass rates fell by 10 to 30 percentage points across the models in that comparison. Those conditions changed together, so the comparison measures their combined effect. EnterpriseSim preprint · Benchmark results
The authors also tested a gate that checks proposed writes before they reach PostgreSQL. They report that it blocked every observed unsafe single-agent write in their test, with no false blocks and under 10 ms of latency at the 99th percentile. Simultaneous refund writers still needed database-level concurrency controls to enforce a shared cap. Two different refunds can each satisfy a limit when checked against the same starting balance. The transaction that records each refund has to enforce the cap against the shared state. EnterpriseSim preprint · Runtime and replay documentation
Turn one write into a regression test
Pick a write the agent is already authorized to make in a test environment. Give the operation a stable identifier and define which records prove completion. For a refund, check the number and amount of refund records, the ledger entries and whether a ticket closed before the outcome was confirmed. Run the same request from a fresh fixture under each of these conditions.
| Test condition | What to verify |
|---|---|
| Timeout before commit | Recovery applies the authorized refund once after establishing the first attempt did not commit. |
| Timeout after commit | Read-back finds the existing refund, and recovery leaves exactly one refund record and one corresponding set of ledger entries. |
| Two authorized writers share a cap | The combined committed amount stays within the cap, even when each proposed refund fits on its own. |
Keep completion and unsafe commits as separate measures. A run that escalates an unresolved timeout and leaves the ledger intact has a different operational consequence from one that closes the ticket after paying twice. EnterpriseSim’s replay can help diagnose the difference. It resets the database, replays the recorded calls and worker interleavings without invoking the model, and compares hashes of the normalized final state. To measure how often the agent makes the same mistake, collect fresh model runs from that fixture. Save the failing trace and database assertions together so a change to the retry logic or runtime can be checked against the original failure. Runtime and replay documentation · Automater’s guide to building a simulated company for agent testing
Sources
- [2612.01881] EnterpriseSim: A Transactional Gym and Benchmark for AI Agent Reliability
- GitHub - EnterpriseSim/enterprisesim: PostgreSQL 16 transactional benchmark and RL environment for AI agents · GitHub
- TanmaySah/enterprisesim · Datasets at Hugging Face
- enterprisesim/docs/EVALUATION_AND_REPLAY.md at main · EnterpriseSim/enterprisesim · GitHub