Skip to content
Docs
GitHub

Incident Commander Agent

Multi-tool evidence gathering, distinguishing correlation from causation, and a narrowly scoped append-only side effect.

3 min readEdit on GitHub

Browse the complete example.

Investigate a fictional checkout alert using contrasting metrics, deployment history, logs, and a runbook; then persist an evidence-backed status update. The agent must investigate before recommending action.

Multi-tool evidence gathering, distinguishing correlation from causation, and a narrowly scoped append-only side effect.

Checkout errors rise from 0.2% to 18.4% after v43 reduces the payment timeout from 2,000 ms to 200 ms. Catalog traffic and database metrics stay normal; sampled logs show requests timing out just beyond the new deadline.

Read metrics, deployments, logs, and the runbook. Identify the timeout reduction as a likely cause, not proven causation. Propose on-call ownership and approval for rollback consideration. Record that conclusion locally without claiming any production mitigation occurred.

Install Rust/Cargo, clone the repository, and run from its root. These folders are self-contained within the workspace: their Cargo manifests reference the local Framework crates, so copying one folder alone is not sufficient.

Terminal window
git clone https://github.com/everruns/everruns.git
cd everruns
export MODEL_API_KEY="your-key"
cargo run -p everruns-incident-commander-agent

The configured model is muse-spark-1.3. Provider access and funded credits are required; a model identifier alone does not grant access. Keep keys in your environment, not in source control. Missing variables, provider errors, or unsuccessful turns exit nonzero.

Try a contrasting question:

Terminal window
cargo run -p everruns-incident-commander-agent -- "Investigate checkout and explain what evidence argues against a database-wide incident. Record a concise update."

This builder combines the agent instructions, tools, and model. Tools/capabilities supply evidence and actions; the model chooses how to use them.

let agent = Agent::builder()
.name("incident-commander-agent")
.instructions(include_str!("instructions.md"))
.provider(everruns::Meta::from_env()?)
.model(MODEL)
.max_iterations(12)
.tool(tools::inspect_evidence())
.tool(tools::record_incident_update())
.build()?;

The shared demo helper subscribes before sending, filters events to this turn, shows bounded tool previews, waits for completion, and rejects unsuccessful turns. It changes presentation only; use session.send_and_wait(question).await? when you do not need the live tool timeline.

let engine = Engine::new();
let session = engine.create(agent);
println!("MODEL: {MODEL}");
demo::run(&session, question).await?;

This engine is in-memory. It does not demonstrate durable session storage; the Everruns Support example can explain that API, but does not itself persist its session.

inspect_evidence exposes only four named fixture categories. record_incident_update appends a non-empty update of at most 500 UTF-8 bytes to this example’s src/incident.log, normalizing newlines. There is deliberately no production rollback tool.

Terminal window
cargo test -p everruns-incident-commander-agent
python3 examples/incident-commander-agent/src/render_demo.py --check

Tests verify that updates survive multiple writes, oversized/empty updates are rejected before a file is created, and evidence access is scoped. A live run should show all evidence reads followed by a persisted update that matches the observed facts.

These checks run offline without provider credentials. To check the model’s answer, run the example and compare its output with the expected outcome above.

Incident Commander Agent recorded run

Read the captured transcript for the full recorded output. The GIF shows excerpts from the run.

With credentials exported and Python 3, VHS, ffmpeg, and a VHS-compatible browser installed:

Terminal window
cd examples/incident-commander-agent
bash src/record.sh

The script captures a successful run, generates correctly wrapped pages and page durations, and renders src/demo.gif. It preserves the previous transcript when the provider run fails. To replay an existing transcript without another model call, run (cd src && python3 render_demo.py && vhs demo.tape). src/demo.txt retains the displayed output; .demo-pages/ is generated and ignored. Inspect results before sharing: public/demo data is safe here, but adapting tools may expose private data.

Replace each fixture with a read-only monitoring/deployment API scoped to the relevant service. Keep investigation separate from action. Add explicit approval and an audit trail before introducing any production mutation.

All telemetry is fictional. The log is a real local append-only artifact, ignored by Git; it contains exercise text and does not change production. Filesystem permissions and rotation are the application’s responsibility.