How boxdawn/guard works
Boxdawn guard is a pre-tool security plugin for Claude Code, with a Copilot CLI hook variant. Its main workflow receives a shell command, evaluates Bash or PowerShell against destructive-command and secret-file rules, then denies, asks for approval, or makes no decision. It also protects secret searches, supports signed rule bundles and optional undo snapshots, and can record and upload anonymized block events. The hook and evaluator relationships are supported by the excerpts and SOURCE INDEX; several secondary subsystem links are documented in the README rather than sampled implementation.
Main entry points: command_hook.py Pre-tool hook · guard_entry.py Hook dispatcher · command_guard.py Bash evaluator · block_send.py Block uploader
Components 17
Hook entrypoints
- Pre-tool hook
boxdawn_guard/command_hook.py - Copilot hook
boxdawn_guard/copilot_hook.py - Hook dispatcher
packaging/guard_entry.py
Command judging
- Bash evaluator
boxdawn_guard/command_guard.py - PowerShell evaluator
boxdawn_guard/powershell_guard.py - Decision response
boxdawn_guard/command_hook.py
Rules and secrets
- Fixed command rules
boxdawn_guard/command_rules_source.py - Secret-file rules
boxdawn_guard/secret_files.py - Signed rule bundles
boxdawn_guard/rules_bundle.py - Korean messages
boxdawn_guard/messages_ko.py
Session safeguards
- Secret-safe Grep
boxdawn_guard/command_hook.py - Undo snapshots
boxdawn_guard/undo.py
Block records
- Block log
boxdawn_guard/block_log.py - Block uploader
boxdawn_guard/block_send.py
Other components
- Claude Code
- Copilot CLI
- Boxdawn service
Connections 20
- Claude Code → Pre-tool hook: invokes hook
README.md - Copilot CLI → Copilot hook: invokes hook
README.md - Hook dispatcher → Pre-tool hook: dispatches to
packaging/guard_entry.py - Hook dispatcher → Copilot hook: dispatches to
packaging/guard_entry.py - Pre-tool hook → Bash evaluator: evaluates Bash
boxdawn_guard/command_hook.py - Pre-tool hook → PowerShell evaluator: evaluates PowerShell
boxdawn_guard/command_hook.py - Pre-tool hook → Decision response: emits decision
boxdawn_guard/command_hook.py - Bash evaluator → Fixed command rules: uses rules
README.md - Bash evaluator → Secret-file rules: checks names
boxdawn_guard/command_guard.py - PowerShell evaluator → Secret-file rules: checks names
boxdawn_guard/powershell_guard.py - Pre-tool hook → Signed rule bundles: loads rules
boxdawn_guard/command_hook.py - Signed rule bundles → Fixed command rules: falls back to
boxdawn_guard/rules_bundle.py - Pre-tool hook → Korean messages: translates reasons
boxdawn_guard/command_hook.py - Pre-tool hook → Secret-safe Grep: filters searches
boxdawn_guard/command_hook.py - Secret-safe Grep → Secret-file rules: adds exclusions
boxdawn_guard/command_hook.py - Pre-tool hook → Undo snapshots: supports undo
boxdawn_guard/command_hook.py - Pre-tool hook → Block log: records verdicts
boxdawn_guard/command_hook.py - Block log → Block uploader: supplies records
boxdawn_guard/block_send.py - Hook dispatcher → Block uploader: starts upload
packaging/guard_entry.py - Block uploader → Boxdawn service: sends records
boxdawn_guard/block_send.py