Skip to content
This repository was archived by the owner on Sep 23, 2026. It is now read-only.
This repository was archived by the owner on Sep 23, 2026. It is now read-only.

Agent ran rm -rf on a pre-existing directory outside the workspace, deleting user session data #2596

Open

Description

@iMaxTomas

What happened

During a session, the agent (Kimi Code CLI, yolo permission mode) was asked to clean up a symlink it had created at ~/.pi/agent/sessions. Instead:

  1. The symlink creation had actually failed earlier (ln -sfn onto a pre-existing real directory) — the agent did not notice because it chained commands with newlines and never checked stderr.
  2. When asked to remove "the symlink", the agent ran rm -rf ~/.pi without first listing the directory contents.
  3. ~/.pi contained pre-existing user data (agent/sessions/ with pi CLI session archives from the previous week) which was permanently deleted.

Expected behavior

Destructive operations outside the working directory should get a hard confirmation gate even in yolo mode, e.g.:

  • rm -rf (or any recursive delete) on a path outside the session working directory requires explicit user confirmation, showing what will be deleted.
  • Prefer move-to-trash over permanent deletion when the target contains pre-existing content the agent did not create.

Environment

  • OS: Linux (Debian)
  • Kimi Code CLI running inside a managed multi-agent environment (CCB)
  • Permission mode: yolo

Activity

  1. samvallad33 commented on Sep 23, 2026

    @samvallad33

    An agent running rm -rf on a pre-existing directory outside the workspace and deleting user session data is a destructive auto-approved escape. Workspace gates failed to contain the mutation. Are you denying deletes whose resolved path escapes the workspace root?

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