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.5.tar.gz (496.4 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.5-cp311-abi3-win_amd64.whl (927.9 kB view details)

Uploaded CPython 3.11+Windows x86-64

shadow_diff-3.0.5-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.5-cp311-abi3-macosx_11_0_arm64.whl (989.6 kB view details)

Uploaded CPython 3.11+macOS 11.0+ ARM64

File details

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

File metadata

  • Download URL: shadow_diff-3.0.5.tar.gz
  • Upload date:
  • Size: 496.4 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.5.tar.gz
Algorithm Hash digest
SHA256 486a595e134773f1a7810912f16d09c7df5611d1f4463e190d08a1a0fc0d071d
MD5 1c14374f8f43afc32965d6d44afde452
BLAKE2b-256 df92480c0725dfd3789fef8aa52e5f177d15682c09eb0e95b9ac874b737e3c77

See more details on using hashes here.

Provenance

The following attestation bundles were made for shadow_diff-3.0.5.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.5-cp311-abi3-win_amd64.whl.

File metadata

  • Download URL: shadow_diff-3.0.5-cp311-abi3-win_amd64.whl
  • Upload date:
  • Size: 927.9 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.5-cp311-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 efc1fbccc8e6ff005e98ba9802432073d50322d2d7b260ea5cd08b624b26007c
MD5 84b3eec2aa3c19fda3ac9d2feb486e4f
BLAKE2b-256 b45fcb91c4116acba80496091b0cc7979f30bf0f545b33dca7b5ea5c2cb1ee24

See more details on using hashes here.

Provenance

The following attestation bundles were made for shadow_diff-3.0.5-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.5-cp311-abi3-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for shadow_diff-3.0.5-cp311-abi3-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 4c81deff80e5724daae9f076e52da4212352dca6f1404452bb2666e23fd3c39d
MD5 e2685f8dd7a2ae59273e3a4e5c89c393
BLAKE2b-256 b0689fbdcd25b7dd05dcf70fba6cb0f3cdc8ce547b42536ff2c8007af397dbd4

See more details on using hashes here.

Provenance

The following attestation bundles were made for shadow_diff-3.0.5-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.5-cp311-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for shadow_diff-3.0.5-cp311-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 b6e2463b98e1ab907770fd67b2383a93d36f1724aa4ba4f5265594d562ecce43
MD5 9579fb6f0efbd32f1dd30f0982c742a1
BLAKE2b-256 17b7ea8e974f1d4b1db84bc775ce6a3e932df7d63c16899013345b0014353a95

See more details on using hashes here.

Provenance

The following attestation bundles were made for shadow_diff-3.0.5-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