How do you limit what an AI agent can touch?
27 posts, 1 new this week
Playbook
Practitioners limit AI agent access through a combination of system-level sandboxing, specific configuration deny rules, and hardware-level or infrastructure-based isolation.
- Restrict file access via Claude Code settings
Users can prevent Claude Code from editing sensitive files like .zshrc, .bashrc, .gitconfig, and .ssh/** by adding them to a 'deny' list within ~/.claude/settings.json . 2
- Isolate agents in Linux sandboxes
Developers can run agents such as Claude Code, Codex, or Pi in isolated environments like external-sandbox-v86, which uses Alpine Linux via WebAssembly in Node.js 22.19 or later to prevent host system damage . 9
- Apply Nix overlays to dependencies
Geoff uses Nix overlays to patch system dependencies like git (from 2.54 to 2.55 to remove force-push) and OpenSSL across CI, laptops, and sandboxes . 1
- Harden agent permissions and production access
Run agents on disposable NixOS machines with sudo access while strictly forbidding database connections or root access on production hosts . 1
- Lock configuration files to prevent rule bypass
Lock the ESLint config file to prevent agents from inserting eslint-disable-next-line comments to bypass linting rules . 4
- Use code-based validation for task completion
Design agent harnesses where code, rather than the model, judges completion by comparing external world state—such as a page snapshot—before and after an action . 7
Choosing between approaches
While deny rules in ~/.claude/settings.json block built-in tools and shell redirects, they may not stop independent install scripts, which might require enabling the Bash sandbox 2. Sandboxing alone may not prevent two agents on the same vLLM inference server from communicating via kernel selection or KV cache side channels 10.
Not covered yet
The material does not address methods for detecting or preventing the side-channel communication between models sharing an inference engine 10.
Posts
- Patch git and OpenSSL with Nix overlays to stop agent force-pushesGeoff uses Nix overlays to apply security patches to dependencies like git and OpenSSL across laptops, CI, and sandboxes.

- Block Claude Code from editing system files using deny rulesArijit Ghosh shows how to secure sensitive configurations outside a project directory.

- Claude models, not Claude Code, send your email after a 401 or 403 by reading Cargo.tomlArmin Ronacher points out that Claude Code sending an email address is not tool-layer behavior but something the Claude model does when it meets a 401/403 error or a polite-request situation such as robots.txt.

- Lock ESLint config to stop agents from adding disable commentsBOOTOSHI uses a custom ESLint configuration that errors on eslint-disable-next-line comments, which AI agents often insert to bypass lint rules.
- Check hook trust records if Postman silently rewrites your Codex and Claude Code configsThe author found that the Postman desktop app on macOS silently installs AI plugins, rewrites the global configuration of Codex and Claude Code, and injects a startup hook that routes API tasks to Postman; the installer even tries to approve the hook itself.
- Clean up an Android TV over adb with Claude Code, from 108 MB free to 1.4 GBThe author used Claude Code over adb to clear caches and uninstall 13 preinstalled apps on an Android TV, raising free space from 108 MB to 1.4 GB.

- Let code, not the model, judge task completion by diffing external state before and afterTejas Kumar, drawing on Hacker News upvoted agent cases, sets out four key decisions for agent harness design.

- Add security constraints to specs automatically by mapping 60 CWE entries to EARS requirementsAmazon Kiro's spec-hardening engine works in three stages: trigger detection, coverage checking and constraint proposal.

- Run coding agents in isolated Linux sandboxes to prevent host system damagePrime Radiant released tools that let developers run Claude Code, Codex, or Pi within an external sandbox.
- Two agents on one vLLM server exchange bits via kernel selection side channelsgmays demonstrates that two AI agents on the same vLLM inference server can communicate despite sandboxing by exploiting side channels.
- Claude sessions on web, desktop and mobile default to auto mode from next week
- Mask API keys in Claude Code's sandbox so the agent only ever sees a placeholder
- Prompt Claude to grant session permission to bypass auto mode refusals
17 more posts to see