greywall
AGENTS.md306 starsChanged 8 months agoApache-2.0View on GitHub
Many popular coding agents already include sandboxing. Greywall can still be useful when you want a tool-agnostic policy layer that works the same way across: Treat an agent as "semi-trusted automation": Greywall can also reduce the risk of running agents with fewer interactive permission prompts (e.g. "skip permissions"), as long as your Greywall config tightly scopes writes and outbound destinations. It's defense-in-depth, not a substitute for the agent's own safeguards. We provide these template for guardrailing CLI coding agents: You…
Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about checking a change actually works.
Of the AGENTS.md files we read, the 11,736 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.
In this repositoryOne other file it gives its agents.
- CLAUDE.mdCLAUDE.md
The file
We split this agents.md into the rules it gives an agent
2 rules. About 0 are common, 1 is distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 17
Treat an agent as "semi-trusted automation":
- Very specific: line 21
Use -m (monitor mode) to audit blocked attempts and tighten policy
≈ “Common” is an estimate: at least 1 in 5 of the 16,597 AGENTS.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Using Greywall with AI Agents
Many popular coding agents already include sandboxing. Greywall can still be useful when you want a tool-agnostic policy layer that works the same way across:
- local developer machines
- CI jobs
- custom/internal agents or automation scripts
- different agent products (as defense-in-depth)
Recommended approach
Treat an agent as "semi-trusted automation":
- Restrict writes to the workspace (and maybe
/tmp) - Configure the external proxy to allow only the network destinations you need
- Use
-m(monitor mode) to audit blocked attempts and tighten policy
Greywall can also reduce the risk of running agents with fewer interactive permission prompts (e.g. "skip permissions"), as long as your Greywall config tightly scopes writes and outbound destinations. It's defense-in-depth, not a substitute for the agent's own safeguards.
Example: API-only agent
{
"filesystem": {
"allowWrite": ["."]
}
}Run:
greywall --settings ./greywall.json <agent-command>Popular CLI coding agents
We provide these template for guardrailing CLI coding agents:
code- Routes all network traffic through an external SOCKS5 proxy. Protects secrets, restricts dangerous commands.code-relaxed- Same filesystem/command protections ascode, with relaxed network settings for environments where TUN is unavailable.
You can use it like greywall --profile code -- claude.
| Agent | Works with template | Notes |
| Claude Code | code | - |
| Codex | code | - |
| Gemini CLI | code | - |
| OpenCode | code | - |
| Droid | code | - |
| Cursor Agent | code-relaxed | Node.js/undici doesn't respect HTTP_PROXY |
These configs can drift as agents evolve. If you encounter false positives on blocked requests or want a CLI agent listed, please open an issue or PR.
Note: On Linux, if OpenCode or Gemini CLI is installed via Linuxbrew, Landlock can block the Linuxbrew node binary unless you widen filesystem access. Installing OpenCode/Gemini under your home directory (e.g., via nvm or npm prefix) avoids this without relaxing the template.
Protecting your environment
Greywall includes additional "dangerous file protection" (writes blocked regardless of config) to reduce persistence and environment-tampering vectors like:
.git/hooks/*- shell startup files (
.zshrc,.bashrc, etc.) - some editor/tool config directories
See Architecture for the full list and rationale.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

