Introduction

In development with DeepSeek Harness (DSH), agents often need to invoke file system tools. Directly using commands such as del, rm, or Remove-Item can cause files to be permanently lost and be difficult to recover. Even secure erase tools such as sdelete or shred can easily cause irreversible damage. This plugin intercepts destructive commands, forces deletion operations to go through the system Recycle Bin, and pauses execution when disk space is insufficient.

Plugin Overview

This plugin is named dsh-plugin-recycle-bin, maintained by developer Xylocarpro, and classified under admin-security. It runs on the Windows platform and works by relying on the @deepseek-ai/* runtime provided by the DSH host. Its core value is providing agents with a fallback mechanism for “safe deletion.”

Core Features

  1. Force deletions through the Recycle Bin: Provides the file_trash tool, which calls the SendToRecycleBin method of Microsoft.VisualBasic to ensure files are moved to the Recycle Bin.
  2. Intercept disk deletion commands: Intercepts commands such as del, rm, Remove-Item, erase, rd, rmdir, deltree, find -delete, and unlink.
  3. Intercept secure erase commands: Intercepts commands such as sdelete, shred, srm, cipher /w, and wipe that attempt to permanently erase data.
  4. Prevent emptying the Recycle Bin: Prohibits commands that empty the Recycle Bin.
  5. Stop when capacity is insufficient: Checks remaining space before deletion and stops the operation to ask the user if it is below the threshold.
  6. View Recycle Bin status: Provides the trash_status tool to check Recycle Bin capacity and support status.
  7. Inject safety prompts: Injects a safety:recycle-bin section into the system prompt to guide the model to use the tools correctly.

Installation and Enablement

Use the DSH plugin manager to import the release package and enable the plugin in the configuration. Example configuration:

# cordis.patch.yml
- insert:
- id: recycle-bin
  name: 'dsh-plugin-recycle-bin'
  config:
    enabled: true
    blockDestructiveCommands: true
    forbidEmptyRecycleBin: true
    forbidWipe: true
    minFreeBytes: 104857600
    reserveBytes: 52428800

Typical Usage

The plugin mainly provides two tool interfaces:

  1. file_trash: Used to delete files or directories.
    file_trash(paths: ["C:\\Project\\draft.md", "C:\\Project\\old-temp"])
The return value may be `deleted`, `skipped`, `blockedFull`, or `message`.
  1. trash_status: Used to view the Recycle Bin status for a specified path.
    trash_status(path: "C:\\Project")

Applicable Scenarios and Considerations

Applicable scenario: Development on Windows environments that require strict control of agent file operation permissions to prevent accidental deletion or malicious data wiping.

Notes:
1. Platform limitation: Supports Windows only and depends on Microsoft.VisualBasic.
2. Environment dependency: Depends on the DSH host to resolve and provide the @deepseek-ai/* runtime.
3. Known boundaries: Persistent shell sessions, direct calls from PTC/run_code, and third-party tools may bypass interception.
4. License: MIT License.