Using Deterministic Simulation to Drive Agentic System Design

AI Engineergo watch the original →

To build reliable distributed systems with AI, move the agent upstream from implementation to design by using deterministic simulation to expose hidden state and failure modes.

The Shift from Implementation to Specification

Dominik Tornow argues that the future of software engineering lies in generating bespoke implementations from abstract specifications rather than relying on general-purpose libraries or frameworks. By treating the prompt as a platform and the specification as the product, developers can synthesize target-specific implementations that are optimized for existing infrastructure. The core challenge is that agents often fail to bridge the gap between abstract requirements and concrete, production-ready code, particularly when handling concurrency and partial failures.

Moving Agents Upstream with Deterministic Simulation

To succeed, agents must participate in the design phase rather than just the implementation phase. This is achieved by introducing a multi-step workflow: abstract specification, simulated implementation, concrete specification, and finally, concrete implementation.

  • Deterministic Simulation: Create a Python-based simulation environment that mimics the target platform's primitives (e.g., NATS.io key-value stores) but allows for controlled, repeatable failure injection.
  • Exposing Forbidden Facts: While production code cannot rely on knowing whether a read is stale, the simulation environment should expose this metadata to the agent. By providing the agent with the "forbidden" context—such as whether a read was stale and what the current actual value was—the agent can debug the cause of invariant failures rather than just observing the failure itself.
  • Iterative Refinement: Use the simulator to discover the correct algorithm under partial order and partial failure. Once the algorithm is verified in the simulation, the agent derives a concrete specification (including data schemas, indices, and transaction boundaries) which then serves as the blueprint for the final production implementation.
  • Minimalism as a Constraint: Simplify the protocol to its bare essentials—specifically durable promises and durable tasks—to reduce the state space, making it feasible for agents to reason about the system's correctness.
  • #ai-agents
  • #distributed-systems
  • #simulation
  • #durable-execution

summary by google/gemini-3.1-flash-lite. probably wrong about something. check the source.