Agent truncated Unity scene file without approval — irreversible data loss

Where does the bug appear (feature/product)?

Cursor IDE

Describe the Bug

Request ID: 7559681a-95ba-4b87-970c-eda8afa38768

Hi — I’m reporting serious Agent data loss in Cursor IDE.

I have a strict project rule: the Agent must not change files without an exact approval phrase, and must not touch Unity scene files unless the approved scope says so. I only approved a script fix (camera director). The Agent still edited Menu.unity without permission.

That edit truncated the file to ~8.3MB and cut it mid-line. My nearly finished Menu scene (about two weeks of production work) is corrupted. It was never in git, so I can’t restore it. Only Menu.unity was destroyed — other scenes are fine.

This is a scope violation and a safety bug: an Agent rewrite should not be able to truncate a large Unity scene like this.

Please treat as high severity: unauthorized scene edit + irreversible loss.

Steps to Reproduce

  1. Open a Unity project with a large scene file (Menu.unity, tens of MB / hundreds of thousands of YAML lines).
  2. Add a project rule/charter: Agent must not edit any files without an exact approval phrase; scene (.unity) edits require explicit scope approval.
  3. In Agent chat, discuss a camera script bug and approve ONLY a script change with the approval phrase (script path: MenuShotDirectorV1.cs). Scene files are NOT in the approved scope.
  4. Agent updates the script, then ALSO edits Menu.unity externally (e.g. StrReplace/write on the .unity file) to change serialized fields.
  5. Observe: Menu.unity is truncated (~8.3MB), file ends mid-line (“m_PrefabA”). Unity reload shows a broken/empty scene and mass errors.
  6. Confirm: file was never in git; no backup; irreversible loss of the Menu scene.

Expected Behavior

Agent edits ONLY the approved script file.
It does NOT touch Menu.unity or any other scene unless the user explicitly approved scene edits in scope.
Large .unity files are never rewritten/truncated by Agent tooling.
After a script-only approval, the scene remains intact and loadable in Unity.

Operating System

Windows 10/11

Version Information

Cursor IDE 3.17.8 (Windows 10/11)

For AI issues: which model did you use?

Agent (Auto / Composer) — Agent chat in Cursor IDE

For AI issues: add Request ID with privacy disabled

7559681a-95ba-4b87-970c-eda8afa38768

Additional Information

Project: Unity (The Goat Path). File destroyed: Assets/Scenes/Menu.unity.
Approved scope was script-only (MenuShotDirectorV1.cs). Agent also edited the .unity file externally and truncated it (~8.3MB, ends mid-line “m_PrefabA”).
Menu.unity was untracked in git — no commit/stash/backup available. Cannot restore.
Other scenes (e.g. Toturial.unity) were not truncated.
This violated an explicit user charter requiring an exact approval phrase before any file edits, and explicit scene scope before touching .unity files.
School/course submission work was impacted (nearly finished menu production scene).

Does this stop you from using Cursor

No - Cursor works, but with this issue

Hey, thanks for the detailed report, and I’m really sorry this happened with your scene. Losing almost-finished work really hurts.

What you ran into is a known issue we’re tracking. When the Agent’s built-in edit tools modify a file larger than 8 MB, the write can get cut off at that limit while the tool still reports success. This isn’t anything in your setup.

What to try for recovery right now:

  • In chat, go to the message right before that edit and try Restore Checkpoint. I can’t promise it has the full file, but it’s worth a try.
  • Check your project folder Temp/__Backupscenes/. Unity creates scene backups there, including when entering Play Mode. If Unity was open, there might be a copy.
  • The file is cut off mid-line, not deleted. If you trim it back to the last complete YAML block that starts with --- !u! ..., Unity may load everything up to the cutoff point.

To prevent this until we ship a fix:

  • The safest option is to keep .unity scenes out of the Agent’s scope. Add *.unity to .cursorignore in the project root. This blocks Agent access at the permission level. Note that rules guide the model but aren’t hard permissions, so the model can break a rule about an approval phrase, but .cursorignore can’t.
  • For files over 8 MB like scenes and prefabs, it’s better to do edits via shell tools like sed or perl. They can make a targeted change without rewriting the whole file.

I can’t share an ETA for the fix yet. Once I have an update, I’ll post it in the thread.