# security-guidance Pattern-matched security warnings for code the agent writes. When the agent calls `write_file`, `patch`, or `skill_manage` with content that matches a known-dangerous code pattern (eval, pickle.load, yaml.load, os.system, subprocess with `shell=True`, `dangerouslySetInnerHTML`, `verify=False`, ECB mode, GitHub Actions `${{ github.event.* }}` injection, `torch.load` without `weights_only=True`, ...), the plugin appends a warning to the tool's result. The file is still written; the model sees the warning in the next turn and can fix the code or briefly document why the construct is safe. This is layer 1 of Anthropic's `security-guidance` plugin design — a fast first-pass that runs locally with zero LLM tokens spent. Layers 2 and 3 (LLM diff review on turn end, agentic commit review) are not ported; the agent can already run those kinds of reviews on demand via `delegate_task`. ## Coverage (25 rules) The pattern set is forked verbatim from Anthropic's `claude-plugins-official` under Apache-2.0. Categories: | Category | Rules | |---|---| | Unsafe deserialization | `pickle.load`, `cPickle/cloudpickle/dill.load`, `marshal.loads`, `shelve.open`, `yaml.load`, `yaml.unsafe_load`, `torch.load` (without `weights_only=True`), `joblib.load`, `pandas.read_pickle`, `numpy.load(allow_pickle=True)` | | Command injection | `os.system`, `subprocess(..., shell=True)`, JS `child_process.exec`, Go `exec.Command("sh"...)` | | Code injection | `eval(`, JS `new Function(...)` | | XSS sinks | `.innerHTML =`, `.outerHTML =`, `.insertAdjacentHTML(`, `document.write`, React `dangerouslySetInnerHTML` | | Crypto footguns | AES ECB mode, Node `crypto.createCipher` (no IV), TLS verification disabled (`verify=False`, `rejectUnauthorized: false`, `InsecureSkipVerify: true`, ...) | | XXE | `xml.etree`, `minidom`, `xml.sax` without `defusedxml` | | Supply chain | `