ServiceNow AI Debugger

Root-cause analysis for AI Agents, agentic workflows and Now Assist skills — from a Chrome side panel, using your own logged-in session.

Read-only: GET requests onlyEverything stays in your browserMIT licensedIndependent — not a ServiceNow product

Why this exists

When an AI Agent run fails in ServiceNow, the evidence is never in one place. The execution plan is in one table, its tasks in another, tool executions and LLM calls in two more, the Virtual Agent transcript somewhere else again — and the thing the user actually saw is three joins away from the thing that broke. I got tired of spelunking, so I built a Chrome side panel that does the spelunking for me. Here is what it looks like — the panel below is clickable:

AI Debuggerdev82613.service-now.com
CRITLLM call failed with 429 after 3 retries
One Extra Large provider quota exhausted mid-plan; every later step inherited the failure.
HIGHExecution plan stuck in "In Progress" for 47 min
Last task is waiting on a tool that already returned an error — the plan will never advance.
LOWAgent instructions exceed 6,000 characters
Long instructions dilute tool-selection accuracy; consider splitting the agent.
  • 14:02:11User: "Why is my laptop order stuck?"
  • 14:02:13Agent Order Tracker selected — plan ORD0010042 created
  • 14:02:15Tool look_up_order → 200 (312 ms)
  • 14:02:19LLM call → 429 rate limited (retry 1 of 3)
  • 14:03:40Plan state still "In Progress" — no further messages
// ServiceNow AI Debugger: stop 1 stuck run(s)
// Review it, keep DRY_RUN = true for a first run, read
// the output, then set DRY_RUN = false.
(function () {
  var DRY_RUN = true;   // nothing changes until you flip it
  var EXPECTED_INSTANCE = "dev82613";
  var MAX_RECORDS = 200;  // safety cap
  ...
})();

The extension never runs scripts. It opens Scripts ‑ Background with this filled in, in dry-run mode, and you click Run.

What it does

  1. Paste a sys_id, record URL, plan number or agent name — or trace the record in your current tab.
  2. The panel pulls execution plans, tasks, tool executions, LLM calls and the Virtual Agent transcript over plain GET requests, as you.
  3. A rules engine turns the evidence into ranked findings; a merged timeline shows what actually happened, in order.
  4. Copy a report, download the evidence as JSON, or (optionally, with your own API key) have Claude analyse the redacted trace.

Design decisions that mattered

Read-only, your session, no server. The extension sends GET requests as you, to your instance, and nothing else. No service account, no backend, no telemetry. If you can't see a table, neither can it. This one decision removed almost every hard conversation about running it against a production instance.

Stop scripts that never run themselves. Sometimes the diagnosis is "this run will never finish" and you want it stopped. The extension generates a Scripts - Background snippet — dry-run by default, pinned to the instance it was generated for, capped at 200 records — opens it for you, and you click Run. The extension never writes to the instance; the admin does, with the script in front of them.

Claude analysis is optional and bring-your-own-key. With an Anthropic API key set, "Analyse with Claude" sends a redacted summary of the trace to the API under your key. Without one, "Copy prompt for claude.ai" gives you the same thing to paste into a chat. The default is neither — the rules engine works offline.

The security bug that almost shipped

Before the first commit, an automated security review flagged something half-handled: the generated stop scripts embed record display names in // comments, and the code stripped \r and \n — but not U+2028 and U+2029, the Unicode line separators that the ES5 engine behind Scripts - Background treats as line breaks and JSON.stringify leaves raw. A hostile record name could have broken out of the comment and injected code into a script an admin runs with full rights. The fix sanitizes every value inside the header builder itself, and builds those characters with String.fromCharCode so no tooling can ever "helpfully" decode them again.

How it's built

Manifest V3, no build step — the repo is the extension. Pure-logic modules in lib/ (collectors, rules, timeline, redaction, report) with 35 Node tests that run against a mock instance, so the rules engine is testable without a ServiceNow instance in the loop. GitHub Actions runs the suite on every push. MIT licensed — issues and PRs welcome.

Install (2 minutes)

  1. Clone or download the repo: git clone https://github.com/legato27/sn-ai-debugger.git
  2. Open chrome://extensions, switch on Developer mode.
  3. Click Load unpacked and pick the folder.
  4. Open any ServiceNow tab and launch the side panel.
Get it on GitHub →

Independent open-source project — not affiliated with, endorsed by or supported by ServiceNow or Anthropic. Privacy: the extension talks only to your instance (and, only if you add a key, api.anthropic.com). No telemetry, no third-party servers, PII redaction on by default for exports. Chrome 116+, works on *.service-now.com out of the box.