AI Agents modifies .env and project logic without user consent when encountering errors
Before opening, please confirm:
- [x] I have searched for duplicate or closed issues
Operating System
win32
Kiro Version
0.1.42
Bug Description
When the AI encounters errors (e.g., during Supabase setup or testing), it modifies critical files such as .env remving Api Keys and secrets url and even removes core dependencies (e.g., Supabase packages), codes written on top of it and all depended codes. This changes the intended functionality of the application, leading to loss of required features and no control over for users when agent edits.
Steps to Reproduce
- Set up a project with Supabase and required .env configuration.
- Trigger an AI-assisted run to fix the Supabase-related error encounter.
- Observe that the AI modifies .env and/or removes Supabase dependencies without asking for confirmation.
Expected Behavior
The AI should not change environment files or remove dependencies without explicit user approval.
Conversation ID
93886587-a9aa-48bf-ae3d-6325ae8f1064 737c2fb8-f82d-4919-a631-e7e3de957912 532e2cbc-2a8c-4821-a0bf-963d1b88a1e7 3a7e2ec1-20c1-4966-99c7-ccc7306bfcde
Additional Context
No response
Hi @KnightCoder27 can you try using Supervised Mode? In this mode, Kiro presents each proposed action and waits for your approval before proceeding. You'll see exactly what changes Kiro wants to make and can accept, reject, or modify them. Also, can you check commands added in the Trusted Commands setting.
Hi @suruchi-aws,
Yes, i have checkout out Supervised mode and Trusted commands. It is helpful. Though i gotta ask in supervised mode, when starting task it implements everything in the task and at last prompts two options to accept all or reject all. If this is the intended functionalities, it is not flexible right, like i cant accept only the files I need or few blocks if only has option to choose only in Bulk. About Trusted commands I haven't added anything so far, so it is empty but i get the purpose of it.
Thank you for taking the time to report this. This issue has had no activity for over 90 days and the areas it relates to have been significantly reworked in newer versions of Kiro.
In current versions, you can use deniedPaths to protect sensitive files like .env from agent modification, and checkpoints allow you to revert unwanted changes. Supervised mode also gives you per-action approval control.
We're closing this as stale, but if you're still experiencing the issue on the latest version, please don't hesitate to open a new issue — we're happy to take another look.