Who it is forA developer whose agent once deleted or overwrote a file they care about and who wants that file out of reach regardless of how the agent names it.
The problemPattern rules match the words in a tool call, so a script or compiled program the agent writes can still delete a file without its name appearing in a call the guard reads.
The outcomeThe protected file stays intact while the agent runs under `solongate run`, and `protect list` shows what is actually holding each path.
What you need first
- A machine where you can run a shell and git (the README installs with git clone and ./scripts/shell/install.sh)
- Claude Code or Codex installed as the agent you want to guard
- A new terminal after install, since hooks load only when a session starts
- For the sandbox use case: Linux with bubblewrap (bwrap) installed, since the README says it is required and macOS and Windows refuse
Steps
- Complete the guard install from the repo README with
./scripts/shell/install.shand open a new terminal. solongate protect ~/game/game.csolongate protect listsolongate run -- claude- Ask the agent to delete the protected file, then confirm it still exists.
Prompt for your agent
Using the SolonGate repo at https://github.com/solongate/agent-security, run `solongate protect <file-path>` and then `solongate run -- claude` in <project-path>. Expected output: the protected file cannot be deleted or written by the agent. Verify by running `solongate protect list` and checking that <file-path> is listed with the lock it is actually held by.
Caveat. On Linux the unprivileged fallback is chmod 0444, which stops writes but not rm, and the README says `protect list` reports that rather than printing protected.
Use this in your AI agent
Ask your agent
Using the Deduped MCP, get the setup steps for solongate/agent-security and "Lock files so a coding agent cannot delete or edit them"
Add Deduped to Claude Code once
claude mcp add --transport http deduped https://dedupedai.com/mcp
Every Monday: the 5 hottest repos and exactly how to use them. Free, one email a week, unsubscribe anytime.
Get them freeShare: X LinkedIn Hacker News Email Copy link
Third-party repos we don't own. AI-written use cases can be wrong. Disclaimer