Part I / The Two Loops
The investigation as an episode
One ambiguous incident contains the core RL vocabulary. The engine does not receive "the state of the world." It receives clues, acts through tools, and discovers consequences over time.
A versioned trace of observations, actions, tool results, and final answer.
The actual fault and facts the engine has not queried.
A plausible answer that skips disconfirming evidence.
The detective does not see the crime
Suppose a detective enters a room after an event. The full physical history exists, but the detective sees only a partial view: a broken glass, an open window, conflicting witnesses. Each question or test changes what the detective knows. The quality of the investigation depends on the final guess, the evidence the detective chose to obtain, the alternatives that stayed alive, and the point at which confidence became justified.
An incident-reasoning engine is similar. The underlying network, causal fault, topology, recent changes, and telemetry constitute the world's hidden state. The initial alert is an observation produced from that state. A tool call is an action. The environment returns a new observation. The entire sequence is a trajectory. The model plus prompt, memory, tools, and orchestration is the policy that chooses actions from what it can currently observe.
State is what is true. Observation is what the agent currently gets to see. A tool-using agent exists because those are not the same thing.
A seeded outage with an attractive distraction
At 14:03, clients behind the western site report intermittent packet loss. Gateway A and Gateway B both advertise reachability. A configuration change touched Gateway B at 13:58. That recent change is salient. The seeded cause, however, is a degrading uplink on Gateway A. A sound investigation must inspect both paths and resist treating recency as causality.
The first observation contains an alert, scope, and timestamp. It does not contain the correct cause. The engine can query interface errors, compare path health, fetch topology, inspect configuration history, ask for packet-loss correlation, or conclude. Each action has a cost and an opportunity cost. A query that retrieves everything may eventually find the answer, but a disciplined policy selects evidence that separates live hypotheses.
After querying both gateways, the engine sees rising input errors on Gateway A's upstream interface aligned with the incident window. Gateway B's configuration change did not alter forwarding and its path remains clean. The strongest conclusion is now Gateway A's uplink degradation, with evidence and a note that a physical or provider-side test is still required. The engine should not claim a replaced cable, a specific transceiver defect, or a completed remediation unless the environment exposed those facts.
The episode has a contract
An episode needs a start, transition interface, termination condition, and evaluation. Here it starts when the initial alert and tool catalog are delivered. At step t, the policy receives an observation o_t and emits an action a_t. The environment applies the action to its hidden state and returns the next observation. The episode terminates when the policy submits a final diagnosis, exceeds a tool or token budget, reaches a time limit, or violates an unrecoverable gate.
In many agent environments, intermediate reward is zero and the meaningful score arrives at the end. That makes the learning problem hard: the policy must discover which earlier tool choices, hypotheses, and stopping decisions contributed to the result. A process rubric can add diagnostic step-level feedback, but dense rewards introduce their own risk. If the rubric rewards "number of evidence sources," the agent may query redundant tools. If it rewards mentioning alternatives, the agent may list implausible causes to collect points.
| Trace field | Why it matters for learning | Why it matters for inference |
|---|---|---|
| Policy and prompt version | Determines which behavior distribution produced the data | Supports reproducibility and rollback |
| Environment seed and version | Separates policy change from world change | Explains tool outputs and sandbox behavior |
| Token and tool timing | Enables cost-aware reward and failure analysis | Reveals queueing, prefill, decode, and tool bottlenecks |
| Evidence provenance | Allows process grading and leak detection | Prevents untrusted or stale context from masquerading as truth |
| Termination reason | Distinguishes deliberate stopping from timeout | Connects quality to operational SLOs |
Reward is a scorecard, not truth
A useful evaluation might combine final-cause correctness, coverage of both gateways, evidence alignment, calibrated uncertainty, tool cost, and a hard non-fabrication gate. A deterministic oracle can check facts encoded in the scenario. A rubric can inspect the trace. A learned judge can grade natural-language qualities that are hard to encode. These signals differ in reliability. The final reward is a designed proxy for the behavior we want, not the behavior itself.
The gate in the interactive is intentionally severe. If the engine fabricates an unobserved remediation, a high correctness subscore should not teach it that confident invention is acceptable. In production, some violations may reject the trajectory entirely; others may subtract reward or route to human review. The right choice depends on whether the behavior is unacceptable, merely inefficient, or genuinely ambiguous.
The prompt is part of the observation. It may include stale, lossy, or adversarially selected evidence. The environment state includes facts that were never rendered into tokens. Confusing the two encourages evaluation that gives the model the answer and then congratulates it for retrieval.
Replayable does not mean perfectly realistic
A seeded environment is valuable because two policies can face the same initial incident and evaluators can know the intended causal structure. But fidelity has several layers: tool schemas, response latency, error behavior, access permissions, data correlations, background noise, and consequences of actions. If training tools always succeed instantly while production tools time out or return partial data, the policy learns a world that does not exist.
Environment design is therefore part of model design. A policy cannot learn to recover from a 429 response it never sees. It cannot learn that a destructive remediation requires approval if the sandbox allows it freely. It cannot learn calibrated abstention if every scenario has exactly one clean answer. Later, the agent-RL systems chapter turns this observation into an infrastructure contract.
References
- Sutton and Barto, chapters 3-5, supplies the agent-environment, return, MDP, and episodic vocabulary.
- Lightman et al. motivates the distinction between outcome and step-level process feedback.
- Gao, Schulman, and Hilton supports the warning that a learned reward is an imperfect proxy that can be overoptimized.