Open source · beta · local-first
AI writes the code.
AgentDiff decides if it ships.
When APIs break, dependencies change, or agents generate code — AgentDiff detects affected call sites, proves the patch in an isolated clean room, and delivers a verified PR with cryptographic evidence.
git clone https://github.com/kam6l/agentdiff.git && cd agentdiff && uv tool install .
Deterministic verification · Real-state observation · Zero false claims
agentdiff / verification capsule
recorded
.envdenypyproject.tomlreviewsrc/llm.pyallowClick "Detected" and "Verified" to switch between initial risk evaluation and clean-room proof.
From API change
to trusted PR.
What happens when an upstream dependency introduces a breaking change? AgentDiff automates the entire trust pipeline without human guesswork.
API change detected
Provider deprecation matched against structured change catalogs with SDK version awareness.
openai 0.28 → 1.0 (ChatCompletion)
Affected code found
AST analysis locates every call site in your repository. Provenance-tracked, zero false positives.
src/llm.py:42 · 3 call sites
Blast radius computed
Deterministic 0–100 score accounting for affected files, dependency risk, and policy rules.
Migration generated
Deterministic AST transforms for known patterns; supervised agent fallback for complex logic.
AST transform: 3 files · 0 hallucinated
Clean-room proof
Patch replayed in an isolated worktree. Syntax, types, targeted tests, and full suite executed.
V0 syntax ✓ · V1 types ✓ · V2 tests ✓
Trusted PR delivered
PR opened with machine-readable Migration Certificate, test results, digest, and rollback instructions.
sha256:e45c0d69...
agentdiff scan --provider openaiopenai.ChatCompletion.create()openai.ChatCompletion.create()openai.Embedding.create()agentdiff verify --clean-room --isolatedagentdiff cert inspect run_e45c0d69{
"certificate_id": "cert_9f4a12b8",
"provider": "openai",
"change": "0.28 → 1.0",
"verification_level": "V3",
"proof_digest": "sha256:e45c0d69a41e9b28b7e21a4f5c9d8e7a",
"rollback_cmd": "agentdiff rollback run_e45c0d69 --safe-only",
"signature_verified": true
}
An API changed.
Who's affected?
AgentDiff scans Python AST to pinpoint every third-party API call across your codebase. Not regex or grep. Provenance-tracked, SDK-version aware, zero false positives.
# Deprecated pattern in src/llm.pyresponse = openai.ChatCompletion.create( model="gpt-4", messages=[{"role": "user", "content": prompt}])
# Verified AST migrationclient = openai.OpenAI()response = client.chat.completions.create( model="gpt-4", messages=[{"role": "user", "content": prompt}])
$ agentdiff api scan --root . && agentdiff api check --root . --fail-on high
Blast radius,
not guesswork.
AgentDiff computes an explainable 0–100 score from real filesystem observations, dependency changes, and policy outcomes. Every point is accounted for—no opaque model confidence scores.
Explore the blast-radius scoring modelblast radius81 CRITICAL · PR PROMOTION BLOCKED UNTIL RESOLVED
Deterministic transforms.
Agent fallback.
Known migrations use deterministic AST transforms with 100% precision. Complex migrations fall back to a supervised coding agent. Either way: the patch is untrusted until AgentDiff proves it.
Provider-extensible transforms for known breaking changes. Zero hallucination risk, exact AST syntax trees.
Coding agents handle arbitrary multi-file refactoring, but output is sandboxed and treated as unproven input.
Regardless of source, no code reaches your repository without passing the deterministic verification engine.
src/llm/client.py · AST Migration Diff
AST Transform · 0 Hallucinations
- # Legacy OpenAI 0.28 call site
- response = openai.ChatCompletion.create(
- model="gpt-4",
- messages=[{"role": "user", "content": prompt}],
- temperature=0.7,
- )
- text = response["choices"][0]["message"]["content"]
+ # Migrated OpenAI 1.0 (Deterministic AST transform)
+ client = OpenAI()
+ response = client.chat.completions.create(
+ model="gpt-4",
+ messages=[{"role": "user", "content": prompt}],
+ temperature=0.7,
+ )
+ text = response.choices[0].message.content
Clean-room proof.
No shortcuts.
Every generated patch is replayed in an isolated worktree. Tests, types, and linters run in a clean environment, completely detached from the generation process. If tests fail, the bounded repair loop steps in.
Parses without errors across all modified files.
Type checks and imports verified in clean room.
Targeted test suite for affected call sites passes.
Entire repository test suite passes cleanly.
$ agentdiff prove <run-id> && agentdiff promote <run-id>Clean-room proof → conflict-safe promotionOne PR.
Full evidence.
The verified patch is promoted to a pull request with an attached Migration Certificate detailing the upstream change, affected files, test results, proof digest, and rollback command.
Migration Certificate · openai 0.28 → 1.0
verified
sha256:e45c0d69a41e9b28...agentdiff rollback <id> --safe-onlyNot another coding agent.
The trust layer.
Coding agents generate code. Dependabot bumps versions. Neither scores blast radius, verifies changes in clean rooms, or attaches cryptographic proof. AgentDiff is the verifier between generation and deployment.
Trust engine
architecture.
Built on deterministic foundations: no-follow filesystem scanning, tamper-evident SHA-256 digests, warm isolated workspaces, and safe promotion.
Every patch is replayed in a fresh, isolated worktree. Syntax, types, and test suites run from scratch with zero leakage from the agent environment.
Captures before/after manifests, SHA-256 checksums, policy provenance, blast-radius components, and process identifiers in a versioned local capsule.
Targeted undo for review and deny mutations without blowing away allowed work. Human edits become conflicts and are safely preserved.
When proof fails, the automatic repair loop retries the patch—strictly bounded to the initial task scope. No infinite agent loops.
Fine-grained path rules with explicit provenance. Every mutation is categorized with allow, review, or deny and audit trail.
Pre-warmed workspace snapshots enable sub-second clean-room verification runs without costly dependency reinstallations.
Evidence, not
security theater.
The local runtime observes a subprocess. It does not pretend to be a kernel sandbox just because an AI agent executed the command.
- Does capture no-follow filesystem state and versioned evidence
- Does enforce command mutation policy before local process launch
- Does not block network access in local observation mode
- Does not claim causal ownership of machine-wide port changes
What works today.
What's coming next.
AgentDiff is in public beta. Here is an honest accounting of current production capabilities and our near-term roadmap.
- AST-based API scanning Zero-false-positive call site detection (OpenAI & Stripe)
- Dependency & SDK matching Catalog matching with version awareness
- Blast radius scoring Deterministic 0–100 impact scoring
- Clean-room verification Isolated worktree proof engine
- Policy engine Allow / review / deny rules with provenance
- Evidence capsules Tamper-evident manifests with SHA-256 hashes
- Selective recovery Conflict-safe per-file rollback (
--safe-only) - Zero-touch wrapper Automated agent execution via
agentdiff wrap
- Automated AST migrations Built-in transforms for major SDK transitions
- Verified GitHub PRs Direct PR delivery with Migration Certificates
- API Change Manifests Standardized machine-readable change format
- Graduated proof ladder Verification levels V0 through V5
- Expanded provider catalogs AWS SDK, Anthropic, LangChain, Twilio
- Signed release artifacts PyPI Trusted Publishing with provenance
- OpenTelemetry export Standardized evidence export to telemetry collectors
The coding agent is probabilistic. The verifier is deterministic.