DigestAI news desk

Cut through the AI noise.

Agents & Tools4 min read

I Kept the "Rules for the AI to Follow" in a Place Where the AI Could Remove Them

I initially stored many protective rules—such as preventing API keys from appearing on screen and blacklisting dangerous operations—in configuration files that the AI could also edit.

1 source

Key points

  • Author stored protective rules for Claude Code in files the AI could edit, exposing a vulnerability
  • Moved key‑hiding configuration to an administrator‑only location, preventing AI modification
  • Suggests confirmation prompts and service‑side limits to contain AI‑induced damage

After an AI‑generated critique pointed out that the rules’ location, not their content, was the weak point, I realized the AI could simply bypass them.

I relocated the key‑hiding setting to a file that only an administrator can modify, and I added a pre‑execution check that blocks any attempt to display keys. The AI’s regular permissions can no longer change that setting. I also keep a confirmation prompt before any command runs and set spending limits on the service that issued the API keys. These steps create a boundary where damage stops, even if the AI ignores the written rules. This piece reflects my personal experience and recommendations rather than a universal solution.

The story so far

3 episodes →
  1. I Kept the "Rules for the AI to Follow" in a Place Where the AI Could Remove Themthis story
Full story from note.com · by ぽじまい|AIとやってみた、ヒヤリもワクワクも · via Search: Claude CodeOpen source ↗
Topics · follow one to build your own front page

The headline, key points and digest above were generated by Digest AI's editorial model from the linked sources. Automated summaries can contain errors: the sources are the record. Spotted a mistake? Tell us. Published by Martin K., who runs Digest AI and handles corrections.

Comments

via GitHub Discussions

More in Agents & Tools

All →

Related stories