AI Agent Policy Desk
Audit coding agent configs, build the managed policy, and prove what it blocks.
Background readingMCP tool poisoningPrompt injection attacksLeast privilege
Loading the checks.
Covers Claude Code, Codex, Cursor and MCP server files. Fernhill Studio is a fictional fleet and every token in the samples is fake.
What it checksWhat it checks, and how far to trust it
Setting names and defaults were checked against the Claude Code, Codex and Cursor documentation on 10 November 2026. Both CLIs ship often, so recheck before a rollout.
| File | Checks | What gets flagged |
|---|---|---|
| Claude Code settings | 33 | Bypass mode and no lock against it, unscoped Bash, interpreter and network prefixes, unscoped WebFetch, server-wide MCP approval, 11 unprotected secret paths (SSH, cloud, wallet keystores, npm, Docker, Kubernetes), absolute paths written with one slash, repo MCP servers that auto-start, secrets and TLS switched off in env, hooks that pipe the internet into a shell, sandbox that fails open or has broad escape hatches, Read denies that scripts can step around, no login or organisation lock, allowManagedPermissionRulesOnly placed under permissions where it is ignored |
| Codex config.toml | 15 | danger-full-access with approval never (the --yolo combination), network inside the sandbox, home folder as a writable root or trusted project, secret-named variables passed to commands (ignore_default_excludes defaults to true), the retired "untrusted" and deprecated "on-failure" values, permission profiles with full access, custom profiles that write the whole filesystem or home folder, open the network or use dangerously_* network flags, secrets written into shell_environment_policy.set |
| Cursor permissions | 7 | Wildcard or interpreter commands in the auto-run list, WebFetch(*), Mcp(*:*), writes outside or across the whole workspace, no secret Read denies |
| MCP servers (any of the above) | 4 | Unpinned npx, uvx or bunx packages, containers with the Docker socket or privileged mode, remote servers over plain HTTP, tokens pasted into env, headers or arguments |
- Selftests:
node tools/ai-agent-config/selftest.cjsruns 262 checks over the parser, the rules, the permission evaluator (prefix and wildcard forms, chained commands, substitutions, wrappers, redirects, path anchors, layer precedence, modes, managed-only rules), regression cases from six independent review rounds, and the generated policy, which must audit with no high or critical findings. - Known limits: the tester is an approximate model of the documented rules, not Claude Code's own parser. Detected parse failures fall back to a prompt; unsupported command semantics can still produce a wrong answer, and Bash file-path checks cover a selected set of commands (cat, head, tail, sed, tee, grep, wc, diff and redirects). Documented limits of Claude Code rules apply too: a Bash deny matches the command text, so /usr/bin/curl, sh -c, bash -c and env curl are not matched by Bash(curl *); the sandbox network allowlist is the control for those. The CLI is the final word. Control mappings to SOC 2 and ISO 27001 are suggested starting points for an audit conversation. Secret detection and masking are best effort and can miss credentials; use synthetic or already-redacted configs.
AI Agent Policy Desk FAQ
Which files can I paste?
A Claude Code settings.json or managed-settings.json, a project .mcp.json, a Codex config.toml, and a Cursor cli-config.json or permissions.json. The type is detected from the content.
Which shell commands do Read deny rules cover?
Read and Edit deny rules cover the file tools, file commands Claude Code recognises in Bash such as cat, head, tail, sed and tee, and redirect targets. They do not cover a script that opens the file itself, such as Python or Node, or a grep -r that never names the file. The OS sandbox enforces the path for every process on macOS, Linux and WSL2, but not on native Windows.
Where does the managed settings file go?
On macOS, /Library/Application Support/ClaudeCode/managed-settings.json or a configuration profile for the com.anthropic.claudecode domain. On Linux and WSL, /etc/claude-code/managed-settings.json. On Windows, C:\Program Files\ClaudeCode\managed-settings.json or the HKLM policy key. Codex requirements go to /etc/codex/requirements.toml.
Is the permission tester exact?
No. It is an approximate model of the documented rules and is not Claude Code's own shell parser. It follows the documented order (deny, then ask, then allow, then the mode), splits chained commands, checks deny rules inside substitutions and loops, and sends commands it cannot parse, and paths it cannot resolve, to a prompt. Unsupported command semantics can still produce a wrong answer. Confirm a policy on one test machine before a fleet rollout.
Is my config uploaded?
No. Your config is processed in your browser: parsing, checks, the policy builder and the tester all run on the page. Secrets it detects are masked in the findings on a best-effort basis, so use synthetic or already-redacted configs.
Sources
- Claude Code: settings, permissions, managed settings, MDM templates
- Codex: configuration reference, managed configuration
- Cursor: CLI permissions, enterprise deployment
- Model Context Protocol specification
Fernhill Studio, its laptops and every token in the samples are invented. Your config is processed in your browser.