MoonshotAI / MoonshotAI/kimi-code
[CRITICAL] Unauthorized deletion of template files by AI agent
Nobody has claimed this yet.
- 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"
- "更不应该在没有您明确授权时做这种破坏性操作"
What steps can reproduce the bug?
- Start Kimi Code in project directory:
cd /d/phpstudy_pro/WWW/29btcrankingtest.com && kimi - Engage in a task involving template file modifications
- AI encounters its own script error during execution
- AI attempts to "rollback" or "fix" its own error by executing
rmcommands - User files are deleted without any confirmation prompt or user approval
What is the expected behavior?
- AI agents should NEVER execute destructive commands (
rm,del,rmdir,format, etc.) without explicit user confirmation - AI should verify backup existence before any destructive operation
- AI should ask for user approval with clear warning before deleting files
- 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,
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?
- Start Kimi Code in project directory:
cd /d/phpstudy_pro/WWW/29btcrankingtest.com && kimi - Engage in a task involving template file modifications
- AI encounters its own script error during execution
- AI attempts to "rollback" or "fix" its own error by executing
rmcommands - User files are deleted without any confirmation prompt or user approval
What is the expected behavior?
- AI agents should NEVER execute destructive commands (
rm,del,rmdir,format, etc.) without explicit user confirmation - AI should verify backup existence before any destructive operation
- AI should ask for user approval with clear warning before deleting files
- 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:
- Immediate fix: Patch this critical safety bug
- Data recovery assistance: Reimburse ¥500 recovery costs
- Economic compensation: ¥6,500 cash compensation or equivalent API credits (¥6,500 worth)
- Formal acknowledgment: Public bug acknowledgment and remediation report
- GitHub: @jeffleelee
- Email: [tongjiesou@gmail.com]
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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