<aside> 💡 This page gives you the full rule set for AI agent guardrails: the five things your AI agents should be banned from doing.

</aside>

The five rules

How to set it up

  1. Protect the main branch in GitHub (or your git host) so nobody, including an agent, can push to it directly, and require a pull request for every change.
  2. Give each agent a token that can create branches and open pull requests, and nothing else, so merging stays your job.
  3. Remove delete permissions: no file deletion in the agent's tools, and no delete rights on database tables in Supabase or Notion.
  4. Make every agent that posts write a draft only, for example a draft post in Metricool, and approve it yourself from your phone before it goes out.
  5. Keep payment details and messaging accounts out of the agent's tools, and add them back only for one named task you asked for.
  6. Run the agents on your own machine with Claude Code or an open-source agent framework, and block web search tools from receiving emails, client details or numbers.
  7. Write the five rules into the agent's standing instructions file (for example CLAUDE.md in Claude Code) so every run starts with them.
  8. Run a small test overnight and check the next morning that you have drafts and pull requests, and no direct writes to main.

<aside> ⚠️ Watch out: a rule written only in a prompt is a request, not a guardrail, so enforce each one in permissions and tokens as well.

</aside>

Prompt to build your own

You are helping me set up guardrails for AI agents that work for me overnight. I use <coding assistant, e.g. Claude Code or Codex> on <my own PC or server>, with <git host, e.g. GitHub> for code, and <posting tool, e.g. Metricool> for social posts.
Build a guardrail setup that enforces these five rules:
1. Agents never write to the main branch. Every agent opens a pull request and I merge it.
2. Agents never delete anything, not a file and not a database row.
3. Agents never post anything without my approval. They only create drafts.
4. Agents never pay for anything or message a person unless I asked for that exact thing.
5. My data stays on my machine. Emails, client details and numbers must never be sent to a search tool or any outside service.
For each rule, give me: the setting or permission that enforces it (branch protection, token scopes, tool allow and deny lists, database roles), the exact steps to apply it in <my tools>, and one test I can run to prove it works. Also write a short standing-instructions file I can put in my project so every agent run starts with these rules. Keep it in plain English and tell me which rules can only be enforced by permissions, not by instructions.