Scalene (scalene-guard)
Provenance-based DLP tool-call hooks that thwart the MCP triangle of death (untrusted input + sensitive data + external egress in one agent session) using rule-driven access control.
Scalene tracks trust and sensitivity during an AI coding agent session and blocks tool calls outright once the session has touched anything unrecognized, unless the specific destination has been explicitly verified (a real scan) and explicitly cleared (a rule in scalene_policy.yaml) — or vetted on the spot in opt-in OLOY mode.
Install
Requires Python 3.13+.
# Core hook (`scalene-guard`) and CLI (`scg`)
pip install scalene-guard
# Include the live approval-queue TUI (`scg monitor`)
pip install "scalene-guard[monitor]"
This installs two commands:
scalene-guard— thePreToolUse/PostToolUsehook invoked automatically by Claude Code (not run by hand in normal use).scg— the developer-facing CLI (scg install-hooks,scg onboard,scg monitor).
Why
scalene-guard/scg? Thescalenepackage name and command already belong to the Python CPU/GPU/memory profiler; usingscalene-guardandscgavoids colliding if both are installed in the same environment.
Quick start
Wire Scalene into a Claude Code project in one command:
cd /path/to/your-project
scg install-hooks
Then run scg monitor in a separate terminal (requires scalene-guard[monitor]) to review, verify, and approve or deny blocked calls live — or walk through a 5-minute hands-on demo without touching a real project in Getting Started.
Documentation
| Doc | Purpose |
|---|---|
| Getting Started | 5-minute walkthrough — watch Scalene block, then explicitly clear, a real tool call |
| Setup | Installation, .claude/settings.json hook registration, and state files |
| User Guide | Full CLI reference, access-control model, OLOY mode, policy config, troubleshooting |
| Monitor Guide | scg monitor interactive TUI walkthrough with screenshots |
| Architecture | System architecture, security model, and design decisions |
| SDLC & Release | Toolchain, quality gates, CI, and PyPI Trusted Publishing release process |
| BRD / PRD / User Stories | Requirements and acceptance criteria |
Developing on this repo
make setup # create .venv, install scalene-guard[monitor,dev], pinned gitleaks, and git hooks
make test # run the unit test suite
make build # build sdist + wheel into dist/
make check-dist # validate metadata (twine check), sdist hygiene, and clean-venv wheel smoke test
make setup also wires up this repo's tracked git hooks (.githooks/, via core.hooksPath), including a pre-commit gitleaks scan that blocks commits containing secrets. It installs a pinned, checksum-verified gitleaks into .venv/bin (make install-gitleaks, no sudo required). See docs/SDLC.md for all targets, quality gates, and the PyPI release workflow.
License
Metadata
Release files for scalene-guard 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| scalene_guard-0.1.0.tar.gz | 181.0 kB | With provenance | Details for scalene_guard-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| scalene_guard-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for scalene_guard-0.1.0-py3-none-any.whl |
Total release size: 276.1 kB
Release files / scalene_guard-0.1.0.tar.gz
| Download URL | scalene_guard-0.1.0.tar.gz |
|---|---|
| Size | 181.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
86d06cb71da6653879f37b0df0e9eb0b61c0bd64ad0ad3fad501189298bfae55
|
|
BLAKE2b-256 checksum How to use checksums |
e05790797cb77e6360c2fc9e14d94d6a24f23635080439673373b6b50feccb8b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 22, 2026.
Transparency logRelease files / scalene_guard-0.1.0-py3-none-any.whl
| Download URL | scalene_guard-0.1.0-py3-none-any.whl |
|---|---|
| Size | 95.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
306586eb7b775894f445c50a8059d5e0273573732ed2be7f5dad8a1558862c82
|
|
BLAKE2b-256 checksum How to use checksums |
05d127d9969cb2bce3a3bc34998975e6a30ca2f6f3f44b9ded06e76d977ac433
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 22, 2026.
Transparency logSecurity for scalene-guard 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for scalene_guard-0.1.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 22, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.