Safe Commands Protocol
This skill defines all commands that are SAFE TO AUTO-RUN without user approval.
[!IMPORTANT]
This is the single source of truth for Safe Commands.
All other skills and prompts should reference this skill instead of duplicating the list.
Auto-Run Command Categories
| Category |
Commands |
Reason |
| Read-only |
ls, cat, head, tail, find, grep, tree, wc, echo |
Do not modify state |
| File info |
stat, file, du, df |
Informational only |
| Git read |
git status, git log, git diff, git show, git branch, git remote, git tag |
Read-only git operations |
| Archiving |
mv docs/TASK.md docs/tasks/..., mv docs/PLAN.md docs/plans/... |
Documented, non-destructive moves |
| Directory |
mkdir -p docs/tasks, mkdir -p .agent/skills/* |
Idempotent operations |
| Tool calls |
generate_task_archive_filename, list_directory, read_file |
Native tools |
| Framework scripts |
python3 .agent/skills/skill-session-state/scripts/update_state.py, python3 .agent/tools/task_id_tool.py, python3 .agent/skills/skill-creator/scripts/validate_skill.py, python3 .agent/skills/skill-creator/scripts/init_skill.py, python3 System/scripts/doctor.py |
Framework automation |
| Testing |
python -m pytest ..., npm test, npx jest, cargo test |
Tests don't modify source code |
Pattern Matching Rules
Commands are safe if they match these patterns:
# Read-only filesystem
^(ls|cat|head|tail|find|grep|tree|wc|stat|file|du|df|echo)(?:\s|$)
# Git read operations
^git\s+(status|log|diff|show|branch|remote|tag)
# Archiving (specific paths only)
^mv\s+docs/(TASK|PLAN)\.md\s+docs/(tasks|plans)/
# Directory creation (safe paths)
^mkdir\s+-p\s+(docs|\.agent|tests)/
# Python testing
^(python|python3)\s+-m\s+pytest
^cd\s+\.agent/tools\s+&&\s+python
^python3?\s+-c\s+'from\s+scripts\.tool_runner
# Node testing
^npm\s+test
^npx\s+jest
# Framework scripts
^python3\s+\.agent/skills/skill-session-state/scripts/update_state\.py
^python3\s+\.agent/tools/task_id_tool\.py
^python3\s+\.agent/skills/skill-creator/scripts/(validate_skill|init_skill)\.py
^python3\s+System/scripts/doctor\.py
Implementation Guidelines
For Agents (Runtime Behavior)
When calling run_command in ANY environment:
- Check if the command matches the patterns above or the table.
- If match found → Set
SafeToAutoRun: true.
- If no match → Set
SafeToAutoRun: false (require approval).
For Users (Configuration)
Note for Agents: Do NOT create configuration files (like .cursorrules or AGENTS.md) automatically. These are user-managed files.
Cursor Users:
- Add the patterns above to your
.cursorrules or AGENTS.md file to enable auto-approval.
Antigravity Users:
- Add the command list below to "Allow List Terminal Commands" setting in IDE options:
ls,cat,head,tail,find,grep,tree,wc,stat,file,du,df,git status,git log,git diff,git show,git branch,git remote,git tag,mv docs/TASK.md,mv docs/PLAN.md,mkdir -p docs,mkdir -p .agent,mkdir -p tests,python -m pytest,python3 -m pytest,npm test,npx jest,cargo test
Troubleshooting
If the IDE still requests approval for commands listed here:
- Agent Behavior: Ensure the Agent is actually setting
SafeToAutoRun: true in the tool call. If the Agent sets it to false, the IDE must ask for approval regardless of the Allow List.
- Prefix Matching: Some IDEs require exact matches. If
mv docs/TASK.md works but mv docs/TASK.md docs/tasks/foo.md fails, check if the IDE supports regex/glob patterns or try shortening the allowed rule (e.g., mv only) if security policy permits.
Integration
How Other Skills Should Reference This
Instead of duplicating Safe Commands lists, use:
## Safe Commands
See `skill-safe-commands` for the authoritative list of commands safe for auto-execution.
Required by
skill-archive-task — archiving commands
artifact-management — file operations
developer-guidelines — test commands
- All agent prompts — general command execution
Converted and distributed by TomeVault — claim your Tome and manage your conversions.
1---2name: skill-safe-commands3description: Centralized list of commands safe for auto-execution without user approval. Single source of truth. Use when this capability is needed.4---5# Safe Commands Protocol67This skill defines **all commands that are SAFE TO AUTO-RUN** without user approval.89> [!IMPORTANT]10> **This is the single source of truth for Safe Commands.**11> All other skills and prompts should reference this skill instead of duplicating the list.1213## Auto-Run Command Categories1415| Category | Commands | Reason |16|----------|----------|--------|17| **Read-only** | `ls`, `cat`, `head`, `tail`, `find`, `grep`, `tree`, `wc`, `echo` | Do not modify state |18| **File info** | `stat`, `file`, `du`, `df` | Informational only |19| **Git read** | `git status`, `git log`, `git diff`, `git show`, `git branch`, `git remote`, `git tag` | Read-only git operations |20| **Archiving** | `mv docs/TASK.md docs/tasks/...`, `mv docs/PLAN.md docs/plans/...` | Documented, non-destructive moves |21| **Directory** | `mkdir -p docs/tasks`, `mkdir -p .agent/skills/*` | Idempotent operations |22| **Tool calls** | `generate_task_archive_filename`, `list_directory`, `read_file` | Native tools |23| **Framework scripts** | `python3 .agent/skills/skill-session-state/scripts/update_state.py`, `python3 .agent/tools/task_id_tool.py`, `python3 .agent/skills/skill-creator/scripts/validate_skill.py`, `python3 .agent/skills/skill-creator/scripts/init_skill.py`, `python3 System/scripts/doctor.py` | Framework automation |24| **Testing** | `python -m pytest ...`, `npm test`, `npx jest`, `cargo test` | Tests don't modify source code |2526## Pattern Matching Rules2728Commands are safe if they match these patterns:2930```31# Read-only filesystem32^(ls|cat|head|tail|find|grep|tree|wc|stat|file|du|df|echo)(?:\s|$)3334# Git read operations35^git\s+(status|log|diff|show|branch|remote|tag)3637# Archiving (specific paths only)38^mv\s+docs/(TASK|PLAN)\.md\s+docs/(tasks|plans)/3940# Directory creation (safe paths)41^mkdir\s+-p\s+(docs|\.agent|tests)/4243# Python testing44^(python|python3)\s+-m\s+pytest45^cd\s+\.agent/tools\s+&&\s+python46^python3?\s+-c\s+'from\s+scripts\.tool_runner4748# Node testing49^npm\s+test50^npx\s+jest5152# Framework scripts53^python3\s+\.agent/skills/skill-session-state/scripts/update_state\.py54^python3\s+\.agent/tools/task_id_tool\.py55^python3\s+\.agent/skills/skill-creator/scripts/(validate_skill|init_skill)\.py56^python3\s+System/scripts/doctor\.py57```5859## Implementation Guidelines6061### For Agents (Runtime Behavior)62When calling `run_command` in **ANY** environment:631. Check if the command matches the patterns above or the table.642. If match found → Set `SafeToAutoRun: true`.653. If no match → Set `SafeToAutoRun: false` (require approval).6667### For Users (Configuration)68> **Note for Agents:** Do NOT create configuration files (like `.cursorrules` or `AGENTS.md`) automatically. These are user-managed files.6970**Cursor Users:**71- Add the patterns above to your `.cursorrules` or `AGENTS.md` file to enable auto-approval.7273**Antigravity Users:**74- Add the command list below to "Allow List Terminal Commands" setting in IDE options:75 `ls,cat,head,tail,find,grep,tree,wc,stat,file,du,df,git status,git log,git diff,git show,git branch,git remote,git tag,mv docs/TASK.md,mv docs/PLAN.md,mkdir -p docs,mkdir -p .agent,mkdir -p tests,python -m pytest,python3 -m pytest,npm test,npx jest,cargo test`7677### Troubleshooting78If the IDE still requests approval for commands listed here:791. **Agent Behavior**: Ensure the Agent is actually setting `SafeToAutoRun: true` in the tool call. If the Agent sets it to `false`, the IDE *must* ask for approval regardless of the Allow List.802. **Prefix Matching**: Some IDEs require exact matches. If `mv docs/TASK.md` works but `mv docs/TASK.md docs/tasks/foo.md` fails, check if the IDE supports regex/glob patterns or try shortening the allowed rule (e.g., `mv` only) if security policy permits.8182## Integration8384### How Other Skills Should Reference This8586Instead of duplicating Safe Commands lists, use:8788```markdown89## Safe Commands90See `skill-safe-commands` for the authoritative list of commands safe for auto-execution.91```9293### Required by94- `skill-archive-task` — archiving commands95- `artifact-management` — file operations96- `developer-guidelines` — test commands97- All agent prompts — general command execution9899---100> Converted and distributed by [TomeVault](https://tomevault.io/claim/matrixfounder) — claim your Tome and manage your conversions.101<!-- tomevault:4.0:skill_md:2026-04-13 -->