DEDUPED Hot AI repos. Real use cases. What people build. Get the Monday 5

How to lock files so a coding agent cannot delete or edit them with Agent Security

Put an OS-level lock on key files and start the agent inside that protection so it cannot remove them.

Short answer: Complete the guard install from the repo README with ./scripts/shell/install.sh and open a new terminal; then solongate protect ~/game/game.c; solongate protect list. All steps.

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

  1. Complete the guard install from the repo README with ./scripts/shell/install.sh and open a new terminal.
  2. solongate protect ~/game/game.c
  3. solongate protect list
  4. solongate run -- claude
  5. 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

Cursor, ChatGPT, others

Share: X LinkedIn Hacker News Email Copy link

Third-party repos we don't own. AI-written use cases can be wrong. Disclaimer