Repository navigation
Releases
v0.7.2
Fixes a regex backtracking stall (CodeQL py/redos) in the detector for sed scripts that run eval: a run of backslashes inside an s command made the scan slow down exponentially. The scan time limit and watchdog still blocked such a call, so it was a stall, not a bypass. The detector now shares the linear regex the sed payload scanner already used.
Built by dotdev.dev
v0.7.1
Supply-chain hardening; no change to the hook or rules.
- All GitHub Actions pinned to commit SHAs at their latest releases; the PyPI publish action moves from the floating
release/v1branch to v1.14.3 (GHSA-5xjx-3w67-w9x9). - Checkout no longer persists credentials.
- Dependabot keeps action pins current.
Built by dotdev.dev
v0.7.0
Fixed
- A subagent's
asknow reaches you. A subagent cannot answer a prompt, and Claude Code shows none for a background agent, so these asks used to hang or be denied later. They are now blocked at once with the command, its directory and an instruction to end the report with aNEEDS APPROVAL:line. - The parent session asks for you. A new
approvalhook (UserPromptSubmit) reads the report a background agent or dynamic workflow sends back, and tells the parent to run each quoted command. The guard's own prompt for that exact command is the single approval step. The hook fails open, takes about 20 ms and loads no rules. Rundamage-control-dev initagain to register it. Seedocs/subagent-approvals.md. - Audit rows name the real agent.
agent_idcomes from the hook payload (theagent_envvariable is the fallback, thenmain), and rows gain anagent_typefield. Before, every subagent call was logged asmain. - No more false "variable filled by read" asks. An assignment from a substitution (
c=$(curl ...)) was resolved to its first word and spliced intobash -cpayloads, so ordinary read loops asked. They are allowed again.
Notes
- The hand-back hook acts only on a
<task-notification>prompt. A prompt you type is never touched. - Known gap: a stricter subagent handing an ask to a parent in
bypassPermissionscan have that ask lifted by the parent's bypass. Documented indocs/subagent-approvals.md.
Feedback and reports welcome: https://github.com/dotdevdotdev/damage-control-dev/issues
v0.6.1
Fixed
- Respelled operands are judged as the paths the shell resolves. These spellings were judged more leniently than the plain form and are now blocked like it:
mvandtouchof a protected path written with a brace group (mv {~/.claude,x} /tmp,touch ~/.claude/{settings.json,zz}), including$HOMEforms.- A relative operand after
cd(cd .claude && touch settings.json,cd .. && touch .claude/settings.json). - Quote-split verbs and paths (
m""v,c""d), and letter case on case-insensitive filesystems.
- Path folding no longer drops the slash a brace group or quote continues, so the expansion names the right path.
- Similarly named paths outside the protected tree stay allowed (controls in the corpus).
Corpus
41 new rows; corpus run replays 325 cases. corpus fuzz is clean on Python 3.9 and 3.12 over the whole respelling space.
Out of scope (stated in docs/threat-model.md)
A cd whose target is a variable, cd - and popd, and a brace expansion past the cap. A control-plane file name after such a cd still asks.
Feedback and reports welcome: https://github.com/dotdevdotdev/damage-control-dev/issues
0.6.0
What's new
- Optional
agentwirepack: the protections written for the AgentWire orchestrator (its config, secrets, session and control-plane files, its teardown and outbound-send tools, and its unattended-session handling) now ship as an opt-in pack, off until a human runsdamage-control-dev packs enable agentwire. Seedocs/agentwire-pack.md. - Pack profile fragments: a pack's rules file may carry a
profile:section that is merged into the host profile only while the pack is on (additive, allow-listed fields, bundled files only). - Corpus: rows can name the packs and environment they run under; 71 new rows cover the pack with it on and off.
corpus runreplays 284 cases.
Changed
- The engine core no longer names any orchestrator. The unattended marker and grant variables are configuration: a plain install uses
DAMAGE_CONTROL_UNATTENDEDandDAMAGE_CONTROL_UNATTENDED_ALLOW, and a pack or host profile declares others. A test keeps the core free of orchestrator names. - Two generic tmux rule ids were renamed:
agentwire.tmux-kill-server-…is nowtmux.kill-server-destroys-all-tmux-sessions, andagentwire.tmux-kill-session-a-…is nowtmux.kill-session-a-kills-all-except-current. If you named the old ids indisabled_rules, update them. - The hook loads the effective configuration before reading the payload, so a pack's unattended marker is in force when the payload is parsed.
Upgrading
If you run AgentWire with this library, enable the pack after upgrading (damage-control-dev packs enable agentwire, human-only). Until you do, the engine does not recognise the AgentWire unattended marker and does not protect AgentWire's own files.
Looking ahead
Closing the respelling gaps the fuzzer found around moves, touches and relative paths.
Feedback and reports welcome: https://github.com/dotdevdotdev/damage-control-dev/issues
0.5.1
Fixed
- Break-glass now removes every hook entry the engine registers. The 0.5.0 script cleared only the
PreToolUseentries, so theConfigChangeentry stayed registered after the escape was used. "Ours" is now one definition (a hook that runs the engine module, under any event) shared byinstall,uninstall,statusand break-glass, so a future hook event cannot be forgotten. Break-glass stays standard-library only and still runs with a dead engine.
Looking ahead
More of the 0.5.0 hook work verified against live Claude Code runs.
Feedback and reports welcome: https://github.com/dotdevdotdev/damage-control-dev/issues
0.5.0
What's new
ConfigChangeguard: a new hook that refuses a settings change which would switch damage control off or redirect it (disableAllHooks, anenvthat moves the hooks' policy, or our own registration removed or rewritten). Managed-policy changes are audited as observed.- Settings writes, at the tool call: a
WriteorEditthat setsdisableAllHooksor drops the registration is blocked; other changes to thehookskey, and shell writes to project or local settings, ask. - Nested
clauderuns: command lines that startclaudewithout hooks (--safe-mode,--bare,--settingscarryingdisableAllHooks,--setting-sourceswithout the user scope) are blocked; ones that only redirect config ask (--plugin-dir,--settings <file>,CLAUDE_CONFIG_DIR). - Tool coverage:
MonitorandLSPare judged; every other Claude Code tool has a recorded decision, held to the registration list by a test. - Hooks research report (
docs/hooks-research.md): all 33 hook events, the handler types and their failure behaviour, every place hooks are registered, and observed payloads.
Improved
- A
Monitorcall is judged once, and written to the audit log once, on Claude Code versions that also route it throughBash. - The coverage docs agree with the observed payloads (
Agenttool name,agent_id). - The corpus now replays 213 cases.
Looking ahead
Mentions of files in prompts, and the events the report could not observe.
Feedback and reports welcome: https://github.com/dotdevdotdev/damage-control-dev/issues
0.4.1
Improved
Operations that discard uncommitted work are now judged by what they do, not how they are spelled:
git reset --hardis recognised through option abbreviations and-caliases.git switch -f/--discard-changes, whole-treegit restore(.,*,:/) in any form, andgit worktree remove --forceask for confirmation, likegit checkout -f.- Reset, clean, switch, restore, checkout and worktree-remove assembled through
xargsorparallelask. git cleandry runs are recognised under any--dry-runabbreviation.- 29 new conformance rows cover both sides (blocks and allows);
corpus runreplays 159 cases.
Thanks to a reader for the report.
Looking ahead
More operations judged by effect, with the corpus as the record.
Feedback and reports welcome: https://github.com/dotdevdotdev/damage-control-dev/issues
0.4.0
What's new
damage-control-dev explain: shows how a shell command was judged, step by step, using the same policy path as the hook.corpus fuzz: differential respelling over the conformance corpus, to find commands judged differently when respelled.
Improved
- Commands whose verb expands to empty are judged as typed.
- Data files named after flags that run no program are no longer read as scripts.
- Text that is printed, sent or written is not treated as a path operand.
- Scripts run through a split interpreter name, and path variables built from other variables, are now followed.
- Dot segments and repeated slashes are folded after quotes are removed; braced variables work in brace groups.
- Option grammar of interpreters and launchers is read when finding the script a command runs.
Looking ahead
More respelling classes covered by the corpus and fuzzer, and clearer explain output.
Feedback and reports welcome: https://github.com/dotdevdotdev/damage-control-dev/issues
v0.3.0
Security fixes
- Protected paths are matched after
.and..segments are normalized, so those spellings get the same verdict as the plain path. - A word separator written as a variable is judged as the separator it expands to.
- Text decoded with hex, octal,
revortrand piped to an interpreter asks, like base64 already did. A verb taken from an unset variable is judged and asks.
New
- Task-runner recipes are read like scripts:
make,npm/pnpm/yarn/bun run,just. - A public conformance corpus (85 rows in 8 classes),
damage-control-dev corpus run, and a generated page in the docs. Submit a miss as a corpus row. - Sandbox pairing: a docs page, a settings snippet, and a doctor check that reports whether Claude Code's sandbox is on and its unsandboxed retry is closed.
Feedback and missed cases welcome in issues.