Getting started
Quickstart¶
Zero-touch in one line¶
For coding agents, agentdiff init compiles the canonical trust configuration
and agentdiff wrap runs the full pipeline automatically:
See Zero-touch automation for the AUTO / RETRY / HUMAN routing contract. The rest of this quickstart walks through the transaction primitives underneath.
1. Install from source¶
You need Python 3.14 (or 3.12+) and uv.
2. Create a disposable project¶
The generated agentdiff.yaml allows src/**, reviews dependency metadata, denies common secret paths, observes network-related state without blocking traffic, and enables bounded recovery backups.
3. Create the task¶
Save this as agent_task.py:
from pathlib import Path
Path("src").mkdir(exist_ok=True)
Path("src/parser.py").write_text("def parse(value):\n return value.strip()\n")
Path("pyproject.toml").write_text('[project]\nname = "demo"\n')
Path(".env").write_text("API_TOKEN=demo-only\n")
The values are synthetic, but use only a disposable workspace for the walkthrough.
4. Run under observation¶
The human summary now leads with the outcome:
Task completed
Expected changes: 1
Unexpected changes: 1
Protected changes: 1
Blast Radius: CRITICAL (81/100)
Recovery available: YES
Policy outcome: DENY
The process completed, but the transaction returns exit code 3 because a protected mutation was observed. Local mode records the write after execution; it does not intercept or block it.
5. Inspect and verify¶
Copy the run ID printed below the summary:
6. Recover only collateral¶
Expected result:
src/parser.py stays because policy allowed it. If a person or later process changed a collateral path, AgentDiff records a conflict and preserves the current path.