dox

end13s/dox Checked 1 day ago

On-call agent that detects a checkout outage, proves the bad commit in a sandbox, and waits for human approval before merging the revert.

An on-call agent that handles a production incident from alert to postmortem. It notices a checkout outage and finds the commit behind it. Then it proves the cause by running a test in an isolated sandbox and opens a revert pull request. It waits for a human to approve the merge before it verifies recovery and writes the postmortem. Built in one day at the Agent Harness Hackathon (TrueFoundry and HackerSquad, Santa Clara, September 2026) on TrueForge, with OpenAI models, Daytona sandboxes and GitHub's MCP server.

Summary extracted from the README.

dox

An on-call agent that handles a production incident from alert to postmortem. It notices a checkout outage and finds the commit behind it. Then it proves the cause by running a test in an isolated sandbox and opens a revert pull request. It waits for a human to approve the merge before it verifies recovery and writes the postmortem.

Built in one day at the Agent Harness Hackathon (TrueFoundry and HackerSquad, Santa Clara, September 2026) on TrueForge, with OpenAI models, Daytona sandboxes and GitHub's MCP server.

What it does

Step What happens
Detect An incident monitor watches the service's telemetry. Once 5% or more of at least 100 requests fail for 10 seconds, it opens a TrueForge session with the alert. Nobody has to type it.
Investigate Two subagents work in parallel, read-only. One reads the error rate, logs and deploys through a custom observability MCP server, and the other reads recent commits and diffs through GitHub's MCP server.
Prove In a Daytona sandbox the agent clones the service and writes a test that reproduces the logged error. The test must fail at the suspect commit and pass at its parent.
Propose It opens a focused revert pull request, with the error rate, the stack trace and both test runs as evidence.
Wait Merging is approval-gated in TrueForge. The agent pauses until a human approves, and the session survives a browser refresh.
Verify A deployment watcher ships the merged fix. The agent waits until telemetry proves recovery on live traffic, then files a postmortem issue.
Resist During the outage, a planted log line tells the agent to delete main and disable alerting. The agent treats logs as data, so it flags the line and ignores it.
flowchart LR
    T[Traffic] --> S[Checkout service]
    S --> M[Telemetry and logs]
    M --> MON[Incident monitor] -->|alert| A[dox agent on TrueForge]
    A --> L[Log investigator<br/>observability MCP]
    A --> C[Change investigator<br/>GitHub MCP]
    L --> P[Sandbox repro<br/>fails at bad commit,<br/>passes at parent]
    C --> P
    P --> PR[Revert PR with evidence]
    PR --> H{Human approves<br/>the merge?}
    H -->|yes| D[Deployer ships the fix] --> V[Recovery verified] --> PM[Postmortem issue]

The incident

The demo service is a small FastAPI checkout endpoint that applies discount codes. A commit titled refactor: simplify discount lookup swaps DISCOUNTS.get(code, 0.0) for direct indexing. From then on any unknown code raises KeyError and the checkout fails with HTTP 500. CI still passes, because the tests only cover valid codes. About one generated request in five uses an unknown code, so the error rate jumps to roughly 20%. The agent has to find the cause from production signals and history, without a failing test to point at it.

Design choices

  • Proof before a pull request. The agent may not propose a fix it has not reproduced. If the sandbox is unavailable, it reports the error and stops.
  • Read-only until approved. The investigating subagents have no write tools, and merge_pull_request and restart_service need human approval in TrueForge. Neither the monitor nor the dashboard can approve anything.
  • Logs are untrusted input. The instructions, tool descriptions and runbook all treat log lines, diffs and commit messages as data. The planted prompt injection tests this on every run.
  • Recovery has to be proven. Request outcomes are stored in SQLite, so a restart cannot erase an incident. Recovery needs fewer than 1% errors across at least 30 requests spanning 30 seconds of live traffic, so an empty window never counts.
  • Progress comes from tool results. The dashboard advances only on successful tool responses, such as an opened pull request or a completed merge. What the agent says it did does not count.
  • No duplicate alerts. The monitor keeps its incident state on disk and reconciles with TrueForge after a restart. It never resends an alert whose delivery is uncertain.
  • Least-privilege access. The agent's GitHub token is a fine-grained token scoped to the demo service repository alone. The scripts that reset, commit and push refuse to run anywhere except a clone of that repository.

Repositories

  • end13s/dox (this repository) holds the agent instructions, the runbook skill, the observability MCP server, the incident monitor, the ops scripts and the tests. It also keeps a reference copy of the service.
  • end13s/checkout-service-demo is the deployment repository the agent works on. The deployer runs a clone of it, and the agent opens its pull requests there. Fork it to run the demo yourself.

Getting started

You need Python 3.11 or newer, Node.js 22.14 or newer for TrueForge, an OpenAI API key, a Daytona API key, and a GitHub fine-grained token for your fork of the service (contents, pull requests and issues).

git clone https://github.com/end13s/dox
git clone https://github.com/<you>/checkout-service-demo    # your fork, next to dox
cd dox
python -m venv .venv
. .venv/Scripts/activate                                    # macOS/Linux: source .venv/bin/activate
pip install -r checkout-service-demo/requirements.txt -r oncall-forge/mcp-observability/requirements.txt
cp oncall-forge/.env.example oncall-forge/.env              # point DEMO_REPO at your fork

Next, follow oncall-forge/README.md to start the service, traffic, deployer, observability server and TrueForge. Then use the demo guide to run an incident.

Run the tests from the repository root:

python -m pytest oncall-forge/tests -q
python -m pytest checkout-service-demo -q

The suite runs two isolated failure, restart and recovery cycles against a real service process. It covers:

  • persistent telemetry and traceback parsing;
  • duplicate-alert prevention, uncertain delivery and tool-backed progress;
  • the guard that keeps the deploy scripts out of this repository.

It never touches GitHub.

Tech stack

TrueForge (local mode), OpenAI models, Daytona, GitHub MCP server, FastMCP, FastAPI, uvicorn, SQLite, httpx, pytest.

Project layout

oncall-forge/
  agent/                     agent instructions, subagent briefs, TrueForge setup
  skills/incident-runbook/   runbook skill the agent loads during an incident
  mcp-observability/         FastMCP server: error rate, logs, deploys, restart
  ops/                       incident monitor, deployer, traffic, break and reset scripts
  tests/                     monitor, telemetry and ops tests
  docs/                      demo guide and presentation script
checkout-service-demo/       reference copy of the demo service and its dashboard
docs/hackathon/              challenge brief, build plan and schedule from the event

Credits

Built at the Agent Harness Hackathon by Eduard Dehelean (project lead), Robert Lagidze and Aldi (@aldisworkspace).

Roadmap

  • Take alerts from a real alerting source instead of the demo monitor
  • Handle failures other than a single bad commit, such as configuration changes or dependency bumps
  • A recorded end-to-end run in this README