Skip to main content

Behavior contracts for AI agents — tested in your PR, enforced at runtime.

Project description

shadow-diff

Catch AI-agent regressions before they hit production.

Shadow is a PR-native diff tool for LLM agents — it records your agent's calls, replays them under a new config, and tells you what changed across nine behavioural dimensions.

Install

The PyPI distribution name is shadow-diff (the bare shadow name on PyPI is an unrelated project). The Python import path is shadow, and the CLI is shadow.

pip install shadow-diff

# With Anthropic support:
pip install 'shadow-diff[anthropic]'

# With OpenAI support:
pip install 'shadow-diff[openai]'

# With both + embeddings:
pip install 'shadow-diff[anthropic,openai,embeddings]'

Requires Python 3.11 or newer.

Quickstart

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 automatically patches the Anthropic and OpenAI SDKs to capture every request/response. Secrets are redacted by default.

Then in CI:

shadow replay new-config.yaml --baseline trace.agentlog
shadow diff trace.agentlog candidate.agentlog
shadow bisect old-config.yaml new-config.yaml --traces trace.agentlog

Full docs

The canonical README, examples, the .agentlog spec, and the project roadmap live at https://github.com/manav8498/Shadow.

License

Dual-licensed under MIT OR Apache-2.0. See LICENSE-MIT and LICENSE-APACHE in this distribution, or the project repository.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

shadow_diff-3.0.6.tar.gz (496.3 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

shadow_diff-3.0.6-cp311-abi3-win_amd64.whl (933.6 kB view details)

Uploaded CPython 3.11+Windows x86-64

shadow_diff-3.0.6-cp311-abi3-manylinux_2_34_x86_64.whl (1.1 MB view details)

Uploaded CPython 3.11+manylinux: glibc 2.34+ x86-64

shadow_diff-3.0.6-cp311-abi3-macosx_11_0_arm64.whl (993.7 kB view details)

Uploaded CPython 3.11+macOS 11.0+ ARM64

File details

Details for the file shadow_diff-3.0.6.tar.gz.

File metadata

  • Download URL: shadow_diff-3.0.6.tar.gz
  • Upload date:
  • Size: 496.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for shadow_diff-3.0.6.tar.gz
Algorithm Hash digest
SHA256 34d081271ce150b54171e55b7a8ee03a5f346a2508bb2f654f6ff09cb194bcfe
MD5 df894368bf64e2e46aba05038516de2a
BLAKE2b-256 c3fec07db5eedd3aee0ed39a1286ba7be55031a2dcf6a624d2cb5f48352b67ea

See more details on using hashes here.

Provenance

The following attestation bundles were made for shadow_diff-3.0.6.tar.gz:

Publisher: release.yml on manav8498/Shadow

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file shadow_diff-3.0.6-cp311-abi3-win_amd64.whl.

File metadata

  • Download URL: shadow_diff-3.0.6-cp311-abi3-win_amd64.whl
  • Upload date:
  • Size: 933.6 kB
  • Tags: CPython 3.11+, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for shadow_diff-3.0.6-cp311-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 941620d4bff77c6eac2eb058453a97b663f6d79285b5cadbb51c077554f02e82
MD5 fb6d8968c3abcff8e753c2051a6fcf12
BLAKE2b-256 ecfb0a2502d99ab849f458e920f84a430c6e7591ed0562448647d4f5ad7d561f

See more details on using hashes here.

Provenance

The following attestation bundles were made for shadow_diff-3.0.6-cp311-abi3-win_amd64.whl:

Publisher: release.yml on manav8498/Shadow

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file shadow_diff-3.0.6-cp311-abi3-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for shadow_diff-3.0.6-cp311-abi3-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 ad77423fcfd89285df24a732b6326753cac07bb5835b21743cd306eb7246e4a4
MD5 3c4a3382121c68a1af9f97ba08266276
BLAKE2b-256 935e597cc86e0cf70ce3ef36a9f9a3c4f8225cc18cd02768d922fad3d15a9eb1

See more details on using hashes here.

Provenance

The following attestation bundles were made for shadow_diff-3.0.6-cp311-abi3-manylinux_2_34_x86_64.whl:

Publisher: release.yml on manav8498/Shadow

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file shadow_diff-3.0.6-cp311-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for shadow_diff-3.0.6-cp311-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 d536039d31006a53a86b4ee82a854fabd390a3702aa107bc7353b15f8411297f
MD5 86c6111461ae41135f0e6503d4fa7ea8
BLAKE2b-256 d008cd696c4c9a5bce2dd5ca5a878b20c7eb165b67492b6ac30fb73bc6371047

See more details on using hashes here.

Provenance

The following attestation bundles were made for shadow_diff-3.0.6-cp311-abi3-macosx_11_0_arm64.whl:

Publisher: release.yml on manav8498/Shadow

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page