Are AI agents deterministic?
No. An AI agent can give a different answer, or take a different path, on the same input. On the newest OpenAI, Anthropic and Google models you often cannot lower the temperature either, so consistency has to be built in.
A deterministic system always produces the same output for the same input. A plain workflow in n8n, Make or Zapier is deterministic: the same form submission runs the same steps. An AI agent is probabilistic. The model samples each word, often reasons before it answers, and decides which tools to call and in what order. This page explains why that happens, what changed in 2026 with the temperature setting, and the build choices that make an agent behave the same way where it matters. It supports our AI agent development service, where these choices are part of every build.
Why does an AI agent give different answers to the same question?
Because the model picks each next word by sampling from probabilities, and an agent repeats that over many steps. Small differences early, such as a different first tool call, lead to different paths. Changing tool results and provider-side model updates add more variation.
Four sources of variation stack up in an agent:
- Sampling. Anthropic's migration guide says a request without sampling settings samples "with their defaults, including a temperature of 1.0." At that setting the same prompt can produce different wording and different choices.
- Several steps. An agent may call the model four or ten times per task. A different decision at step one changes everything after it.
- Tool results. The calendar, the CRM and the web change between runs, so the agent sees different facts.
- Provider changes. Models are fixed, retired and replaced. OpenAI's changelog for September 25, 2026 records a fix that changed image understanding in GPT-6 Sol and GPT-6 Luna, with advice to rerun evaluations.
Even settings meant to be deterministic do not guarantee it. A study of five language models "configured to be deterministic," run 10 times on eight tasks, found "accuracy variations up to 15% across naturally occurring runs" and concluded that "none of the LLMs consistently delivers repeatable accuracy across all tasks, much less identical output strings" (Atil and others, arXiv 2408.04667).
Can you set temperature to 0 to make an AI agent deterministic?
Not on most current flagship models. Anthropic's API version 2026-10-21 rejects temperature with a 400 error, Gemini 3.6 Flash and Gemini 4 Argon ignore it, and GPT-6 models drop it when reasoning is on. Temperature 0 never guaranteed identical output anyway.
What happens to temperature on the newest models
| Provider | What the docs say on October 30, 2026 | Effect on an agent |
|---|---|---|
| Anthropic (Claude) | In API version 2026-10-21, a request with temperature, top_p or top_k "returns a 400 error, even at the parameter's default value." Earlier versions return the error for non-default values on Claude 4.7 and later models. | Old code that set temperature fails after an SDK upgrade. Requests sample at the defaults. |
| OpenAI (GPT-6 family) | "When reasoning effort is not none, remove temperature, top_p, and top_logprobs." GPT-6 Astra and GPT-6.1 Sol do not support none; GPT-6.1 Terra, GPT-6 Sol and GPT-6 Luna do. | Temperature is only available on some models, and only with reasoning turned off. |
| Google (Gemini) | Since July 21, 2026, temperature, top_p and top_k are deprecated. For Gemini 3.6 Flash "the API ignores these parameters and returns an error in future model generations." The Gemini 4 Argon guide says "If provided, they are ignored." | Setting temperature to 0 is silently ignored, so it gives no protection. |
Anthropic is direct about what is lost: on older models that accepted other values, "a request that lowered temperature for more consistent output loses that effect. No other setting replaces it." The new client SDKs released on October 21, 2026 (Python SDK 2.0.0 and TypeScript SDK 1.0.0 among them) send API version 2026-10-21 by default, so an upgrade alone can surface the 400 error.
What makes an AI agent behave the same way every time?
Build consistency into the system around the model: required steps in a fixed workflow, strict schemas on outputs and tool inputs, a pinned model version, math and rules in code, and repeated test runs. The model handles only the judgment calls.
How we make an agent repeatable
| Lever | What it fixes | Limit |
|---|---|---|
| Fixed workflow steps | The order of steps and which steps always run | Less flexible for unusual requests; we route those to a person |
| Structured outputs | The shape of the answer: Anthropic says they "guarantee schema-compliant responses through constrained decoding" | Fixes the format, not whether the values are right; refusals and token limits can still break the schema |
| Strict tool use | Tool names and inputs: Anthropic's strict mode guarantees "schema validation on tool names and inputs" | The agent can still pick the wrong tool for the situation |
| Pinned model version | Silent model swaps: Anthropic says "every Claude model ID is a pinned snapshot"; OpenAI offers dated snapshots such as gpt-4o-mini-2024-07-18 | Pinned models still retire on the provider's schedule |
| Code for rules and math | Totals, dates, eligibility checks | Someone has to write the rules down |
| Repeated test runs | Shows how often the agent passes the same case | Costs tokens; rerun after every change |
The last lever is how you find out whether the others worked. We run each test case several times and look at how often the agent passes every run, as set out in how we test an AI agent before launch. An agent that passes a case 90% of the time passes five runs in a row only about 59% of the time.
Should a task use an AI agent or a fixed workflow?
Use a fixed workflow wherever the same input must always give the same result, such as invoices, eligibility rules and compliance steps. Use an agent where the input varies and judgment helps, such as reading free-text messages. Most good systems combine both.
Agent or fixed workflow?
A useful test is to ask whether two people doing the job correctly would always do exactly the same thing. If yes, write it as a workflow. If they would reasonably differ in wording or in the order they gather information, an agent fits, inside fixed limits. A typical lead-handling build runs the intake, de-duplication, CRM write and routing as workflow steps, and uses the model for two narrow jobs: reading the message to classify intent, and drafting a reply from approved content. Our AI workflow automation service covers builds of that kind, and single agent vs multi-agent covers when one agent is enough.
What breaks when a provider removes the temperature setting?
Three things usually break: requests start failing with a 400 error, outputs become more varied than before, or tool calls stop working after a model switch. Each has a specific fix, and a test set shows which one you have.
| Symptom | Likely cause | Fix |
|---|---|---|
| Claude requests fail with a 400 error after an SDK update | The new SDK sends API version 2026-10-21, which rejects temperature, top_p and top_k | Remove the three parameters, or keep that request on the 2023-06-01 version while you test |
| Answers vary more after moving to a newer Gemini model | Temperature is now ignored, so the request samples at the default | Add structured output, tighter instructions and examples; move rule-based steps into the workflow |
| Tool calls fail on GPT-6 Sol or GPT-6 Luna in Chat Completions | These models support function calling in Chat Completions only with reasoning_effort set to none | Use the Responses API for reasoning with tools, as OpenAI recommends |
| A no-code AI step errors after the platform updates its model list | The platform still sends a setting the new model rejects | Clear the temperature field in the step, or pick a model that accepts it, then rerun your test cases |
If an agent of yours in n8n has started acting up after a model change, why an n8n AI Agent stops calling its tools covers the other common causes.
More questions about AI agent determinism
Are AI agents deterministic or probabilistic?
Probabilistic. The model at the center of an agent chooses each word from a set of likely options, and the agent chooses its own steps, so two runs can differ. The workflow around the agent can be deterministic: the triggers, the required steps, the checks and the records it writes. A well-built system keeps the probabilistic part small and the deterministic part large.
Is ChatGPT deterministic?
No. Ask ChatGPT the same question twice and the wording, and sometimes the substance, can differ. Through the API, OpenAI's current guidance for its GPT-6 models says to remove temperature whenever reasoning is turned on, so the old temperature 0 approach is not available there either. For business use, the fix is the same as for any agent: fixed steps, strict output formats and testing.
Is non-determinism a bug?
It is how these models work, and it is part of why they handle varied, messy input well. It becomes a problem only when a task needs the same answer every time. The design job is to decide which parts of a process may vary, such as the wording of a reply, and which must not, such as the price quoted or the record updated.
Can a non-deterministic AI agent pass an audit?
It can, if the audit trail does not depend on the model repeating itself. Log every input, every tool call and every output, pin the model version, keep the prompts under version control, and make the decisions that matter in code with rules a person can read. An auditor can then see exactly what happened in each run, even if a rerun would word things differently.
Does a pinned model version make outputs identical?
No. Pinning stops the provider from swapping the model under you, which removes one source of change. The model still samples, so the same prompt can still produce different text. Pinning also has an end date: Anthropic retires pinned snapshots on a published schedule, with at least 60 days' notice for publicly released models, so plan to retest and move.
How many times should you run a test case to check consistency?
At least three times per case, and five for agents that take actions. One run tells you the agent can get it right; repeated runs tell you how often it does. Rerun the whole set after any change to the prompt, tools or model, and treat a case that passes only sometimes as a failure until you know why.
Read next: do AI agents make mistakes, and who is liable and LLM API prices and model retirement dates.
Sources and further reading
- Claude Docs, Migrating to API version 2026-10-21 (sampling parameters removed), checked October 30, 2026
- Claude Docs, Model deprecations (API parameter deprecations, 60-day notice), checked October 30, 2026
- Claude Platform release notes (October 21, 2026 API version and SDK releases), checked October 30, 2026
- Claude Docs, Structured outputs and strict tool use, checked October 30, 2026
- Claude Docs, Models overview (pinned snapshots), checked October 30, 2026
- OpenAI, Using GPT-6 models (unsupported parameters, reasoning effort, tool calling), checked October 30, 2026
- OpenAI API changelog, checked October 30, 2026
- Gemini API, What's new in Gemini 3.6 and What's new in Gemini 4 Argon (sampling parameters), checked October 30, 2026
- Gemini API release notes (July 21, 2026 deprecation), checked October 30, 2026
- Atil and others, Non-Determinism of "Deterministic" LLM Settings, arXiv 2408.04667, checked October 30, 2026