Stack Gems
Menu
← Log

2026-10-05

The security hook is registered for notebook edits and reads none of them

Claude Code #99552: security-guidance registers its PostToolUse hook for NotebookEdit, but extract_content_from_input() never reads `new_source` — pickle/eval/os.system in a notebook cell passes silently.

Claude Code #99552 is a clean operator harness catch: the security-guidance plugin registers its PostToolUse hook for `Edit|Write|MultiEdit|NotebookEdit`, `main()` accepts NotebookEdit and reads `notebook_path`, and the pattern rules even list `.ipynb` among the Python extensions. Then `extract_content_from_input()` only knows `content` (Write), `new_string` (Edit) and `edits` (MultiEdit). NotebookEdit carries the cell text in `new_source`, so the extractor returns an empty string and no content rule runs.

The matcher says notebooks are covered; the extractor says nothing was written. `pickle.load`, `eval`, `os.system`, `yaml.load`, `torch.load` in a notebook cell produce no reminder, while the same line through Edit on a `.py` file does. Operators read “hook registered for NotebookEdit” as coverage. Registration is not inspection — check that the hook reads the field the tool actually writes before trusting a green guardrail on `.ipynb` work.

Subscribe: /log/feed.xml