Repository navigation
Replies: 1 comment
|
Hi cy123k, Was that Remove-Item on your home folder the first sign anything had gone wrong? I hit the same kind of problem where an agent kept running a command it had been allowed once. If that is what happened on your end, would you want to see something combining memory, authority, and security so every command gets checked before it runs and a recursive delete outside the project needs its own one-use permit? Once your profile is back in shape, it takes one line to try: Sam |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Summary
On October 18, 2026, while using DeepSeek Harness (DSH) on Windows to investigate a GitHub Actions CI failure, the agent executed a PowerShell command that recursively deleted files inside my Windows user profile directory.
The affected directory was:
C:\Users\<username>The command was unrelated to the user's requested task. The agent was supposed to investigate a failed npm workspace dependency installation in CI.
The consequences were severe:
AppData,Desktop, and other personal directories were affected.This appears closely related to previously reported incidents involving the PowerShell
$home/$HOMEvariable collision.1. Context: What the agent was supposed to do
The agent was investigating the following GitHub Actions CI failure:
The subsequent CI summary step also failed:
The requested work was to identify and resolve this dependency installation failure.
There was no request or authorization to delete, reset, or recreate the Windows user profile.
2. Observed destructive PowerShell command
The retained DSH subprocess stderr log repeatedly references this command fragment:
Historical evidence — DO NOT EXECUTE:
The actual target was the Windows user profile directory, not an isolated CI or npm test directory.
Representative errors from the execution log included:
These errors confirm that the deletion operation reached the real Windows user profile.
The subprocess returned
EXIT=1, but this did not roll back any files that had already been successfully deleted.3. Subsequent npm failure
The same subprocess log also contains:
This error appeared during the CI troubleshooting workflow.
It is included as execution context, not as evidence that npm itself caused the deletion.
The dangerous operation was the earlier PowerShell recursive deletion targeting the user profile.
4. Suspected root cause
The incident appears consistent with a PowerShell automatic-variable collision:
$homeand$HOMEtherefore refer to the same variable.$HOMEis a built-in read-only variable representing the current user's home directory.$home, that assignment could fail without terminating the script.Remove-Item $home -Recurse -Forcecould then operate on the actual user home directory.This mechanism has already been described in other DSH incident reports.
Important qualification: The retained stderr output confirms the destructive command fragment and actual deletion target. However, the complete original command, including any preceding assignment to
$home, is not available in the extracted log. Therefore, the variable-collision mechanism is highly plausible but not yet conclusively demonstrated for this specific incident.I would appreciate help examining the original tool-call history to confirm the exact sequence.
5. Actual behavior vs. expected behavior
Actual behavior
While debugging an npm workspace installation issue, the agent attempted a recursive deletion of the real Windows user profile. The operation partially succeeded and left the user environment severely damaged.
Expected behavior
6. Requested fixes
I would strongly recommend the following safety improvements:
P0 — Deterministic protection for destructive commands
Reject recursive deletion targeting:
The check should resolve the actual target path before execution rather than relying only on command text.
P0 — PowerShell automatic-variable collision detection
Detect dangerous use of reserved variables such as
$homewhen they are used as writable temporary path variables, especially when followed by recursive deletion.P1 — Workspace-bound execution and cleanup
Restrict destructive file operations to explicitly authorized workspace or temporary directories, with strong protection against path traversal, junctions, and symbolic links.
P1 — Fail-safe command execution
A failed path initialization must not be followed by a destructive cleanup command using a stale or unintended value.
P1 — Clear reporting after destructive command failures
If a command unexpectedly targets a protected path or partially deletes files, the harness should stop the operation and clearly notify the user.
7. Related reports
These reports indicate that similar incidents have occurred before.
My case adds an independent incident involving CI troubleshooting, a retained PowerShell stderr log, confirmed access to the real user profile, and subsequent Windows login failure.
8. Environment and evidence
C:\Users\<username>All reactions