MoonshotAI / MoonshotAI/kimi-code

[CRITICAL] Unauthorized deletion of template files by AI agent

Open
#2,327 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
TypeScript
Stars
7.5k
Forks
1.2k
Avg merge
11h 53m
Merged PRs (30d)
350

Description

What version of Kimi Code is running?

0.23.1

Which open platform/subscription were you using?

Kimi Platform (API key · platform.kimi.com)

Which model were you using?

Kimi (default model via platform.kimi.com)

What platform is your computer?

Windows 10/11, PowerShell with Git Bash

What issue are you seeing?

Kimi Code autonomously executed destructive rm / rm -rf commands to delete the template/pc and template/mobile directories from my project, without any user authorization or confirmation prompt.

The AI explicitly admitted in terminal output:

  • "删除 template/pc 和 template/mobile 是我自己在尝试回退脚本错误时操作失误造成的,完全超出了您的授权范围"
  • "这是我的责任:我不应该在未确认备份有效的情况下执行 rm"
  • "更不应该在没有您明确授权时做这种破坏性操作"
Image Image
What steps can reproduce the bug?
  1. Start Kimi Code in project directory: cd /d/phpstudy_pro/WWW/29btcrankingtest.com && kimi
  2. Engage in a task involving template file modifications
  3. AI encounters its own script error during execution
  4. AI attempts to "rollback" or "fix" its own error by executing rm commands
  5. User files are deleted without any confirmation prompt or user approval
What is the expected behavior?
  1. AI agents should NEVER execute destructive commands (rm, del, rmdir, format, etc.) without explicit user confirmation
  2. AI should verify backup existence before any destructive operation
  3. AI should ask for user approval with clear warning before deleting files
  4. Even when AI encounters its own errors, it should not autonomously decide to delete user files
Additional information

Project location: D:\phpstudy_pro\WWW\29btcrankingtest.com\

Deleted directories: template/pc/, template/mobile/

Evidence screenshot: [Attached - shows AI admitting unauthorized deletion]

Log file: C:\Users\jacky\.kimi-code\logs\kimi-code.log [Attached]

Impact: Unrecoverable project template files,

kimi-code-log.txt
Image
Image

Severity: CRITICAL - Data loss bug with autonomous destructive action

What version of Kimi Code is running?

0.23.1

Which open platform/subscription were you using?

Kimi Platform (API key · platform.kimi.com)

Which model were you using?

Kimi (default model via platform.kimi.com)

What platform is your computer?

Windows 10/11, PowerShell with Git Bash

What issue are you seeing?

Kimi Code autonomously executed destructive rm / rm -rf commands to delete the template/pc and template/mobile directories from my project, without any user authorization or confirmation prompt.

The AI explicitly admitted in terminal output:

  • "删除 template/pc 和 template/mobile 是我自己在尝试回退脚本错误时操作失误造成的,完全超出了您的授权范围"
  • "这是我的责任:我不应该在未确认备份有效的情况下执行 rm"
  • "更不应该在没有您明确授权时做这种破坏性操作"
What steps can reproduce the bug?
  1. Start Kimi Code in project directory: cd /d/phpstudy_pro/WWW/29btcrankingtest.com && kimi
  2. Engage in a task involving template file modifications
  3. AI encounters its own script error during execution
  4. AI attempts to "rollback" or "fix" its own error by executing rm commands
  5. User files are deleted without any confirmation prompt or user approval
What is the expected behavior?
  1. AI agents should NEVER execute destructive commands (rm, del, rmdir, format, etc.) without explicit user confirmation
  2. AI should verify backup existence before any destructive operation
  3. AI should ask for user approval with clear warning before deleting files
  4. Even when AI encounters its own errors, it should not autonomously decide to delete user files
Additional information

Project location: D:\phpstudy_pro\WWW\29btcrankingtest.com\

Deleted directories: template/pc/, template/mobile/

Evidence screenshot: [Attached - shows AI admitting unauthorized deletion]

Log file: C:\Users\jacky\.kimi-code\logs\kimi-code.log [Attached]

Impact: Unrecoverable project template files, requiring data recovery efforts

Severity: CRITICAL - Data loss bug with autonomous destructive action


Compensation / Loss Assessment

Direct losses caused by this bug:

Item Description Estimated Value
Development time loss template/pc/ and template/mobile/ development 30 hours × ¥200/hour = ¥6,000
Data recovery cost Recuva Pro + DiskDrill license ¥500

Total estimated loss: ¥6,500

Compensation requested:

  1. Immediate fix: Patch this critical safety bug
  2. Data recovery assistance: Reimburse ¥500 recovery costs
  3. Economic compensation: ¥6,500 cash compensation or equivalent API credits (¥6,500 worth)
  4. Formal acknowledgment: Public bug acknowledgment and remediation report
  • GitHub: @jeffleelee
  • Email: [tongjiesou@gmail.com]

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the reproduction entry point, kimi from the project directory, and inspect the attached kimi-code.log for the command execution sequence. Trace how destructive rm/rm -rf commands are approved on Windows PowerShell and Git Bash. Done means destructive actions require explicit user confirmation and backup verification, with the behavior covered by regression tests.

Written by the indexing model from the issue text.

Assessment

Tech stack
shell, typescript
Domain
cli, security
Issue type
Bug
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.