Showcase site · Recorded runs from a staged demoWatch recorded runs ↗Built byPravin Gadekar ↗

DesignHow it works

01 of 05 · 2 min read

How does an alert become a reviewed plan?

Four agents gather evidence in parallel. One proposes a plan, a critic challenges it, code checks it and a person approves it. It takes more model calls than one agent.

ILLUSTRATIVE SEQUENCE01 / 07
How does an alert become a reviewed plan?
in parallelpassrevisepassunresolvedaction: the validated plan goes to a personapproveddraftrejectedblockedintakelog_agentcode_agentchange_agenthistory_agentgather_findingssynthesizercritic_1follow_up_agentrevisercritic_2validate_proposalreport_unresolvedapproval_gatewaiting for a personapprovedapply_mitigationapply_patchverify_outcomeroute_postmortempostmortem_agentstore_postmortem_draftrecord_rejectionrecord_blocked
intakeIn parallellog_agentcode_agentchange_agenthistory_agentgather_findingssynthesizerChallenge: pass, or revise oncecritic_1follow_up_agentrevisercritic_2validate_proposalapproval_gatewaiting for a personapprovedOutcomesapply_mitigationapply_patchverify_outcomerecord_blockedrecord_rejectionreport_unresolvedPostmortem (live runs only)route_postmortempostmortem_agentstore_postmortem_draft
FUNCTION · intake

Turn the alert into a standard incident format.

How this step works

Turns an alert or console request into a standard incident format. It re-checks that sensitive text is hidden, keeps the operator's note separate and screens for prompt injection: text that tries to redirect the agent.

WHAT INTAKE DOES

Re-checks redaction

Keeps the operator's note separate

Screens the text for prompt injection

AGENTS · log_agent, code_agent, change_agent, history_agent

Read the evidence in parallel.

How this step works

log_agent reads logs and code_agent reads code. change_agent lists recent changes and history_agent searches past incidents and runbooks. Each has one read-only tool and cites evidence IDs.

WHAT EACH RETURNS

log_agent and code_agent: findings, file and lines

change_agent: recent commits and deploys

history_agent: past incidents and runbooks

JOIN + AGENT · gather_findings, synthesizer

Join the findings and write the diagnosis.

How this step works

gather_findings collects results under each specialist's name. The synthesizer writes the diagnosis and saves it to state as the proposal. The run's profile selects its model (mixed on staging).

THE JOIN AND THE PROPOSAL

Each specialist returns success, partial or failed

A specialist that misses its deadline stops; results still combine

synthesizer: Diagnosis output schema, no tools

AGENTS · critic_1, follow_up_agent, reviser, critic_2

A second agent challenges the diagnosis.

How this step works

critic_1 reviews the diagnosis. If revision is needed, follow_up_agent gathers more evidence and the reviser rewrites the diagnosis. critic_2 then passes it or marks it unresolved. An unresolved result ends the run without an action.

THE CRITIC LOOP

critic_1: pass, or revise

Revise: follow_up_agent gathers more evidence, reviser rewrites

critic_2: pass, or unresolved

FUNCTION + HUMAN INTERRUPT · validate_proposal, approval_gate

Check the plan, then stop for a person.

How this step works

validate_proposal checks the plan against the action catalog, patch and citations. An invalid plan is reported unresolved. The gate pauses once for human review, saves approved or rejected to state and chooses the next step from that decision.

WHAT THE GATE DOES

validate_proposal checks actions, patch and citations

approval_gate pauses for a person

Writes approved or rejected to state

FUNCTIONS · apply_mitigation, apply_patch, verify_outcome

Act on the decision, then check it.

How this step works

If approved, apply_mitigation and apply_patch re-check the approval and call action-runner, which makes the writes; verify_outcome then checks recovery. If rejected, record_rejection records the reviewer's comment.

AFTER THE GATE

Each action re-checks the approval; a failed re-check ends in record_blocked

action-runner applies the mitigation and opens the pull request

verify_outcome: recovered, contained or not recovered

FUNCTION + AGENT · route_postmortem, postmortem_agent

Draft a postmortem for review.

How this step works

route_postmortem sends live runs to postmortem_agent, which drafts a postmortem; store_postmortem_draft saves it as unreviewed knowledge. Recorded replays and comparison members skip this step.

THE POSTMORTEM

Drafted after verified, rejected and unresolved runs

Recorded replays and comparison runs skip it

Stored as an unreviewed draft

Steps appear in order. Evidence, review and outcomes remain visible.

Evidence / agent workWaiting for a personFailingRecovered

THE TRADEOFF

What we gained

No action can skip the critic, the checks or the approval, and each role uses the model that passed its test.

What it costs

More model calls and a slower first answer. Changing the process means changing the graph.

The alternative: one agent with every tool, choosing its next step. Quicker to build, but nothing guarantees the checks run.

ONE RESULT

In live staging runs the agents found the connection leak from the evidence.

limitA handful of runs, not a rate. The first three live runs before 3f60dd3f ended unresolved, and its patch would not apply cleanly to the real file. A later run's patch applied at the deployed commit.

WHAT THIS DOES NOT CLAIM

  • That the diagnosis is always right; a critic and a person check it.
  • That the AI acts on its own; one approval gates every change.
  • That one model fits every role; profiles pick a model per role.

All of this page's claims in the ledger →

MORE DETAIL

The graph and its routing rules

THE WORKFLOW

Which nodes run, and in what order?

One run: intake, four specialists in parallel, gather_findings, synthesizer, the critic loop, validate_proposal and approval_gate. After the gate it runs apply_mitigation, apply_patch and verify_outcome if approved, or record_rejection; a postmortem draft follows.

The diagram draws the nodes on the main path. The step cards and the full node list below show all of them, including follow_up_agent, reviser, critic_2, the two route_critique nodes, verify_outcome and store_postmortem_draft.

What the live runs showed

The two Phase 1 live runs ended needs_more_data and did not name the connection leak. On staging since then, live runs found it and proposed the try/finally fix, and in five of six critic-loop runs the critic triggered a revision. These few runs do not establish a success rate. Every phase that added nodes was a graph change, and unfinished runs were drained first.

Every node and what it does

EACH STEP

What does each step do?

Every node below is in today's graph. Agents read; function nodes route and act.

Intake

Puts an alert or console request into a standard incident format. Screens its text for prompt injection: instructions that try to redirect the AI.

  • intake

Specialists

Four agents read logs, code, recent changes and past incidents in parallel, and the join collects their results.

  • log_agent
  • code_agent
  • change_agent
  • history_agent
  • gather_findings

Diagnosis and critique

One agent writes the diagnosis; up to two critic passes challenge it, with at most one evidence follow-up and one revision.

  • synthesizer
  • critic_1 / critic_2
  • route_critique_1
  • follow_up_agent
  • reviser
  • route_critique_2

Approval

Code checks the proposal first, then the run pauses until a person approves or rejects the exact plan.

  • validate_proposal
  • approval_gate

Actions and record

Code re-checks approval before each action, calls action-runner and checks recovery. If the run stopped, it records why. A postmortem draft follows.

  • apply_mitigation
  • apply_patch
  • verify_outcome
  • record_blocked
  • record_rejection
  • report_unresolved
  • postmortem_agent
  • route_postmortem
  • store_postmortem_draft
All nodes, with the phase that added each
Every node in the graph: its kind, its role and the phase that added it
NodeKindWhat it doesAdded in
intakeFunctionTurns an alert or a console request into a standard incident format. It re-checks redaction, keeps the operator's note apart, and screens the text for prompt injection; flagged text is labelled as data.Phase 1
log_agentAgent, one read-only tool (fetch_service_logs)Reads logs and returns findings with evidence IDs.Phase 1
code_agentAgent, one read-only toolReads code and returns the file, lines and suspected defect, with evidence IDs.Phase 1
change_agentAgent, one read-only tool (get_recent_changes)Lists recent commits, config diffs and deployments near the incident start. It reports timing, not blame.Phase 2
history_agentAgent, one retrieval tool (search_knowledge)Finds similar past incidents, runbook steps and framework guidance, with kb: evidence IDs. Explains what matches, what differs and which remedy failed before.Phase 4a
gather_findingsJoinNodeCollects results under each specialist's name. Each specialist returns success, partial or failed. A specialist that misses its deadline or raises an ordinary error is reported failed, so the workflow can still join the results.Phase 1
synthesizerAgent, Diagnosis output schema, no toolsWrites the diagnosis and saves it to state as the proposal. Its model comes from the run's profile (mixed on staging).Phase 1
critic_1 / critic_2Agent, Critique output schema, no toolsChallenge the diagnosis with structured objections and questions about missing evidence.Phase 4b
route_critique_1FunctionSaves the critique and routes to pass or revise.Phase 4b
follow_up_agentAgent, read-only toolsAnswers only the critic's missing-evidence questions, with new evidence IDs and at most three tool calls.Phase 4b
reviserAgent, Diagnosis output schema, no toolsRevises the diagnosis using the new evidence and the critique.Phase 4b
route_critique_2FunctionRoutes to pass or unresolved. Unresolved runs end without any action and show the open objections.Phase 4b
validate_proposalFunctionFixed code checks before approval: the mitigation is in the allowed catalog, its parameters stay within limits, and the patch applies to the base commit and changes only allowed files. It also checks that every cited evidence ID, including kb: IDs, was issued to this run, and that flagged evidence does not support the action.Phase 2
approval_gateFunction, rerun_on_resumeThe single pause for a human decision. It saves the outcome (approved or rejected) in state and selects the next step.Phase 1
record_blockedFunctionEnds the run as blocked and records the reason if an action's approval re-check fails.Phase 2
apply_mitigationFunction, with retries and a timeoutRe-checks the approval, then calls action-runner to apply an approved mitigation, if the plan has one.Phase 2
apply_patchFunction, with retries and a timeoutRe-checks the approval, then calls action-runner to open the pull request, if the plan has a change. Scripted runs use a mock and recorded replays take no action; live-tool runs open a real pull request.Phase 1
verify_outcomeFunctionPolls service health for recovery within a deadline and records recovered or not recovered, with the pull request's state. It never merges.Phase 2
record_rejectionFunctionRecords the reviewer's comment.Phase 1
report_unresolvedFunctionRecords an unresolved outcome: more data needed (with the next checks and a suggested owner), open objections or a failed validation.Phase 2
postmortem_agentAgent, no toolsDrafts the postmortem in Markdown with a low-cost model.Phase 4a
route_postmortemFunctionSends a finished run to the postmortem draft, except recorded replays and comparison members.Phase 4a
store_postmortem_draftFunctionSaves the draft as a knowledge document with status draft. It is not searchable until an approver verifies it.Phase 4a
Rules the graph follows

DESIGN RULES

Why does routing live in code?

Rules that keep the graph replayable and the risky parts in code.

Built

One human interrupt per run

The critic loop sits before the gate and has no request for input inside it, which avoids the replay bugs seen with repeated interrupts. "Request changes" means reject with a comment; an operator can then continue it as a new linked run.

Built

Built-in limits on critique

The graph shows the full loop: at most one evidence follow-up, one revision and two critic passes. Each node shown corresponds to one node in the UI's live graph. The loop cannot run forever.

Built

Routing happens in function nodes

An agent node returns content. Its output replaces its input on the next connection. Only function nodes choose the route, and state carries the proposal through the critic steps.

Built

Fixed graph structure

Every run uses the same graph. Model choice is stored as data and does not change the graph's structure. Each run records its workflow version. If a deploy changes the graph, a run started on the old graph ends failed with a stale-workflow message and makes no model call. The version hash covers only node names, kinds and connections. Before deploying a graph change, the operator manually waits for unfinished runs to end.

Built

Join survives a failure

The join fires even if a specialist fails. A specialist that misses its deadline or raises an ordinary error is reported failed and the others continue. A budget stop or a run failure still ends the run.

Built

At-least-once side effects

Every action goes through write_operations with a durable key (run_id:proposal_digest:action), an exclusive claim and reconciliation after an ambiguous response. Mitigations are written as "set to value", so repeating one is harmless.

Built

Privilege stays in code

Models only pick a catalog action and parameters within bounds. validate_proposal checks them, a person approves the exact plan, and only action-runner executes it.

How the approval binds to the plan

THE APPROVAL GATE

What exactly does a person approve?

The server identifies the reviewer, who approves the exact proposal shown. The run stays paused until then.

Built

At the gate

  • The graph stops at approval_gate with one interrupt, and the run is paused.
  • The decision is tied to a SHA-256 digest, a fingerprint of what the decision brief shows: the action kind, the evidence IDs, the mitigation, the patch and the base commit. Rewording a hypothesis does not change it; a different action or evidence set does.
  • The decision endpoint checks the approver role. It accepts the decision only while the run is paused and the digest matches. Otherwise it returns 409 and records nothing. A second decision also gets 409.
  • The server identifies the reviewer from the verified sign-in token. The client never supplies the reviewer's identity.
  • The decision comment is redacted before it is stored or sent to ADK.
  • The Approve and Reject buttons stay disabled until the run is paused.

Built

Before each live action

  • The approval is tied to the reviewer, the run and the proposal digest, and it expires after 15 minutes.
  • apply_mitigation and apply_patch re-check it just before calling action-runner: the digest, the run, the expiry and, with live tools, the deployed commit. action-runner checks the stored approval again. A failed check blocks that action and ends the run; an action that already ran stays applied.
  • One approval covers the whole action plan: the mitigation and the pull request.
  • On staging, an expired approval ended the run blocked with no write, and a changed proposal sent straight to action-runner was refused.
Which model plays each role

MODEL ROUTING

Models by role and fallback

Every role's model is wrapped in RoutedModel, which reserves budget before each attempt. A profile lists candidate models for each role in order. If one fails, the next answers, and the run shows which fallback model was used. A comparison replays one run's frozen evidence under several profiles.

The default model for each role in the plan, and its chain in the mixed profile
RoleDefault in the planMixed profile (staging default)
log_agentA specialist model, which varies by profileOpenAI gpt-6-luna, then Gemini
code_agentA specialist model, which varies by profileClaude Sonnet 5.5, then Gemini
change_agent / history_agentA specialist model, which varies by profileQwen 3 on Vertex AI, then Gemini
synthesizerGemini 3.8 FlashClaude Sonnet 5.5, then Gemini
critic_1 / critic_2A reasoning model (plan section 5.2)OpenAI gpt-6.1-sol, then Gemini
follow_up_agentA model that the spike shows can make sequential tool callsOpenAI gpt-6-luna, then Gemini
reviserGemini 3.8 FlashClaude Sonnet 5.5, then Gemini
postmortem_agentA low-cost modelQwen 3 on Vertex AI, then Gemini
What the screens show

WHAT YOU SEE

What does the engineer see?

The engineer sees an incident console, a live graph with a node inspector, the graph after the run ends, and a thread with one card per agent. The Approval screen shows the hypothesis board, the critic's review and the diff (proposed code changes). Each run's page shows its estimated model cost, and comparisons show profiles side by side.