Behavior contracts for AI agents — tested in your PR, enforced at runtime.
Project description
shadow-diff
Find the exact change that broke your AI agent.
Shadow is a CI-native regression-forensics tool for LLM agents. One command on the PR — shadow diagnose-pr — answers:
- Did agent behavior change?
- How many traces are affected?
- Which exact prompt / model / tool / config change caused it?
- With what confidence (ATE + bootstrap CI + E-value when run with
--backend live)? - What fix should
verify-fixconfirm before merge?
The PyPI distribution is shadow-diff. The Python import path is shadow. The CLI is shadow.
Install
pip install shadow-diff
Requires Python 3.11+. Pre-built wheels ship for Linux x86_64, macOS arm64, and Windows x86_64; other platforms build from source (Rust required).
Optional extras:
pip install 'shadow-diff[anthropic]' # if your agent uses Claude
pip install 'shadow-diff[openai]' # if your agent uses GPT
pip install 'shadow-diff[embeddings]' # paraphrase-robust semantic diff
pip install 'shadow-diff[all]' # everything
60-second tour
shadow demo # nine-axis diff on bundled fixtures, no API key
shadow quickstart # writable copy of a runnable scenario
Then run diff against the writable scenario:
cd shadow-quickstart
shadow diff fixtures/baseline.agentlog fixtures/candidate.agentlog
For the full diagnose-pr flow against your own agent, see docs/features/causal-pr-diagnosis.md and the runnable refund-causal-diagnosis demo.
Record your own agent
from shadow.sdk import Session
with Session(output_path="trace.agentlog"):
# Your existing Anthropic / OpenAI code, unchanged.
client.messages.create(model="claude-sonnet-4-6", messages=[...])
Shadow auto-instruments the Anthropic and OpenAI SDKs and writes content-addressed .agentlog files. Secrets are redacted by default. Or skip the code change entirely:
shadow record -o trace.agentlog -- python your_agent.py
Daily workflow — Shadow as pytest for agent behavior
shadow inspect trace.agentlog # debug a single trace
shadow scan baseline_traces/ # block secret leaks
shadow baseline create baseline_traces/ # pin the gold standard
shadow gate-pr ... # gate every PR
Full docs
The canonical README, the .agentlog spec, runnable examples, and the comparison against adjacent agent-eval and runtime-governance tools all live at https://github.com/manav8498/Shadow.
License
Apache-2.0. See LICENSE-APACHE in this distribution. The .agentlog spec is independently published under Apache-2.0.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file shadow_diff-3.2.5.tar.gz.
File metadata
- Download URL: shadow_diff-3.2.5.tar.gz
- Upload date:
- Size: 581.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
01591fe64a594812db3f0edbaf7e8f1146f722386c10f551661dcb0923a27f6e
|
|
| MD5 |
7bf75201bde2aed302a0414d413a6f95
|
|
| BLAKE2b-256 |
c54f18de8d3e65ff4c35adf589270f033ecc78595fcea94ed17295bbd7b25689
|
Provenance
The following attestation bundles were made for shadow_diff-3.2.5.tar.gz:
Publisher:
release.yml on manav8498/Shadow
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
shadow_diff-3.2.5.tar.gz -
Subject digest:
01591fe64a594812db3f0edbaf7e8f1146f722386c10f551661dcb0923a27f6e - Sigstore transparency entry: 1526705461
- Sigstore integration time:
-
Permalink:
manav8498/Shadow@fc515032ef4646b0a3a096a644991665a3de6ab0 -
Branch / Tag:
refs/tags/v3.2.5 - Owner: https://github.com/manav8498
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@fc515032ef4646b0a3a096a644991665a3de6ab0 -
Trigger Event:
push
-
Statement type:
File details
Details for the file shadow_diff-3.2.5-cp311-abi3-win_amd64.whl.
File metadata
- Download URL: shadow_diff-3.2.5-cp311-abi3-win_amd64.whl
- Upload date:
- Size: 1.0 MB
- Tags: CPython 3.11+, Windows x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5fc79286f8154e533e1df4b9afb7e470551a82471b6a35dfa8083bab68f7bc77
|
|
| MD5 |
0bf3d71171648b078dc70d0aedf287d0
|
|
| BLAKE2b-256 |
a00c1379f0225755387f8aefb346d23b47a31ca9aca8a2de9c38c33229f98407
|
Provenance
The following attestation bundles were made for shadow_diff-3.2.5-cp311-abi3-win_amd64.whl:
Publisher:
release.yml on manav8498/Shadow
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
shadow_diff-3.2.5-cp311-abi3-win_amd64.whl -
Subject digest:
5fc79286f8154e533e1df4b9afb7e470551a82471b6a35dfa8083bab68f7bc77 - Sigstore transparency entry: 1526705708
- Sigstore integration time:
-
Permalink:
manav8498/Shadow@fc515032ef4646b0a3a096a644991665a3de6ab0 -
Branch / Tag:
refs/tags/v3.2.5 - Owner: https://github.com/manav8498
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@fc515032ef4646b0a3a096a644991665a3de6ab0 -
Trigger Event:
push
-
Statement type:
File details
Details for the file shadow_diff-3.2.5-cp311-abi3-manylinux_2_34_x86_64.whl.
File metadata
- Download URL: shadow_diff-3.2.5-cp311-abi3-manylinux_2_34_x86_64.whl
- Upload date:
- Size: 1.2 MB
- Tags: CPython 3.11+, manylinux: glibc 2.34+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
70d6a8e9e00415b7351165c5ad9dc43674f533fbdcf6f70785ceb349dc29f82a
|
|
| MD5 |
fcd777f53aa85b55a6ec7f8d0a693d9c
|
|
| BLAKE2b-256 |
db553361b3ae62ff443f91b2f5bc6ab9ac1dd28985de10c29b13c6400d95b4c2
|
Provenance
The following attestation bundles were made for shadow_diff-3.2.5-cp311-abi3-manylinux_2_34_x86_64.whl:
Publisher:
release.yml on manav8498/Shadow
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
shadow_diff-3.2.5-cp311-abi3-manylinux_2_34_x86_64.whl -
Subject digest:
70d6a8e9e00415b7351165c5ad9dc43674f533fbdcf6f70785ceb349dc29f82a - Sigstore transparency entry: 1526705536
- Sigstore integration time:
-
Permalink:
manav8498/Shadow@fc515032ef4646b0a3a096a644991665a3de6ab0 -
Branch / Tag:
refs/tags/v3.2.5 - Owner: https://github.com/manav8498
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@fc515032ef4646b0a3a096a644991665a3de6ab0 -
Trigger Event:
push
-
Statement type:
File details
Details for the file shadow_diff-3.2.5-cp311-abi3-macosx_11_0_arm64.whl.
File metadata
- Download URL: shadow_diff-3.2.5-cp311-abi3-macosx_11_0_arm64.whl
- Upload date:
- Size: 1.1 MB
- Tags: CPython 3.11+, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8699e18dab463fb95f6a3e01ae8423e164d88d9c5c14a899de3e51847988568e
|
|
| MD5 |
48d7e9a69cdf1219947a72f18c16f3bb
|
|
| BLAKE2b-256 |
03c24a2c9bae52d25770888ac82009447f5140706cb90375591b120350e40078
|
Provenance
The following attestation bundles were made for shadow_diff-3.2.5-cp311-abi3-macosx_11_0_arm64.whl:
Publisher:
release.yml on manav8498/Shadow
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
shadow_diff-3.2.5-cp311-abi3-macosx_11_0_arm64.whl -
Subject digest:
8699e18dab463fb95f6a3e01ae8423e164d88d9c5c14a899de3e51847988568e - Sigstore transparency entry: 1526705614
- Sigstore integration time:
-
Permalink:
manav8498/Shadow@fc515032ef4646b0a3a096a644991665a3de6ab0 -
Branch / Tag:
refs/tags/v3.2.5 - Owner: https://github.com/manav8498
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@fc515032ef4646b0a3a096a644991665a3de6ab0 -
Trigger Event:
push
-
Statement type: