Understanding Determinism and Non-Determinism Janet Wagner September 24, 2026 Non-determinism is a concept that has existed for decades. However, it has rarely been a central part of software design — until the rise of large language models (LLMs). These models enable developers to build probabilistic AI applications, such as autonomous AI agents. Traditionally, developers build deterministic software that initiates concrete, repeatable actions, where they control where and when data goes. That said, LLMs enable AI applications to make those decisions autonomously. Today, developers need to understand the difference between these two states and when they would want to apply them in an application or system. This article breaks down what determinism and non-determinism are, the differences between them, why LLMs introduce probabilistic behavior, and why it’s crucial to strike a balance between the two. What is Determinism? In terms of software development, determinism means that the software or the system produces outcomes that are known, predictable, and repeatable. For example, calling a currency conversion API with the same parameters — amount, source currency, and exchange rate — will return the same converted value every time. What is Non-Determinism? Non-determinism is where an application or system produces different results even when provided with the same exact inputs under identical conditions. For example, LLMs introduce non-determinism into applications like AI agents as they can generate countless different responses to the same exact prompts. Determinism vs. Non-Determinism A deterministic system is like making a cup of instant ramen noodles — same Styrofoam container, same amount of boiling water, same three-minute wait. The result is repeatable every time. A non-deterministic system is like a chef making ramen noodles from scratch — the resulting dish is still valid, but is never identical due to the ingredients on hand. Traditionally, software development is deterministic, with developers and engineers controlling the flow and direction of data. However, with the growing popularity of AI agents, they must now deal with the probabilistic nature (non-determinism) of large language models. The Probabilistic Nature of LLMs AI agents are typically powered by LLMs, which behave probabilistically by design. In a nutshell, they assign probabilities through token sampling, predicting the probability of the next word or token based on the context. Several factors contribute to the probabilistic nature of these models, including floating-point math, varying batch sizes, and sampling methods used. Another factor is the temperature parameter, which controls the “randomness” of the next word or token the LLM selects. Still, a zero-temperature setting does not guarantee that the LLM output will be deterministic. The unpredictability of LLMs is problematic for business processes, which is why probabilistic models should be wrapped in deterministic infrastructure to create a balance. Balancing Non-Determinism and Determinism in AI Agents Building a successful AI agent requires a healthy balance of non-determinism and determinism. The value of having an LLM as the reasoning engine for an agentic system is that it can make decisions about which tools to use, adapt when a step fails, and handle inputs in creative ways that fixed coding can’t. However, if the LLM is left fully unconstrained, the agent’s behavior becomes difficult to predict, test, and debug. The same input can produce different and potentially unwanted results. In a LinkedIn post, Aaron Murrell, Senior Vice President of Engineering at Switchboard Health, talks about the challenges of implementing predictable logic and LLM creativity inside automated workflows. Based on his experience, he concluded that: “Too much determinism builds in brittleness. Too much non-determinism gives you a ‘black box’ that customers and architects can’t trust.” Murrell’s current rule of thumb is to use deterministic logic for hard rails, such as tenant segregation, and non-deterministic logic for decisions a human would normally own. Philipp Schmid, Staff Engineer at Google DeepMind, explains in an article why (senior) engineers struggle to build AI agents. Schmid provides five examples of where traditional engineering habits clash with the new reality of agent engineering, one of them being that “agents evolve, APIs don’t.” He explains that engineers often build “Human-Grade” APIs — endpoints that rely on implicit context. For example, an engineer would see a variable named id and conclude that it’s the user_unique_identifier (UUID) that can be used in get_user(id). An AI agent might not have this context and could try to use the email or name in get_user(id). Also, if we change an API from get_user_by_id(id) to get_user_by_email(email), an AI agent can read the new tool definition and adjust accordingly. On the other hand, developers who integrated that API with their applications would see them break and have to scramble to fix them. Where Non-Determinism Works Well Non-determinism works well for use cases where you need to support open-ended conversation, discovery, or planning. These capabilities require reasoning and language generation from an LLM. Certain applications require flexibility to generate unique outcomes that improve the user experience, such as product recommendations or customer support chatbots. It gives you that flexibility because it enables adaptability and context awareness. Where Determinism Should Be Enforced You should implement determinism when you need certainty, where outcomes must be predictable and repeatable. When it comes to AI agents, you should enforce determinism for API workflows, business logic, and tool calls. For example, an AI agent that manages inventory for a grocery store would need to use multiple APIs and make calls in a specific order: API #1: Check inventory level for each product API #2: Generate list of low-inventory items API #3: Get prices for low-inventory items from different vendors API #4: Check item availability at different vendors API #5: Order items from vendors based on price and availability API #6: Email report of items ordered to grocery store manager One of the ways to ensure certainty in API workflows is by using Arazzo to orchestrate API calls. In general, a probabilistic AI model should decide what the user (human or agent) wants and which tool or path is appropriate based on the context. Deterministic code should provide guardrails to ensure the model executes those actions safely. Adding guardrails should always include having appropriate scopes and permissions, particularly for non-deterministic systems. These restrictions can help prevent unintended, destructive consequences such as an AI agent deleting an entire database. Determinism vs. Non-Determinism: Quick Comparison Determinism Non-Determinism Same inputs result in Same outputs Different valid outputs Outcomes are Known, predictable, and repeatable Probabilistic, adaptive, and context-aware Allows for greater Control Flexibility Works well for API workflows, business logic, tool calls Open-ended conversation, discovery, planning Use too much and it Builds in brittleness, system can’t handle the unexpected Gives you an untrustworthy “black box,” harder to test Debugging is Straightforward — same input reproduces the same bugs More complex — variable outputs make bugs hard to reproduce and isolate Determinism and Non-Determinism: A Careful Balancing Act If you’re building an AI agent, understanding when and where to enforce determinism and non-determinism is critical to its success. Lean too far into non-determinism and the agent’s behavior becomes unpredictable and untrustworthy. Too much determinism and it loses the flexibility it needs to do its job properly. The key, and the hardest part as Murrell puts it, is knowing where to draw the line. AI Summary This article explains the difference between determinism and non-determinism in software and why AI agents need a careful balance of both approaches. Deterministic systems produce known, predictable, and repeatable outcomes from the same inputs, making them well suited for API workflows, business logic, tool calls, and other processes where consistency matters. Non-deterministic systems can produce different valid outputs from the same inputs, which gives AI agents flexibility for open-ended conversation, discovery, planning, and context-aware decision-making. Large language models are probabilistic by design because factors such as token sampling, temperature settings, floating-point math, and batch sizes can influence their outputs. AI agents benefit from using probabilistic reasoning to determine user intent and select appropriate tools, while deterministic infrastructure provides guardrails around execution, permissions, scopes, and workflow order. Too much determinism can create brittle systems that struggle with unexpected situations, while too much non-determinism can make agent behavior unpredictable, difficult to test, and hard to trust. Intended for API developers, software engineers, architects, and platform teams designing AI agents and reliable agentic workflows. The latest API insights straight to your inbox