Spandan Pattanayak

Drafts worth signing

Salesforce's root cause analyses took 10 to 15 days, so only 40% of mandatory incidents got one. The time went to hunting for evidence that was already gone. I built a pipeline that captures it while the incident is live, has GPT-4 write the first draft, and keeps engineers and their VP on the sign-off.

RCA bot#inc-auth-gateway · 14:09
Confidence HIGH Draft for review · P1 · resolved 14:02
A config change cut the auth service's database connection limit. The gateway's 503s were downstream of it.
Root causeauth-service connection pool exhausted Triggerconfig deploy, 13:41 Contributingno alert on pool saturation; gateway retries added load Related3 past incidents in Jira
13:41Max connections lowered on auth-service13:44Pool errors begin on auth-service13:47Gateway starts returning 503s14:02Limit restored, incident resolved
Edit & approveApprove
Role
Product lead for 12 weeks: PRD, architecture spec, prompts and rollout
Core team
Reliability Engineering. Two backend engineers built the pipeline with me.
Worked with
Compliance and Audit, Security and Privacy, Customer Success and Trust, and the Incident Experiences PM
Stack
GPT-4 on Azure OpenAI, PagerDuty, Splunk, Datadog, Slack, Jira
100%
of P0 and P1 incidentsget a formal RCA, up from 40%
−35%
median delivery timeabout 12 business days down to 8
86%
root-cause matchagainst human-written RCAs, up from 60%
<8%
multi-service misreadsdown from 25% within a week of the fix

Delivery time runs from PagerDuty resolution to Jira closure at VP sign-off, against the trailing six-month median. Optional P2+ incidents also rose from about 15% to 60% coverage because teams chose to use it.

The problem

Where the days went

The brief from my engineering manager was short: coverage is 40% and an RCA takes two weeks when we do write one. Find out why.

I ran 30-plus interviews in three weeks with RCA owners, engineering managers, compliance and the customer teams, and shadowed two on-call engineers through live incidents, one of them a P1 at 2am.

The question that told me most was "when you skip an RCA, why?" The answer kept coming back: it takes too long and nobody reads it.

The analysis itself took two or three days. Most of the time went to finding data. By the time a rotating owner was assigned, logs had rotated and the war-room threads were buried. One owner called it archaeology.

The worst cases crossed services. When one service fails, everything that calls it starts throwing errors too, and the loudest dashboard is rarely where it started. Owners had to rebuild the order of events by hand to find the first domino.

Nobody had proposed an LLM for this, and for a fair reason. Hand a model a pile of logs without context and it writes a confident paragraph about a cause that isn't there. My own first prompt did exactly that. Without the right evidence, a model produces noise that reads like an answer.

So the fix was mostly about timing, not the model: capture the evidence while the incident is live, and write the draft only once it's resolved.

Median RCA delivery time: about 12 business days before, about 8 after. Ranges 10 to 15 days before, 7 to 10 after. Before manual median 12, range 10–15 After LLM draft median 8, range 7–10 3–4 days of log hunting removed, 1–2 fewer days of review back-and-forth 051015business days Median RCA delivery time: about 12 business days before, about 8 after. Before: median 12, range 10–15 After: median 8, range 7–10 3–4 days of log hunting removed, 1–2 fewer days of review back-and-forth 051015business days
The system

Three stages

Capture early, write late, sign by hand. Each stage runs on its own trigger, so data is never stale and nothing is written before the cause is known.

When the incident fires in PagerDuty

Assemble the context

When PagerDuty opens an incident, the pipeline takes a snapshot of the evidence before it disappears: logs from Splunk, metrics from Datadog, the alert timeline and anything that changed recently. Each tool has its own format, so I designed one six-field schema that every source is reshaped into before the model sees it. A source that comes back empty or stale is recorded as a gap, not quietly skipped. Four decisions set what goes in.

Which services
The one that alerted and the services one step away from it. That catches a bad neighbour without pulling in the whole system.
How far back
Logs from a 30-minute window around the alert. Deploys and config changes from the last 24 hours, because a change can land hours before anything breaks.
Messy logs
About 85% of logs follow a known format, so plain code translates them. The other 15% is free text. A small model call tidies that up, which beat writing a parser for every format.
Privacy and safety
Every pull is a fixed, read-only query the model never writes. Emails, IPs and tokens are stripped by pattern, names and keys by a second scanner, before anything reaches a model. Log text goes in marked as untrusted, so an error message that reads like an instruction can't steer the draft.
Context package · P1 auth gatewayCaptured 13:47
Splunk application logs, 30 min windowauth-service, gateway
Datadog metrics, service + 1 hoppool usage, 5xx rate
PagerDuty alert timelineescalations
Deploys and config changes, 24h1 config change
PII and secrets scrubbed before any model callemails, IPs, tokens, keys
Missing or stale sourcesnone
When the incident is resolved

Draft the RCA

The package goes to a pinned GPT-4 version inside Salesforce's Azure tenant, so data stays in region and a model update can't change behaviour unannounced. Every call has a time and cost cap. The prompt returns structured JSON: root cause, a confidence level, contributing factors, a timeline, remediation and related past incidents from Jira.

When an incident spans services, the prompt also gets the dependency graph and is told to trace back to the earliest anomaly. Without that, the gateway throwing the most errors gets blamed for the auth service's failure.

A prompt is a request, not a check, so code reads the draft before any person does. It has to parse. Every event it cites has to exist in the package. The service it names has to sit upstream and fail first. A second model then reads each claim against the lines it cites. A failed check doesn't hide the draft; it caps the confidence and names the check, so the reviewer knows where to look.

When the RCA owner is assigned

Review and sign

The draft posts in the incident's Slack channel. The owner edits and approves, then it routes to the engineering manager and the VP. Every step records who, when and the diff from the model's text, so Compliance got a better audit trail than the manual process ever had. Each button checks the clicker's role, and the owner confirms the root cause and the fix before approving, so a signature is never a reflex. The customer's copy is scrubbed again for host names, IPs and staff names.

Sign-off record · exampleSigned
  1. Draft generated · RCA bot14:09
  2. RCA owner · approved with 2 editsDay 1
  3. Engineering manager · approvedDay 3
  4. VP, Reliability · signedDay 5
The map

Follow one incident through

Every component the three stages touch, from the PagerDuty alert to the signed RCA. Pick an incident and step through it. The dashed layer is the extension I'd build next. I designed it after the project ended, and it never ran at Salesforce.

Shipped Proposed
  • Shipped
  • Proposed
  • Designed for v2, not shipped
  • Active in this step

Stage 1 · when the incident opens

PagerDutyIncident opened
SplunkLogs, alert window
DatadogMetrics, +1 hop
Deploy trackerLast 24h of changes
Alert timelineAlerts, escalations
PII + secret scrubBefore any model call
Translators~85% into 6 fields
LLM data janitor~15% free text
Context packageJSON, per incident

Stage 2 · when it resolves

PagerDutyIncident resolved
Load packageFrom the store
Dependency graphAffected subgraph
Recent changesDeploys and config
Prompt v6Five sections, one call+ human context
GPT-4Azure, in tenant
RCA draftStructured JSON
Related incidentsJira keywords, top 3
Vector searchv2, not shipped

Human-investigation layer · proposed, feeds Prompt v6

Resolution noteFix and suspected cause
Query historySplunk audit log
Slack pullChannel history
Scope diffKeep gaps and pivots
Noise filterDrop bots and acks
Re-run gapsRead-only, capped
Text-only scrubImages left out
Human contextTrail and tagged messages

Stage 3 · when the owner is assigned

Checks + confidenceCause and evidence
Senior reviewLow only
Slack postIncident channel
RCA ownerEdit and approve
Eng managerApprove and route
VPFinal sign-off
Jira recordStructured, queryable
Customer RCAScrubbed, via MyTrust
Audit trailWho, when and the diff, recorded at every approval

OverviewA rate limiter config change, caught while it was fresh. Press play or step through.

Decisions

Calls I made

  1. Capture at incident time, draft at resolution

    over doing both days later

    Data goes stale within a day, and a root cause can't be written while it is still being found. Splitting the two triggers removed the reconstruction step entirely.

  2. A confidence score that routes review

    over a single pass-through draft

    LOW confidence sends the draft to a senior engineer before anyone else sees it. This is what brought the VP and Compliance on board.

  3. Guardrails in code, not only in the prompt

    over trusting the instruction

    "Use only the evidence" is something a model can ignore. So every rule code can decide runs in code: read-only queries, scrubbing before the model, cited events that must exist, cause before symptom, a role check on every sign-off. The model writes nothing anywhere; it drafts, and code and people do the rest.

  4. Answer each objection in the product

    over one demo for everyone

    Each group that could stop the project had a different worry, so I answered each one in what we built. The VP didn't want her name on AI text, so every draft carries the diff of human edits. Compliance wanted to see who decided what, so every approval is logged. My manager worried about latency, so capture runs in the background and nobody waits on it. When two pilot teams were ready to walk after a bad draft, I reviewed every draft they got for three days while the fix shipped.

  5. One fixed schema for every draft

    over the free-text RCAs teams already wrote

    Owners wrote RCAs in Confluence or Jira in whatever shape they liked, and the VP was signing drafts of wildly different quality. Fixed JSON fields gave her the same document every time. They also made root causes queryable, so leadership could ask which causes kept recurring, and gave shadow mode a field to score against the human RCA.

  6. Jira keyword search for related incidents

    over a vector index in v1

    Matching on service and root-cause tags was good enough for common failures and shipped in days. I designed the embedding search for v2.

  7. Ship v1 fast, fix in the pilot

    over waiting for the dependency graph

    It cost me: multi-service incidents were misread 25% of the time until I added the graph. Two teams nearly left the pilot, and I would include it from day one next time.

Try it

Six prompt versions

The same multi-service incident, drafted by each version. A config change starved the auth service of database connections, and the gateway, which calls it on every request, filled the logs with 503s. Reconstructed from the pilot's documented failure case, with service names generalised.

v6 · Recent changes in context

Added the last 24 hours of deploys and config changes to the prompt, so the draft names the change that started it.

86% root-cause match across 50 historical incidents.

Root-cause match by prompt version: v1 30%, v2 46%, v3 60%, v4 72%, v6 86%. v5 was measured on multi-service incidents only. 100%50%0% v1v2v3v4v5v6 30%46%60%72%86% multi- service

v5 was scored only on multi-service incidents, where misreads fell from 25% to under 8%. That's a different measure, so it has no bar on this scale.

Trust

Trusting the score

Ask a model how sure it is and it will nearly always say very. In one study, GPT-class models put most of their stated confidence between 80% and 100%, right or wrong. So the label isn't the model's feeling. It's four checks on its own evidence, run in code after the draft is written, so the model can't talk its way past them. In shadow mode I scored those labels against the human RCAs, and they held up well enough to route review on.

ConfidenceMatched the human RCAWhat happens next
HIGH91%Standard review chain
MEDIUM68%Senior review recommended
LOW40%A senior engineer must review before the chain starts

What the label checks

HIGH means all four pass. MEDIUM means the evidence is cited but one check is unclear, such as no change in the window or two possible culprits. LOW means the timing or direction check fails, or the evidence is thin.

Fifty incidents is a small sample, so these rates need re-checking as real incidents come in. Background: Xiong et al. 2023 on overconfident self-reported confidence, and incident.io and Rootly on tying every AI finding to evidence.

  • Every claim cites evidence. The root cause and each contributing factor point to a log line, metric, alert or deploy, with its time. A claim with nothing behind it, or citing an event that isn't in the package, is dropped. A second model reads each claim against what it cites.
  • The timing fits. The named service went wrong before the services around it.
  • The direction fits. On the dependency graph, the named service sits upstream of the ones that alerted. A service that only receives bad calls is reporting a symptom.
  • Nothing is missing. If logs or a neighbour's metrics didn't arrive, the draft can't be HIGH, and it says what it couldn't confirm.
Adoption

Who had to say yes

"If I sign this, I'm putting my name on something an AI wrote."
A VP, early on. I showed her that 70% of pilot drafts were approved with no or minor edits by the engineer who owned them, and the diff of every change. By week 10 she said she had better visibility than in the manual process.
"I used to dread the RCA assignment. Now I edit a draft instead of writing from scratch."
An RCA owner after rollout. What took a week now took about a day.
5 of 5
pilot teams stayed, including the two that nearly left
70%
of pilot drafts approved with no or minor edits
15→60%
coverage on optional P2+ incidents, where nobody required a draft
Week 11
every P0 and P1 gets a draft

How it spread

The number I watched most was the optional one. Nobody had to use the bot on a P2, so that coverage only moved if people wanted it. Four things moved it.

  • It lived in Slack. The draft lands in the incident channel responders already have open, so there was nothing new to learn or log into.
  • Each pilot team had a champion. One engineer used it first and vouched for it to the rest of their team.
  • The VP got a weekly readout. Match rate, how much owners edited, every miss and every check that fired.
  • Demos and office hours. I walked on-call engineers and RCA owners through it before their first draft arrived.
Weeks 7–8

Shadow mode

Ran the pipeline on 50 historical incidents and compared every draft with the human RCA. This is where the multi-service misreads showed up.

Weeks 8–10

Pilot, five volunteer teams

Moved the confidence score to the top of the Slack message and added a one-line summary. When a P2 misread nearly cost me two teams, I reviewed every one of their drafts for three days while the fix shipped. Both stayed.

Weeks 10–12

Full rollout and handoff

Every P0 and P1 got a draft by week 11. I left an architecture doc, a prompt guide covering all six versions, a runbook and the v2 roadmap, and trained two engineers to keep iterating. The 50 shadow incidents became a test every prompt or model change must pass, and each team has a switch back to manual.

Honest scope

What I'd change

Designed after the project. Not built at Salesforce.

Next: keep what the responders knew

Stage 1 captures telemetry for one service, one time window and one hop. The people who fixed the incident often know more. A responder might search logs two services away, or type the real mechanism into Slack, and when the incident closes that trail is gone. The model is left to guess. Its most common remaining miss was the right service with the wrong mechanism.

The cost is a small human step in a system sold on removing toil. I think one line at resolve time is worth it against the days of digging it replaces.

  1. Resolution note

    One structured line when the incident is resolved: what stopped the impact and which service the responder suspects. The prompt treats it as a hypothesis. If the draft disagrees with it, confidence drops and a senior engineer reviews the draft first.

  2. Query trail

    Splunk's audit log already records every search a responder ran. The ones that reached outside the captured scope are re-run with a read-only, capped account and come in as evidence.

  3. Slack observations

    The incident channel is read once at resolution, with bot posts and acks filtered out. Each message left is tagged as a hypothesis, a confirmation or an observation, so a guess never carries the weight of a metric. Screenshots are dropped, since a pattern scrub can't read an image.

Known limits

  • Capture covers one service, one window and one hop. A cause outside that still needs a manual pull.
  • In one cache incident the draft named the right service and guessed eviction policy. The cause was lock contention.
  • The 86% match is scored against VP-signed RCAs, and those can be wrong too.
  • The scrubbers catch what they were built to find. A new format can still slip past, which is why the customer copy is scrubbed twice.
  • On a much larger service graph the whole subgraph won't fit in one prompt. That needs graph-aware retrieval.

Designed but not shipped

  • Status updates to customers in the trust portal at each review step. Faster RCAs shortened the silence; they didn't end it.
  • Embedding search over past RCAs, replacing keyword matching.
  • Blast-radius estimates and suggested remediation playbooks.

Next time

  • Put the service dependency graph in v1.
  • Treat VPs as users in discovery, not as a step in the process.
  • Start the pilot with two teams, not five, so one person can watch every draft.

Let's talk

Building something where a model drafts and a person signs? I'd like to hear about it.

pattanayakspandan@gmail.com
Spandan Pattanayak by the Central Park Reservoir, the San Remo towers behind him