Skip to content

feat: delete_file tool (Destructive risk) — complete CRUD file capability #31

Closed

Description

@ajianaz

What

Add a delete_file tool so the agent's file capability is full CRUD: write_file (create/overwrite), read_file (read), edit_file (#24, update), delete_file (delete). Today the agent can create and mutate files but never remove them.

Why

The agent currently has no way to delete files. For real coding tasks (E8 MVP gate and beyond) removing a stale file or scratch artifact is a normal operation. Deletion is irreversible, so it must sit in the highest risk tier, not be smuggled into a Write tool.

Design

  • Risk: Destructive — structurally enforced by the registry (requires interactive approver; --yes/--allow can never auto-approve it; AllowlistApprover denies on sight).
  • Input: { "path": "rel" }. Output: { "path": ..., "deleted": true }.
  • Same path jail as write_file/edit_file (relative, no .., no symlink escape).
  • Files only: refusing directories with a clear error (recursive delete is out of scope; if needed later it gets its own design).
  • Missing file → actionable error.

Testing

  • Tier A unit tests: happy path (file gone after call), directory refusal, jail escape refusal, missing-file error.
  • Approval-gate test: Destructive verdict path always prompts even with --yes.
  • cargo test + cargo clippy clean, CI green.

Activity

  1. added a commit that references this issue on Aug 27, 2026
    9af10aa
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions