AI Coding Agent Acceptable-Use Policy Template
A policy for the tools that read your code and run commands: which agents are allowed, which modes are off-limits, where keys and MCP servers may live, and who reviews the output. Each clause comes with the setting that enforces it and the check that proves it.
Short answer. A useful AI coding agent policy names the approved agents and accounts, forbids modes that run commands without approval outside disposable environments, keeps API keys out of plain-text files, limits MCP servers to an allowlist of pinned, scoped servers, sets rules for local models, and keeps human code review in charge. Each clause below comes with the vendor setting that enforces it and a check that proves it on the laptop. Copy the template, fill in the brackets, and keep the approved list in a separate register so you do not re-approve the policy every time a tool changes.
Need a general AI policy for all staff instead? Use the AI acceptable use policy template or the policy generator; this page is the developer-specific add-on.
Why coding agents need their own clauses
A chat assistant answers questions. A coding agent such as Claude Code, Codex CLI, Gemini CLI, Cursor or GitHub Copilot in agent mode reads the repository, edits files, runs shell commands and starts MCP servers, all with the developer's own permissions. A general "use approved AI tools" policy says nothing about the things that make that safe or unsafe: whether approval prompts are on, which MCP servers it can start, where its API key is stored, and who reviews what it writes.
The good news is that the main agents now ship admin controls for exactly these points, and most of them leave traces on disk that you can check. The template below is written so that every clause maps to one of those controls and one of those checks.
The policy template
Copy it, replace the bracketed parts and delete clauses that do not apply. It is meant to sit under your general AI acceptable use policy.
AI CODING AGENT ACCEPTABLE-USE POLICY
Owner: [Head of Engineering + Security] Version: [1.0] Review: every 6 months
1. Scope
Applies to everyone who writes or reviews code for [Company], on company devices
and on any device with access to company repositories. "Coding agent" means any
AI tool that can read a codebase and edit files or run commands: terminal agents
(e.g. Claude Code, Codex CLI, Gemini CLI), AI IDEs (e.g. Cursor, Windsurf) and
agent modes of IDE extensions (e.g. GitHub Copilot, Cline). It also covers MCP
servers and plugins those tools load, and local model runtimes.
2. Approved agents and accounts
a. Only the agents listed in the AI register [link] may be used on company code.
b. Use them only with company-managed accounts or company API keys, never personal
subscriptions or personal keys.
c. The managed configuration published by IT must stay in place. Do not remove,
override or work around it.
3. Approval modes
a. Modes that run commands or edit files without asking (for example Claude Code
bypassPermissions / --dangerously-skip-permissions, Codex danger-full-access
or approval "never", Gemini CLI YOLO, Cursor "Run Everything") are not allowed
on company devices.
b. Exception: disposable environments with no access to production credentials
(containers, VMs or CI runners listed in the register).
c. Do not pre-approve an unrestricted shell (e.g. a bare "Bash" allow rule).
4. Credentials and API keys
a. Never store AI API keys, tokens or other secrets as literal values in shell
profiles, agent settings, MCP configuration or committed files. Use the OS
keychain, the company secret manager or the agent's credential helper.
b. Agents must be configured so they cannot read secret files (.env, ~/.ssh,
~/.aws, kubeconfigs) unless a task requires it.
c. A key found in plain text is treated as exposed: report it, rotate it, then
store the new one properly.
5. MCP servers
a. Only MCP servers on the approved MCP list [link] may be configured.
b. Packages must be pinned to a reviewed version (no unpinned npx / uvx / latest).
c. File system access is limited to project folders, never a whole home folder
or drive.
d. Remote servers use HTTPS and an approved vendor.
e. Tools with side effects (write, send, delete, execute) are not auto-approved.
f. Servers defined inside a repository are approved one by one, never wholesale.
6. Plugins, extensions and hooks
Agent plugins, plugin marketplaces, IDE extensions and hooks follow the same
allowlist. Hooks that send data off the device need security review.
7. Model endpoints
Agents send code only to the company's contracted provider or approved gateway
[name]. Custom base URLs and third-party proxies need approval.
8. Local models
Local runtimes (e.g. Ollama, LM Studio) are allowed on [approved teams/devices],
listen on localhost only and use models from the approved list. Models with safety
training removed need a documented exception.
9. Where agents run
The same rules apply inside WSL, containers and virtual machines on company
devices.
10. Review and accountability
a. Code written by an agent goes through the normal pull request review; agents
do not push to protected branches.
b. The developer who runs the agent is responsible for its changes and commands.
c. Report unexpected agent behaviour (commands you did not ask for, access to
secrets, data sent outside) to [security contact].
11. Exceptions
Request through [queue]. Each exception names the person, tool, setting and an
end date (max [90] days) and is approved by [Security].
12. Verification
IT checks company endpoints for coding agents, MCP servers, approval modes and
plaintext keys at least [weekly]. Findings are fixed or registered as exceptions
within [14] days. Records are kept for [12 months].
Three choices make this enforceable. The approved tools live in a register, not in the policy text. Each clause is phrased in terms of a setting or a file, not intent. And clause 12 commits to a frequency and a retention period, which is what an auditor will test (see Shadow AI audit evidence).
How to enforce and verify each clause
"Enforce" is the control that makes the clause hold; "verify" is how you prove it on endpoints. The last column says what Kuntur reports for that clause, and where it does not.
| Clause | Enforce with | Verify on endpoints | Kuntur |
|---|---|---|---|
| 2a. Approved agents | Application control for anything unauthorized (Intune, Jamf, Cursor with Intune) | Inventory of agents per user: binaries, npm packages, config folders | Inventory of the catalog plus AI candidates; an unauthorized tool in use raises POLICY_VIOLATION |
| 2b. Company accounts | SSO in the vendor console; Cursor's Allowed Team IDs policy | Vendor seat lists and sign-in logs | Not visible: Kuntur does not read which account an agent is signed in with |
| 2c. Managed config in place | Deploy Claude Code managed-settings.json, Codex requirements.toml, Gemini CLI system settings by MDM | The managed file exists on each device | Reports Claude Code managed settings when present; does not report Codex or Gemini CLI managed files |
| 3a. No bypass modes | Claude Code permissions.disableBypassPermissionsMode; Codex allowed_approval_policies and allowed_sandbox_modes; Gemini CLI security.disableYoloMode; Cursor Run Mode policy | User settings files of each agent | AGENT_PERMISSIONS_BYPASS for Claude Code, Codex and Gemini CLI settings files; AGENT_BYPASS_ACCEPTED when a user accepted Claude Code's bypass prompt. Per-session flags and Cursor run modes are not seen |
| 3c. No unrestricted shell | Claude Code allowManagedPermissionRulesOnly with your own rules | permissions.allow in Claude Code settings | AGENT_UNRESTRICTED_SHELL (Claude Code only) |
| 4a. No literal keys | Company keys from a secret manager; Claude Code apiKeyHelper | Shell profiles, agent settings, MCP configs, app config folders | AI_API_KEY_IN_SHELL_PROFILE, AI_API_KEY_IN_APP_CONFIG, AGENT_PLAINTEXT_SECRET, MCP_PLAINTEXT_SECRET, masked. Not read: Windows registry user variables and .env files in repositories (use a secret scanner) |
| 4b. Secret files out of reach | Claude Code Read(...) deny rules in managed settings; Cursor read controls; Codex sandbox | Managed settings content | Not checked |
| 5. MCP allowlist and hygiene | Claude Code allowedMcpServers / allowManagedMcpServersOnly or managed-mcp.json; Codex [mcp_servers] in requirements.toml; Gemini CLI mcp.allowed; Cursor MCP allowlist; GitHub Copilot MCP policy | Every MCP config file, user and project level (paths) | MCP inventory grouped by identity, plus MCP_UNPINNED_PACKAGE, MCP_BROAD_FILESYSTEM, MCP_REMOTE_INSECURE, MCP_REMOTE_SERVER, MCP_AUTO_APPROVE, MCP_COMMAND_EXECUTION, MCP_DOCKER_PRIVILEGED, AGENT_AUTO_PROJECT_MCP |
| 6. Plugins and hooks | Claude Code strictKnownMarketplaces and allowManagedHooksOnly; IDE extension allowlists | Plugin and marketplace files, extension folders | Plugin, skill and extension inventory; PLUGIN_THIRD_PARTY_MARKETPLACE, PLUGIN_HOOK_NETWORK |
| 7. Model endpoints | Managed env in Claude Code; egress rules at the proxy | Base URL settings in agent config | AGENT_CUSTOM_ENDPOINT for Claude Code ANTHROPIC_BASE_URL; Codex model_providers listed in the inventory |
| 8. Local models | Application control; runtime settings (OLLAMA_HOST) | Runtimes, listeners, model files | Local model inventory; LOCAL_LLM_EXPOSED, LOCAL_AI_API_EXPOSED, CONTAINER_AI_EXPOSED, LOCAL_MODEL_UNCENSORED |
| 9. WSL, containers, VMs | Restrict virtualization to approved devices; deploy managed files inside WSL | Per-environment inventory | Running WSL distros scanned; containers matched by image only; VMs reported with VIRTUALIZATION_PRESENT and VM_RUNNING_WITH_AI_TRAFFIC, not inventoried inside |
| 10. Review | Branch protection and required reviews in your Git host | Git host settings and audit log | Not an endpoint question; Kuntur does not check it |
| 11. Exceptions | A ticket with an end date | Compare open exceptions with the current inventory | Approvals and decisions are kept in the audit log |
Vendor settings, side by side
Each vendor documents its own precedence rules, so test on one machine before rolling out. A user with local admin rights can edit any file on the laptop, managed ones included, which is why MDM redeployment matters; Google's Gemini CLI guide says so explicitly.
Claude Code: managed settings
Deployed as managed-settings.json in C:\Program Files\ClaudeCode\, /Library/Application Support/ClaudeCode/ or /etc/claude-code/, as an MDM profile or from the claude.ai admin console. Managed values override user, project and command-line settings. A starting point for clauses 3, 4, 5 and 6:
{
"permissions": {
"disableBypassPermissionsMode": "disable",
"deny": ["Read(./.env)", "Read(./.env.*)", "Read(~/.ssh/**)", "Read(~/.aws/**)"]
},
"allowManagedMcpServersOnly": true,
"allowedMcpServers": [ { "serverName": "github" } ],
"enableAllProjectMcpServers": false
}
Check the settings reference for the exact entry format of each key on your version (for example strictKnownMarketplaces and allowManagedHooksOnly for clause 6). On a test machine, /status shows whether managed settings loaded.
OpenAI Codex: requirements.toml
Admin-enforced requirements live in /etc/codex/requirements.toml on macOS and Linux and %ProgramData%\OpenAI\Codex\requirements.toml on Windows (macOS can also receive them by MDM). An mcp_servers table turns MCP into an allowlist: a server runs only if its name and identity (command or URL) match.
allowed_approval_policies = ["on-request"]
allowed_sandbox_modes = ["read-only", "workspace-write"]
[mcp_servers.github]
identity = { command = "github-mcp-server" }
OpenAI's docs recommend allowed_permission_profiles instead of allowed_sandbox_modes on newer Codex versions; check which one your version reads.
Gemini CLI: system settings
The system settings file (/etc/gemini-cli/settings.json, C:\ProgramData\gemini-cli\settings.json or /Library/Application Support/GeminiCli/settings.json) has the final say over user and workspace settings.
{
"security": { "disableYoloMode": true },
"mcp": { "allowed": ["github"] }
}
Google's enterprise guide says plainly that these settings are not a foolproof boundary: a user can point GEMINI_CLI_SYSTEM_SETTINGS_PATH at another file, and without mcp.allowed any user-defined server is merged in.
Cursor: team settings
Cursor's team and enterprise settings cover the same ground from its admin dashboard: which run modes users may pick, an MCP allowlist, an extension allowlist, Privacy Mode enforcement, and the Allowed Team IDs MDM policy that keeps personal accounts off company devices. These live in Cursor's dashboard rather than in files on the laptop. Details and sources in Cursor and Claude Code security.
What an endpoint check cannot prove
Be honest in the policy and with auditors about what you can verify:
- What was typed into the agent. No inventory proves a developer did not paste a customer record into a prompt. Deny rules, company accounts with no-training terms and DLP reduce the risk; none of them is proof.
- One-off flags. A bypass flag passed for a single session (
--dangerously-skip-permissions,--yolo) leaves no setting behind. Managed settings that disable the mode are the control; process command lines in your EDR are the evidence. - Dashboard-only settings such as Cursor run modes and account types are verified in the vendor console, not on the laptop.
- Inside VMs and containers, the host sees little. Install the inventory agent inside company VMs, or keep agents to environments you can see.
Rolling it out
- Inventory first. Find out what is already in use before you publish the list; see how to discover Shadow AI on company endpoints. A policy that bans the tool half the team relies on will be ignored.
- Approve the obvious ones quickly. One or two agents on company accounts, with managed settings, cover most needs.
- Deploy the managed files before enforcing. Developers notice when prompts come back; tell them why.
- Fix plaintext keys with the owners, rotating each one, rather than only filing a finding.
- Re-check after two weeks and review the register every six months.
Automate the checks
To check one developer laptop against clauses 2 to 9 right now, run the free Kuntur scanner. It lists coding agents, MCP servers, risky agent settings, exposed keys and local models for that computer.
- Download scan.ps1.
- Read it. It's plain text; here's what it does.
- Check its SHA-256 against the published hash:
Get-FileHash .\scan.ps1 -Algorithm SHA256 - Run it:
powershell -ExecutionPolicy Bypass -File .\scan.ps1
Windows shortcut, if you trust the source (PowerShell)
irm https://app.kuntur.io/scan.ps1 | iexmacOS and Linux (Terminal)
curl -fsSL https://app.kuntur.io/scan.sh | shIt needs no account and no admin rights, writes an HTML report to the Desktop (or home folder) and uploads nothing. You can read scan.ps1 or scan.sh before running it; what it collects is documented.
For clause 12 across a fleet, the Kuntur agent runs these checks continuously on every enrolled Windows, macOS and Linux endpoint, lets you mark each agent, MCP server and extension approved or unauthorized, and keeps an audit log of findings and decisions you can hand to an auditor.
Free for up to 5 endpoints. Pro is US$3 per endpoint per month (or US$30 per endpoint per year) for 10 to 30 endpoints. The trial needs no credit card. Kuntur detects and reports; it does not block or uninstall anything.
FAQ
- Should we ban YOLO and bypass-permissions modes completely?
- On company devices with access to real code and credentials, yes. Allow them only in disposable environments such as containers, VMs or CI runners with no production secrets. Enforce it with the vendor settings: Claude Code
permissions.disableBypassPermissionsMode, Codexallowed_approval_policiesinrequirements.toml, Gemini CLIsecurity.disableYoloModeand Cursor's Run Mode policy. - How do I enforce an MCP allowlist for coding agents?
- Use each client's admin setting:
allowedMcpServersormanaged-mcp.jsonfor Claude Code, themcp_serverstable in Codexrequirements.toml,mcp.allowedin Gemini CLI system settings and the team MCP allowlist in Cursor. Then verify with an inventory of every MCP config file, because a client without such a setting will run whatever the user adds. - Does this replace a general AI acceptable use policy?
- No. It is the developer add-on. Keep a general policy for all staff (data classes, approved chat tools, exceptions) and attach this one for people who use coding agents.
- Can Kuntur enforce this policy?
- No. Kuntur verifies it: it inventories agents, MCP servers, extensions and local models, raises findings for bypass modes, plaintext keys and risky MCP settings, and keeps an audit log of what you approve. Enforcement comes from the vendors' managed settings, your MDM and application control.
Sources
- Claude Code documentation: Settings files and precedence
- Claude Code documentation: Settings reference
- Claude Code documentation: Deploy managed settings
- Claude Code documentation: Configure permissions
- OpenAI Codex: Managed configuration (requirements.toml)
- Gemini CLI for the enterprise
- Cursor: Security hardening
- Cursor: Run modes
- GitHub Docs: MCP management for Copilot
More guides and tools: