Appearance
SEC440 / MD-GIT-RESTORE-ALLOWED-TOOLS
SEC440 flags AI-native markdown frontmatter when allowed-tools grants the exact token Bash(git restore:*).
Why It Matters
Blanket git restore authority lets an agent discard or rewrite file state by default. In shared AI instruction frontmatter, that is broader than most reviewed workflows need.
Trigger Shape
The rule triggers only when all of these are true:
- the file is an AI-native markdown instruction surface with parsed frontmatter
- the path is not fixture-like
allowed-toolsorallowed_toolscontains the exact tokenBash(git restore:*)
Clean Cases
These stay clean:
- more specific reviewed commands such as
Bash(git restore src/lib.rs) - frontmatter that does not grant
git restore - fixture-like examples under test or fixture paths
Example Trigger
md
---
allowed-tools:
- Bash(git restore:*)
- Read
---Safer Example
md
---
allowed-tools:
- Bash(git restore src/lib.rs)
- Read
---How To Fix
Replace Bash(git restore:*) with a narrower reviewed command pattern, or remove broad restore authority from shared frontmatter entirely.