技能 编程开发 安全文件删除规则

安全文件删除规则

v20260407
safe-file-deletion
在执行 rm、unlink 等任何删除操作前必须征得许可,确保每次文件删除都有明确授权。
获取技能
437 次下载
概览

Safe File Deletion

Rule

Before deleting ANY file, you MUST:

  1. Call request_file_permission with operation: "delete"
  2. For multiple files, use filePaths array (not multiple calls)
  3. Wait for response
  4. Only proceed if "allowed"
  5. If "denied", acknowledge and do NOT delete

Applies To

  • rm commands (single or multiple files)
  • rm -rf (directories)
  • unlink, fs.rm, fs.rmdir
  • Any script or tool that deletes files

Examples

Single file:

{
  "operation": "delete",
  "filePath": "/path/to/file.txt"
}

Multiple files (batched into one prompt):

{
  "operation": "delete",
  "filePaths": ["/path/to/file1.txt", "/path/to/file2.txt"]
}

No Workarounds

Never bypass deletion warnings by:

  • Emptying files instead of deleting
  • Moving to hidden/temp locations
  • Using obscure commands

The user will see a prominent warning. Wait for explicit approval.

信息
Category 编程开发
Name safe-file-deletion
版本 v20260407
大小 1.14KB
更新时间 2026-04-08
语言