Developer Onboarding

Zero to gated agent in five minutes.

No API keys. No external accounts. No telemetry daemons. One clean install, one recorded golden trace, and an automated regression gate protecting every PR.

5-Minute SetupPython 3.10+100% Local-First & Air-Gapped
The 4-Step Flow

From local execution to automated CI gate.

01INSTALLATION

Install the CLI & Library

Install AgentDiff into your virtual environment via pip or uv. Pure Python, zero telemetry, and zero background daemons.

< 3 seconds
terminal
# Install via pip pip install agent-trajectory-diff # Or add to uv project uv add agent-trajectory-diff
02INIT WIZARD

Initialize Your Project with agentdiff init

Run the zero-config wizard. It auto-detects your agent framework (LangGraph, CrewAI, OpenAI Agents, OpenTelemetry), writes agentdiff.toml, and generates your GitHub Actions CI gate workflow.

Auto-Detection
terminal
# Auto-detect framework and generate config + gate workflow agentdiff init --scenario customer_support --runs 3 # Or include the /agentdiff approve bot workflow agentdiff init --with-approve
03STATISTICAL BASELINE

Record an N-Run Baseline Envelope

Capture variance bands across multiple runs so non-deterministic agents don't flake the CI gate on harmless timing or token jitter.

Variance Bands
terminal
# Record a 3-run baseline envelope agentdiff record my_agent_module:run \ --input '{"query": "Generate Q3 sales analysis"}' \ --runs 3 \ --out baselines/customer_support.envelope.json
04HONEST MERGE GATE

Gate CI & Bless with /agentdiff approve

Run the comparator in CI. Hard invariants (loops, error cascades) strictly block merging, while reviewers can bless intended improvements directly from PR comments.

Exit 0 / 1 + Bot
ci_pipeline.sh
# Diff candidate run against statistical baseline envelope agentdiff diff baselines/customer_support.envelope.json traces/pr_candidate.json \ --fail-on-regression \ --pr ${{ github.event.number }} # Reviewers bless accepted improvements right on GitHub: # Comment: /agentdiff approve
Integration Modes

Two ways to integrate in your workflow.

Whether you prefer unit test assertions in pytest or repository-wide threshold governance in agentdiff.toml:

Option A · Pytest PluginNative Python

Programmatic Pytest Assertions

Run your golden test baselines directly through standard pytest runners. Automatically flag regressions with expressive assert_no_regressions() assertions.

test_agent.py
def test_agent_checkout(): baseline = load_trace("golden.json") candidate = run_agent(input_data) assert_no_regressions( compare(baseline, candidate), max_divergence=0.25, allow_loops=False )
Option B · Declarative ConfigRepository Policy

Declarative Governance Policy

Commit your regression thresholds once in agentdiff.toml. Audit threshold alterations directly on PRs to prevent silent test weakening.

agentdiff.toml
[scenario.default] mode = "statistical" sample_runs = 3 max_cost_increase_pct = 5.0 [scenario.default.hard_invariants] fail_on_identical_loops = true max_tool_repeats = 3 [scenario.default.tolerances] step_count_std_dev = 2.0 divergence_ceiling = 0.35
Next Step

Ready to automate on GitHub?

Install the official GitHub App or drop the Action into your repository for instant diagnostic comments and in-PR approval.