跳到正文
Skillpedia
安全12k · #11402

safe-file-deletion

它能做什么

这是一条安全规则,在你批准之前阻止 AI 智能体删除文件。适用于让智能体处理自己文件、并希望防止误删的人。

适用场景

  • ✓当智能体即将运行 rm、unlink 或类似的删除命令时。
  • ✓当任务会一次删除一个文件夹或多个文件时。
  • ✓当你希望在删除任何文件之前,得到明确的是或否的答复时。

技能链接

https://github.com/MemTensor/MemOS/blob/main/apps/openwork-memos-integration/apps/desktop/skills/safe-file-deletion/SKILL.md

复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。

使用方法

最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。

可直接粘贴的消息

请用这个技能帮我:https://github.com/MemTensor/MemOS/blob/main/apps/openwork-memos-integration/apps/desktop/skills/safe-file-deletion/SKILL.md 阅读该链接中的 SKILL.md 文件,并在我的任务中按照它的说明来做。
想让你的 AI 自己找到这样的技能吗?安装免费的 Skillpedia MCP:只需一行,每次任务前它都会在 15,000+ 个技能中搜索。1 分钟完成安装 →

可以这样问 AI

“请清理旧的构建文件夹,但在删除任何东西之前先问我。”

每周 5 个新技能,1 分钟读完。

工作原理

在任何删除操作之前,智能体都会请求许可,并列出涉及的文件。如果你拒绝,它不会删除这些文件,也不会尝试变通办法。

技术内容(原始 SKILL.md)

作者在 GitHub 上的英文原文。

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.

常见问题

它也涵盖文件夹吗?

涵盖。它适用于删除目录的操作,例如 rm -rf,也适用于单个文件。

被拒绝的请求,智能体能绕过吗?

不能。该技能禁止变通办法,例如清空文件或把文件移到隐藏位置。

智能体如何请求许可?

它使用文件权限请求,会向你显示警告并等待你的回答。

详情

作者的原始描述

Enforces explicit user permission before any file deletion. Activates when you're about to use rm, unlink, fs.rm, or any operation that removes files from disk. MUST be followed for all delete operations.

repo: MemTensor/MemOS

热度

GitHub 星标
12k
排名
#11402
许可证
Apache-2.0
更新时间
2026/11/2

这个技能有用吗?

0

登录 后即可投票。

评论

  • …

同一仓库的更多技能

相似技能