← All AI Engineer talks

AI Engineer World's Fair 2026

Building Deterministic Infrastructure for Non-Deterministic AI Agents

Read the talk

Building Deterministic Infrastructure for Non-Deterministic AI Agents

An agent that can complete a workflow still needs infrastructure that bounds its failures, controls its actions, coordinates its state, and makes recovery possible.

From a talk by Nishant Gupta

Before you start: Familiarity with API calls, retries, shared state, and basic distributed-systems concepts will help; no specific agent framework is required.

Can the workflow run reliably?

What changes when an AI system stops answering questions and starts making decisions that affect production? Models must still reason well, but an agent also plans, calls tools, and coordinates workflows. Nishant Gupta, who introduces himself as a software engineering tech lead at Meta, locates the emerging challenge in reliability: probabilistic decisions need infrastructure with predictable controls.

Modern cloud infrastructure developed around short-lived requests, mostly deterministic services, known execution paths, and bounded failures. Autonomous agents strain those assumptions. They preserve state, run for extended periods, choose their next steps dynamically, and may follow different workflows for identical inputs. Gupta calls this the great mismatch. The slide contrasts stateless and stateful execution, deterministic and probabilistic behavior, request-response and multi-step workflows, and millisecond and long-running execution.

Two columns contrast stateless with stateful, deterministic with probabilistic, request-response with multi-step workflows, and millisecond execution with long-running execution.
The mismatch between traditional microservices and autonomous AI agents.

A demo asks whether an agent can solve a problem, use a tool, or complete a workflow. Production asks whether it can do so repeatedly, recover from failures, operate safely, and deliver acceptable outcomes within cost and latency constraints. That shifts engineering effort below the model into orchestration, monitoring, safety, evaluation, and recovery. Task completion is the beginning of the reliability requirement, not its completion.

0:030:19
Suggest correction

This note stays in this page until you copy or download it. Nothing is submitted; reloading clears the draft.

0:03 · section reference included

How an invalid tool call becomes a compute incident

Hallucinations are only one failure mode. Recursive reasoning loops, overflowing logs, retry amplification, context corruption, memory poisoning, and cost explosions can turn an incorrect model output into a system-wide problem. The distinction matters: the model makes a mistake, but infrastructure determines whether that mistake remains contained or becomes an outage.

Consider Gupta’s invalid tool-call cycle:

  1. The agent sends an incorrect request to a tool.
  2. The tool returns an error.
  3. The agent produces a slightly different request that is still invalid.
  4. The cycle repeats, consuming more compute while reasoning depth and GPU consumption rise.

Gupta describes exponential resource growth as a possible escalation of this cycle, without supplying a measured growth curve. Repetition alone does not establish that growth rate; the architectural risk is that recovery has become an uncontrolled source of additional work. A minor API error can then become a compute incident.

2:062:25
Suggest correction

This note stays in this page until you copy or download it. Nothing is submitted; reloading clears the draft.

2:06 · section reference included

Give the model proposals, not production authority

The model suggests; the platform decides. Gupta’s strongest architectural recommendation is to keep the model from directly controlling production systems. The boundary has four distinct stages:

  1. The model generates a proposal.
  2. Infrastructure validates it.
  3. A policy engine approves or rejects it.
  4. An execution gateway enforces the decision.

Validation, approval, and execution are separate responsibilities. A valid request is not necessarily permitted, and a permission decision does not itself perform the action.

A TypeScript implementation can make that boundary explicit. Here, the proposed action restarts a named service. Model output enters as unknown; only a validated proposal can reach policy evaluation, and only an approved proposal reaches the gateway.

typescript

type Proposal = {
  action: "restart_service";
  service: string;
};

type Decision =
  | { allowed: true }
  | { allowed: false; reason: string };

interface PolicyEngine {
  evaluate(proposal: Proposal): Promise<Decision>;
}

interface ExecutionGateway {
  enforceAndExecute(
    proposal: Proposal,
    approval: { allowed: true }
  ): Promise<void>;
}

function validate(input: unknown): Proposal {
  if (typeof input !== "object" || input === null) {
    throw new Error("Expected an action proposal");
  }
  const value = input as Record<string, unknown>;
  if (
    value.action !== "restart_service" ||
    typeof value.service !== "string" ||
    value.service.trim() === ""
  ) {
    throw new Error("Invalid restart proposal");
  }
  return { action: value.action, service: value.service };
}

async function handleProposal(
  input: unknown,
  policy: PolicyEngine,
  gateway: ExecutionGateway
): Promise<void> {
  const proposal = validate(input);
  const decision = await policy.evaluate(proposal);
  if (!decision.allowed) {
    throw new Error(decision.reason);
  }
  await gateway.enforceAndExecute(proposal, decision);
}

This example expresses the separation in application code. The gateway remains responsible for enforcing the approved operation, and production credentials belong behind that boundary rather than in the model’s control.

3:083:20
Suggest correction

This note stays in this page until you copy or download it. Nothing is submitted; reloading clears the draft.

3:08 · section reference included

A control plane needs a decision history

Containers gave rise to Kubernetes, and microservices created a need for service meshes. Gupta proposes a corresponding agentic control plane responsible for scheduling, memory coordination, policy enforcement, evaluation, monitoring, and workload routing. His operating-system analogy describes a common layer that manages autonomous work, rather than leaving each agent to manage its own execution. He expects organizations that build this layer well to gain a competitive advantage.

That layer needs more than logs of completed actions. Traditional logs describe what happened; debugging an agent also requires reconstructing how its workflow reached that point. Traces should connect planning decisions, tool calls, memory lookups, and state transitions. The final output may reveal that something went wrong while concealing the earlier decision or retrieved state that caused it.

Trace the observable decision sequence. This means recording instrumented decisions and events, not assuming access to hidden model reasoning. Together, the sequence of calls, retrieved memory, and state changes provides the multiple dimensions needed to debug an autonomous workflow.

3:303:49
Suggest correction

This note stays in this page until you copy or download it. Nothing is submitted; reloading clears the draft.

3:30 · section reference included

Coordinate memory, layer safety, and route exceptions

Once multiple agents share state, familiar distributed-systems failures appear: stale reads, conflicting updates, context drift, and inconsistent views. Memory becomes harder to coordinate when it is also probabilistic and retrieval based. An agent may reason from a different view of the world than another agent, so an apparent reasoning failure may actually be a consistency failure. Improving the model alone does not resolve disagreement about the underlying state.

Safety likewise cannot sit in a single component. Gupta applies defense in depth through several complementary controls:

  • Prompt-level controls: Guide the agent’s behavior.
  • Tool permissions: Restrict which operations it can access.
  • Policy validations: Check whether proposed actions are allowed.
  • Human approvals: Introduce review where judgment is needed.
  • Audit systems: Preserve records for accountability and investigation.

Each layer addresses a different class of failure; none replaces the others.

Human involvement is not necessarily a temporary concession on the way to full autonomy. Gupta expects successful systems to remain supervised, with people serving as exception handlers: reviewing ambiguous situations, handling novel scenarios, and providing calibration signals. The design objective is to allocate human attention where it contributes the most value, rather than simply minimizing human participation.

4:234:37
Suggest correction

This note stays in this page until you copy or download it. Nothing is submitted; reloading clears the draft.

4:23 · section reference included

Inference becomes a scheduling problem

Agent workloads increasingly resemble cluster scheduling problems. Demand arrives in bursts, reasoning depth is unpredictable, and workflows may run for minutes instead of milliseconds. Resource requirements also vary dramatically, making GPU efficiency, workload placement, elastic capacity management, and scheduling central concerns. Inference therefore becomes a resource orchestration problem, not just a model-serving problem. The slide’s jagged demand curve and stepped capacity bands bring those concerns together with resource contention and GPU limits.

Elastic scaling graph with a jagged red demand curve and stepped blue bands, annotated with variable reasoning depth, long-running workflows, resource contention and GPU limits, and bursty demand.
Inference at scale becomes a cluster scheduling problem.
5:365:48
Suggest correction

This note stays in this page until you copy or download it. Nothing is submitted; reloading clears the draft.

5:36 · section reference included

Adapt the protections distributed systems already use

These requirements do not demand an entirely new infrastructure discipline. Gupta maps established reliability patterns onto autonomous workloads:

Established patternAgent infrastructure role
Circuit breakersTool isolation
Rate limitsAgent limits
RetriesControlled recovery
Resource quotasCost governance
ObservabilityAgent tracing

The invalid tool-call cycle illustrates why these mappings matter. A retry should be part of controlled recovery, not permission to generate work indefinitely. Tool isolation and agent limits contain failures; quotas bound resource exposure; traces make the resulting behavior explainable. The implementation changes, but the reliability purpose remains familiar.

6:036:14
Suggest correction

This note stays in this page until you copy or download it. Nothing is submitted; reloading clears the draft.

6:03 · section reference included

The differentiator moves into infrastructure

Gupta describes an industry progression from prompts as the differentiator, to models, and now toward infrastructure as prompts and models become more widely available. His forecast is that the winning organizations will not necessarily have the best prompts; they will have the most reliable systems. The competitive advantage moves into the layers that make model capability dependable.

Treat agents as distributed systems. Their models remain stochastic, while infrastructure must make validation, permissions, execution, and recovery predictable. Observability is mandatory, and control planes become the foundation for coordinating autonomous work. Better models expand what agents can attempt; better systems determine whether those attempts can safely become production operations.

6:276:38
Suggest correction

This note stays in this page until you copy or download it. Nothing is submitted; reloading clears the draft.

6:27 · section reference included

Resources

From the talk

  • Overview of the API server, state store, scheduler and controllers that form a Kubernetes control plane.

  • Google's guidance on overload protection, client throttling and retry budgets that limit request amplification.

  • Policy evaluation with structured inputs and interactive Rego examples, separating decisions from application enforcement.

Read the complete timestamped transcript
  1. 0:03

    Hey everyone. My name is Nishant Gupta. I'm a software engineering tech lead at Meta, working on building the training and inference arc infrastructure. And today we're going to be talking about building deterministic infrastructure for non-deterministic AI agents.

  2. 0:19

    So most of the conversations around AI over the last few years has been focused on models, bigger models, more parameters, better reasoning. But as organizations move from chatbots to autonomous agents, a different problem emerges.

  3. 0:31

    The challenge is no longer im- intelligence. The challenge is, is reliability. At Meta and across the industry, we are seeing agents move beyond answering questions and beginning to plan, call tool calls, coordinate workflows, and make decisions that affect production systems.

  4. 0:46

    These systems are fundamentally probabilistic. Infrastructure is not allowed to be. Today, I want to discuss this topic in more detail.

  5. 0:58

    The modern cloud infrastructure evolved around a set of assumptions. A request-- Most of the requests are short-lived. Services are deterministic, more or less. Execution paths are known. Failures are bounded.

  6. 1:10

    However, autonomous AI agents violate nearly every one of those assumptions. They're stateful, they're long-running. They make decisions dynamically. They make, may execute different workflows for same inputs. This is what I call the great mismatch.

  7. 1:23

    We are trying to run autonomous systems on infrastructure that was designed for deterministic workflows.

  8. 1:30

    This is probably the most important mind shift. Most AI demos showcase capability.

  9. 1:36

    But can it solve a problem? Can it use a tool? Can it compete-- complete a workflow? Production systems be-- have a different objective. Can it do it reliably? Can it do it ten thousand times?

  10. 1:47

    Hundred thousand times? Million times? Can it recover from failures? Can it operate safely? Can it do it in an ac-- at an acceptable cost with an acceptable latency, with an acceptable outcome?

  11. 1:57

    The majority of the engineering effort moves below the model layer into orchestration, monitoring, safety, evaluation, and recovery systems.

  12. 2:06

    When people hear AI failures, they immediately think hallucinations. In reali-in reality, hallucinations are often the least interesting failure mode. What we see instead are infrastructure failures, recursive reasoning loops, overflowed logs, retry amplification, context corruption, memory poisoning, cost explosions.

  13. 2:25

    The model makes mistake, but however, the infrastructure turns that mistake into an outage. That's the real challenge.

  14. 2:33

    So the as-- this slide shows a pattern that distributed system engineers will probably recognize immediately. An agent calls a tool incorrectly. The tool returns an error. Instead of recovering, the agent generates a slightly different but still invalid request.

  15. 2:48

    The cycle repeats. Each retry consumes more compute. Reasoning depth increases. GPU consumption rises. Eventually, you get exponential resource growth. What started as a minor API error became a compute incident.

  16. 3:01

    This is why unco-- uncontrolled retries are one of the biggest risks in agentic systems.

  17. 3:08

    This is the architecture principle I recommend most strongly: Never let the model directly control production systems. The model should generate proposals, infrastructure validates them, policy engine approves them, execution gateway enforces them.

  18. 3:20

    The model just suggests. The platform decides. This separation allows us to build reliable systems even when the underlying model remains probabilistic.

  19. 3:30

    As we know, containers gave rise to Kubernetes. Microservices created service meshes. AI agents are creating something new, an agentic control plane. This layer becomes responsible for scheduling, memory coordination, policy enforcement, evaluation, monitoring, workload routing, which is very important.

  20. 3:49

    And think of it as an operating system for autonomous AI. The organizations that build this layer will have significantly more competitive advantages. So traditional logs tell us what happened.

  21. 3:59

    Agentic systems require understanding why it happened. We need traces to capture planning decisions, tool calls, memory lookups, state transitions. When debugging an autonomous workflow, understanding the chain of decisions and reasoning is often more important than the final output.

  22. 4:15

    Observability becomes multi-dimensional. Without it, production debugging becomes nearly impossible.

  23. 4:23

    So as you can see, memory is one of the most underestimated challenges in agentic architectures. Once multiple agents share state, familiar distributed system issues appear: stale reads, conflicting up- updates, context drifts, inconsistent views.

  24. 4:37

    The challenge becomes even harder when memory itself may be probabilistic and retrieval based. Many multi-agent failures are actually consistency failures masquerading as reasoning failures.

  25. 4:50

    Safety cannot be a single component. It must be layered. Prompt level controls, tool permissions, policy validations, human approvals, audit systems. Each of these layer catches a different class of failures, defense in depth is a well-understood security principle.

  26. 5:05

    It applies equally well to autonomous AI systems.

  27. 5:09

    Many people frame human involvement as temporarily-- temporary necessity. I don't think that's correct. The most successful systems are likely to remain human supervised. Humans became-- become exception handlers. They review ambiguous situations.

  28. 5:23

    They handle novel scenarios. They provide calibration signals. The goal is not to remove humans. The goal is allocating human attention where it provides the maximum value.

  29. 5:36

    So one of the biggest infrastructure shifts is that AI workloads increasingly resemble cluster scheduling problems. Demand is bursty. Reasoning depth is inpred-- unpredictable. Workflows may run for minutes instead of milliseconds.

  30. 5:48

    Resource requirements vary dramatically. As a result, GPU efficiency, workload placement, elastic capacity management, and scheduling becomes critical. Inference is no longer just a model problem, it becomes a resource orchestration problem.

  31. 6:03

    The good news is that many of these problems are not entirely new. Distributed systems have solved something similar for decades. Circuit breakers become tool isolation. Rate limits become agent limits.

  32. 6:14

    Retries become control recovery. Resource quotas become cost governance. Observability becomes agent tracing. Instead of inventing entirely new infrastructure, we can adapt proven reliability patterns to autonomous systems.

  33. 6:27

    The industry has gone through several phase, phases. Then initially, prompts were the differentiator. Then the models became the differentiator. Now both are rapid- rapidly commodit- commoditizing. The next frontier is infrastructure.

  34. 6:38

    The organization that won't-- that wins won't necessarily have the best prompts. They'll have the most reliable systems. The competitive advantage is moving up the stack.

  35. 6:48

    If there's one thing I want you to remember, it's this: AI agents should be treated as distributed systems. Models are stochastic. Infrastructures must be deterministic. Reliability is increasingly an infrastructure problem.

  36. 7:01

    Observability is mandatory. Control planes are emerging as the foundation layer, and ultimately, the future of the AI, AI won't be won by better prompts. It will be won by better systems.