#security
11 articles
-
Stop Claude Code reading your .env with a Read deny rule
A Read deny rule is the reliable way to keep .env out of the model's input. How to write the pattern, how depth and anchoring change its reach, and where deny stops working.
-
Claude Code permissions in settings.json and settings.local.json, allow, deny and ask rules with real examples
The allow / deny / ask rules and pattern syntax, scope precedence, what settings.local.json is for and how it stays out of git, plus recommended setups for solo and team work.
-
Stop Codex asking "trust this folder?": set trust_level = "trusted" in config.toml
Add [projects."<absolute path>"] with trust_level = "trusted" to ~/.codex/config.toml to stop the prompt. Untrusted projects have .codex/config.toml, hooks and rules ignored.
-
Codex passes your API keys to commands by default: fix it with shell_environment_policy
ignore_default_excludes defaults to true, so variables containing KEY, SECRET or TOKEN are passed straight through. How to set it to false, plus inherit, filters and set.
-
Block rm -rf with a Claude Code PreToolUse hook, and know its limits
Two ways to deny a dangerous rm before it runs: exit code 2 and permissionDecision. Why a hook deny works even in bypassPermissions, and where string matching stops being enough.
-
Codex approval_policy vs sandbox_mode: which pairs are safe (on-request + workspace-write, never + read-only)
What approval_policy and sandbox_mode each control in Codex CLI, what --full-auto really sets, and which combination to pin in config.toml for research, daily work and CI.
-
web_search = "disabled" | "cached" | "indexed" | "live": what each Codex search mode allows
Codex defaults to cached search locally and live with full access. web_search = "indexed" cuts prompt injection risk, "disabled" turns it off, and --search enables it for one run.
-
When bypassPermissions is safe to use in Claude Code, and when it isn't
What --dangerously-skip-permissions actually turns off, what still stops it, the isolation conditions the docs require, and the alternatives worth trying before you reach for it.
-
Stop AI coding tools from reading your API keys and secrets: settings for Claude Code, Codex and Gemini CLI
Settings that keep .env files and credentials away from Claude Code, Codex and Gemini CLI, what to do after a leak, and how to keep secrets out of the repository altogether.
-
Allow Claude Code's WebFetch for specific domains only
How WebFetch(domain:...) rules match, what each wildcard position covers, why a bare WebFetch rule differs from domain:*, and why a redirect target needs its own permission.
-
Is your code used to train Anthropic's models? Claude Code data usage by plan
Whether Claude Code uses your code for model training depends on your plan and settings. How personal and commercial plans differ, and what to check before using it at work.