damage-control-dev
A guardrail layer for AI coding agents. It runs as a Claude Code PreToolUse hook and blocks or asks before destructive commands, secret access, protected-path writes and risky MCP calls, before the tool runs.
It is a seatbelt, not a sandbox. See What it is not.
uv tool install damage-control-dev # or: pipx install damage-control-dev
damage-control-dev init # register the hooks, self-test them, record the install
damage-control-dev status # read-only drift report
Supports Claude Code on macOS and Linux, Python 3.9 or newer. Nothing else is supported or planned.
What it does
- Guards Bash, Edit, Write, Read and MCP tool calls through one policy ladder (allow, ask, block).
- Re-scans wrapped commands as commands in their own right:
ssh host "...",sh -c, database clients (psql -c,mysql -e),git -ckeys that run programs. - Protects its own control plane: the hook scripts, the settings that register them, and its policy file cannot be edited by the agent it guards.
- Fails closed: any crash or import failure in the hook exits 2 (block), and
initregisters the hook withonFailure: block(Claude Code 2.1.295 or newer) so a missing interpreter blocks the call instead of silently allowing it. - Unattended mode: when no human can answer a prompt, an
askbecomes a block unless a rule carries an explicit grant. - Rules ship as groups that are on by default (control-plane, core, git, uv, registry, payloads, remote, mcp-tools, outbound) and opt-in vendor packs:
aws,gcp,firebase,cloud-hosting,databases,containers,infrastructure,publish,tmux. Every rule has a frozen, stable id. - Offline: after
initnothing touches the network.
damage-control-dev check "git push --force origin main" # what would the hooks decide?
damage-control-dev rules # list enforced rule ids
damage-control-dev packs # list packs; enabling is human-terminal only
damage-control-dev doctor --fix # self-test and repair
damage-control-dev uninstall # remove exactly our entries
What it is not
- Not a sandbox, and not a boundary against a determined adversary. A process running as the same OS user can edit anything this tool can.
- Only as strong as the harness's hook surface: commands you type yourself with
!, tools that have no hook event, and a hook that times out are outside its reach. - No network egress filtering, containment or resource limits.
- Expect false positives and false negatives. The policy is: ask, then learn.
See docs/threat-model.md.
Where things live
Everything the installer keeps is under ~/.damage-control/ (or $DAMAGE_CONTROL_HOME), except the policy file, which is always ~/.damage-control/damagecontrol.yml:
damagecontrol.yml: the protected policy (kill switch,packs:,disabled_groups:)damage-control/,tooldefs/: your own rule overlaysstate/install.json: whatinitrecorded (interpreter, ruleset digest, per-scope write hash);state/backups/holds first-write backups of your settings filebin/damage-control-breakglass: a stdlib-only script that unregisters the hooks if the Python environment is ever brokenlogs/damage-control/<date>.jsonl: the audit log, one JSON line per decision
A policy with no packs: key loads the default groups and no vendor packs; an unreadable policy loads everything.
If the environment breaks (for example a uv tool install --force interrupted mid-upgrade) and the hook cannot start, every tool call is blocked by design. Run python3 ~/.damage-control/bin/damage-control-breakglass unregister from a normal terminal, then reinstall and run init again.
Docs
Start at docs/index.md.
- docs/threat-model.md: what it protects against and the residuals
- docs/coverage.md: which tools are covered and how
- docs/rule-authoring.md: writing rules, packs and overlays
- docs/extending.md: profiles, the hook runtime, registration and repair
Security
A bypass of a shipped rule that the threat model says should be caught is a vulnerability. Report it privately, see SECURITY.md.
License
Apache-2.0. Contributions are signed off under the DCO, see CONTRIBUTING.md.
Metadata
Release files for damage-control-dev 0.1.3
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 |
|---|---|---|---|---|
| damage_control_dev-0.1.3.tar.gz | 223.4 kB | With provenance | Details for damage_control_dev-0.1.3.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| damage_control_dev-0.1.3-py3-none-any.whl | Python 3 | none | any | Details for damage_control_dev-0.1.3-py3-none-any.whl |
Total release size: 475.9 kB
Release files / damage_control_dev-0.1.3.tar.gz
| Download URL | damage_control_dev-0.1.3.tar.gz |
|---|---|
| Size | 223.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
fc056c36f1dc37b9be9c6a4aec041ef594483a4ec4745807cf1f38880f18a2d6
|
|
BLAKE2b-256 checksum How to use checksums |
b6bd489e2924734c2a3a4ea30c38f7c8cb59da63f63d67465bb41da974502238
|
| 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 2, 2026.
Transparency logRelease files / damage_control_dev-0.1.3-py3-none-any.whl
| Download URL | damage_control_dev-0.1.3-py3-none-any.whl |
|---|---|
| Size | 252.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
39e4164465ba78fa86eb38a0a0d5168b6fabe45edd65c6a271159ee99d7499b6
|
|
BLAKE2b-256 checksum How to use checksums |
079ed938315495e780f0522f0db2ad293c173aa98e34b7ca6485a1b4d68edb2c
|
| 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 2, 2026.
Transparency logSecurity for damage-control-dev 0.1.3
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
All 2 files in this release have been uploaded with provenance metadata.
Attestation for damage_control_dev-0.1.3.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 2, 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.