Skip to content
Skillpedia
Security12k · #11402

safe-file-deletion

What it does

It is a safety rule that stops the AI agent from deleting files until you approve. It is for anyone who lets an agent work on their files and wants protection from accidental deletion.

When to use it

  • ✓When the agent is about to run rm, unlink, or a similar delete command.
  • ✓When a task would remove a folder or several files at once.
  • ✓When you want a clear yes or no before any file is removed.

Skill link

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

Copy it and paste it into your AI (Claude, ChatGPT or Cursor), asking it to follow the instructions.

How to use

The easiest way: copy the message and paste it into your AI. It reads the skill and follows the instructions.

Ready-to-paste message

Use this skill to help me: https://github.com/MemTensor/MemOS/blob/main/apps/openwork-memos-integration/apps/desktop/skills/safe-file-deletion/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
Want your AI to find skills like this on its own?Install the free Skillpedia MCP: one line, and it searches 15,000+ skills before each task.Install in 1 minute →

Example of what to ask your AI

“Clean up the old build folders, but ask me before you delete anything.”

5 new skills a week. 1 minute to read.

How it works

Before any delete, the agent asks for permission and lists the files involved. If you say no, it does not delete them, and it does not try a workaround.

Technical content (original SKILL.md)

Original text by the author, straight from 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.

FAQ

Does it cover folders too?

Yes. It applies to removing directories, such as rm -rf, as well as single files.

Can the agent work around a denied request?

No. The skill forbids workarounds such as emptying a file or moving it to a hidden location.

How does the agent ask for permission?

It uses a file permission request, which shows you a warning and waits for your answer.

Details

Original description by the author

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

Popularity

GitHub stars
12k
Ranking position
#11402
License
Apache-2.0
Updated
11/2/2026

Is this skill useful?

0

Sign in to vote.

Comments

  • …

More skills from this repository

Similar skills