An AI coding assistant reads your source code, runs commands on developer machines and opens pull requests with the developer's own credentials, so it needs the same approval discipline as any other privileged integration. This checklist turns that discipline into tick-box items a security or platform team can print, assign and evidence. It covers the tool record and data settings, identity and tokens, MCP servers and extensions, secrets on developer endpoints, local command execution, prompt injection through repository content, and the review gates that stop unreviewed generated code reaching production. It is tool-neutral: every item is written as an outcome you can test in whichever assistant or IDE plugin you run. For the reasoning behind the controls, read the AI Coding Agents Security Guide; this page is the list you work through.
Each item is phrased so the answer is yes, no or not applicable. Record the evidence next to each yes (a screenshot of the admin setting, a policy file in a repository, a log query) so the next review can be repeated by someone else. Items marked (gate) are ones NHI Mgmt Group recommends treating as blocking: if the answer is no, the tool should not be approved for repositories that hold production code.
Key takeaways
- Treat each AI coding assistant, and each mode of it (chat, inline completion, agent, command-line agent, cloud agent), as a separate integration with its own record, owner and approval.
- Most of the real exposure sits in four places: what data leaves the organisation, which credentials the assistant can use, which MCP servers and extensions it loads, and what it can execute locally.
- Repository content is untrusted input. README files, issues, comments and configuration files can carry prompt injection, which the OWASP Top 10 for LLM Applications lists first as LLM01:2025 Prompt Injection.
- Generated code is still code. It must pass the same branch protection, human review, SAST, SCA and secret scanning as any other change, with no bypass for bots.
- Re-run the checklist on every major version, every new MCP server and every change of data or retention setting, not only at first approval.
1. Tool record and ownership
Start with an inventory row. Without it you cannot tell which settings apply to which developers, and you cannot revoke anything quickly in an incident.
- [ ] The assistant has an entry in the software or AI inventory with product name, vendor, version or release channel, and the modes in use (inline completion, chat, agent in IDE, command-line agent, cloud or background agent). (gate)
- [ ] A named business owner and a named technical owner are recorded, and both have agreed to receive security notices from the vendor.
- [ ] The licence tier in use is the one whose data and retention terms were reviewed; personal or free accounts are blocked for work repositories.
- [ ] The list of repositories, organisations or projects where the assistant may be used is written down, with any excluded repositories (for example, cryptographic code, regulated data processing, customer secrets) named explicitly.
- [ ] The vendor's security documentation, trust page and data processing terms are linked from the record and the review date is noted.
- [ ] Developers can find out, in one place, which assistants are approved and which are not. Unapproved tools are treated as shadow AI and handled through the normal exception process.
2. Data settings and retention
The data question is what leaves the developer's machine, where it goes, how long it stays and whether it trains anything. Data and retention terms change between licence tiers and between releases, so confirm them against the vendor's current documentation rather than a past review. The AI Coding Tools Data Retention and Training Tracker is a starting point for that comparison.
- [ ] The organisation-level setting that controls whether prompts, code snippets and completions may be used for model training is set to the value your policy requires, and developers cannot override it. (gate)
- [ ] Retention periods for prompts, completions, agent transcripts and uploaded files are recorded, and they match your data retention policy.
- [ ] Telemetry and usage analytics settings are reviewed, and any setting that sends code content (rather than metadata) is understood and approved.
- [ ] Content exclusion, ignore files or equivalent controls are configured so that files such as
.env, key stores, private key files, customer data extracts and regulated datasets are not sent as context. - [ ] The processing region and subprocessors (including the model providers the assistant routes to) are recorded and acceptable for the code in scope.
- [ ] If the assistant can index or embed whole repositories for retrieval, the location, access control and deletion process for that index are documented.
- [ ] Data handling for cloud or background agents (which may clone repositories into vendor-hosted environments) is reviewed separately from the IDE plugin, because it usually differs.
- [ ] A process exists to request deletion of prompts and transcripts if sensitive data is sent by mistake, and it has been tested at least once.
3. Identity, access and tokens
An assistant works with whatever identity it is given. In an IDE that is usually the developer; for cloud agents and command-line agents it is often a token, a GitHub App or a service account. These are non-human identities and should be governed as such.
- [ ] Access to the assistant is through the organisation's single sign-on, with multi-factor authentication enforced by the identity provider. (gate)
- [ ] Leavers lose access to the assistant automatically through deprovisioning from the identity provider, and this has been tested.
- [ ] Every token, app installation or service account the assistant uses has an owner, a purpose, a scope list and an expiry or rotation date in the NHI inventory.
- [ ] Repository and source control tokens used by agents are scoped to the specific repositories and permissions needed (for example, contents write and pull request write on named repositories), not organisation-wide administrator rights. (gate)
- [ ] Agents cannot approve their own pull requests, change branch protection, alter CI/CD workflow files or modify repository secrets without a separate human approval.
- [ ] Cloud credentials are not available to the agent by default. Where an agent needs cloud access, it uses short-lived, federated credentials with a narrow role rather than stored access keys.
- [ ] Personal access tokens created for assistant use are discoverable (naming convention or tag) and appear in regular token reviews. The guide to auditing AI coding assistant tokens and config files covers how to find them.
- [ ] Actions taken by agents are attributable: commits, comments and pull requests show that an agent produced them, and which human started the session.
4. MCP servers, extensions and plugins
Every MCP server the assistant connects to can feed text into the model and act with the credentials it is given. The Model Context Protocol Security Best Practices page describes local server compromise, token passthrough, SSRF during OAuth discovery and over-broad scopes as specific risks. Use the full MCP Server Security Checklist for each server; the items below are the minimum at assistant level.
- [ ] There is an allowlist of approved MCP servers, extensions and plugins, and the assistant is configured (centrally where the product allows) to load only those. (gate)
- [ ] Each approved server has a recorded source (publisher, repository, package name and version or digest), and versions are pinned rather than pulled as "latest" on every start.
- [ ] One-click or link-based installation of local servers is disabled or restricted. Where it is allowed, the client shows the exact command it will run before execution, as the MCP security guidance requires of clients that support one-click local configuration.
- [ ] Local servers run with the least privileges practical: sandboxed where the platform supports it, with file system access limited to the project and no access to SSH keys, cloud credential files or browser profiles.
- [ ] Local servers use the
stdiotransport, or, if they expose HTTP on localhost, require an authorisation token. Servers left listening on localhost without authentication are treated as a finding. - [ ] Remote servers use OAuth with tokens issued for that server. The MCP guidance states that servers must not accept tokens that were not explicitly issued for them; confirm the servers you approve follow this.
- [ ] Scopes granted to remote servers start minimal and are raised only for specific operations; wildcard or full-access scopes are rejected.
- [ ] Tool descriptions of every approved server have been read by a person at approval time and on each version change, looking for hidden instructions or unexpected capabilities.
- [ ] Server configuration files (for example, project-level MCP configuration committed to a repository) are reviewed like code, because a malicious startup command in a configuration file executes on every developer machine that trusts it.
5. Secrets on developer endpoints and in context
Coding assistants read the same files developers do. Secrets in working directories, shell history, environment variables and configuration files can reach prompts, transcripts, logs and generated code. The AI Coding Tools and Secrets Sprawl guide explains the paths in detail.
- [ ] Repositories in scope have secret scanning with push protection enabled, so a secret that an assistant writes into code is blocked before it reaches the remote. (gate)
- [ ] Pre-commit secret scanning runs on developer machines for repositories where assistants are used heavily.
- [ ] Developers are told, and the assistant's content exclusion is set, so that
.envfiles, key files and credential stores are not offered as context. - [ ] Applications in scope fetch secrets at runtime from a secrets manager rather than reading long-lived values from files in the repository.
- [ ] Assistant configuration files, caches and transcript folders on endpoints are known (paths recorded), excluded from unmanaged backup and sync tools, and covered by endpoint data loss controls where you run them.
- [ ] Any token the assistant itself stores locally (for example, its session or API token) is held in the operating system credential store where the product supports it, not in plain text files.
- [ ] A runbook exists for a secret exposed through an assistant: revoke and rotate first, then request transcript deletion, then search logs for use of the secret.
6. Local command execution and agent permissions
Agent modes can run shell commands, install packages, edit files and call the network. The settings that govern this are the most important ones on the page, and the defaults vary by product and version.
- [ ] The default mode requires human approval before the agent runs shell commands, writes outside the project directory or makes network requests. (gate)
- [ ] Any "auto-approve", "yolo" or equivalent unattended mode is disabled by policy on developer machines, or permitted only inside a disposable sandbox, container or virtual machine with no production credentials.
- [ ] Allowlists of permitted commands are short and specific. Broad entries (for example, allowing any shell, any package manager install or any
curl) are not used. - [ ] Package installs suggested by the assistant go through the same dependency intake as human ones; the Dependency Intake Review Checklist applies. Watch for package names that do not exist on the public registry, which attackers can later register.
- [ ] Organisation-managed settings for the assistant (where the product supports them) are deployed through device management, so developers cannot quietly weaken permission settings.
- [ ] Cloud or background agents run in isolated environments with network egress restricted to the source control host, the package registries you use and the model endpoint.
- [ ] Agents cannot reach cloud metadata endpoints or internal administration interfaces from their execution environment.
7. Prompt injection through repository content
Anything the assistant reads can try to instruct it: a README, an issue body, a code comment, a dependency's documentation, a web page it fetches, or an agent instruction file. OWASP lists this as LLM01:2025 Prompt Injection, and the damage depends on how much agency the assistant has (LLM06:2025 Excessive Agency).
- [ ] The team accepts, in writing, that repository content, issues, pull request comments and fetched web pages are untrusted input to the assistant.
- [ ] Agent instruction and rules files (the files an assistant reads automatically at the start of a session) are protected by code owners and need security review to change. See Coding Agent Configuration File Attacks.
- [ ] Agents that act on issues or pull requests from outside contributors run with read-only tokens and no secrets, or do not run on that content at all.
- [ ] Hidden or unusual characters in instruction files (for example, invisible Unicode) are flagged by a repository check.
- [ ] High-impact actions (pushing to protected branches, publishing packages, changing infrastructure, sending data to external URLs) always require a human decision, regardless of what the model was told.
- [ ] Web fetch and browsing tools available to the agent are limited to approved domains, or disabled where not needed.
8. Review gates for generated code
The gate is the pull request. Generated code should arrive there labelled, pass the same checks as any other change and be approved by someone who understands it. The AI Coding Agent Pull Request Governance Guide sets out the full model.
- [ ] Branch protection on default and release branches requires at least one human approval from someone other than the person who started the agent session. (gate)
- [ ] There is no bypass list entry for assistant or agent identities on protected branches.
- [ ] SAST, software composition analysis and secret scanning run on every pull request, including agent-authored ones, and failures block merge.
- [ ] Pull requests produced mainly by an agent are labelled so reviewers know to check intent, not just style; the label is applied automatically where possible.
- [ ] Changes to authentication, authorisation, cryptography, input handling and CI/CD workflows need a code owner from security or the platform team, whoever wrote them.
- [ ] Reviewers have a short written guide covering common weaknesses in generated code: missing authorisation checks, unsafe deserialisation, string-built queries, permissive CORS, disabled certificate checks and invented dependencies. The Secure Code Review Checklist is a good base.
- [ ] Licence and provenance checks for generated code follow your open source policy, including any vendor setting that blocks suggestions matching public code.
9. Logging, monitoring and response
- [ ] Administrative audit logs from the assistant (seat changes, policy changes, setting changes) are exported to the central log platform.
- [ ] Agent activity in source control (commits, pull requests, comments, workflow runs) is searchable by agent identity and by the human who started the session.
- [ ] Alerts exist for changes to the assistant's organisation-level data, retention or permission settings.
- [ ] Endpoint detection covers the processes the assistant and its local MCP servers spawn, so unusual child processes or outbound connections are visible.
- [ ] The incident plan covers a compromised assistant, extension or MCP server: disable the integration centrally, revoke its tokens, review recent agent-authored changes, rotate secrets that were in reach. The AI Coding Agent Incident Playbook gives the full sequence.
- [ ] The vendor's security advisories and release notes are monitored, and a named person decides whether each relevant release triggers a re-review.
Common failure patterns
- Approving the product, not the mode. A team approves an IDE plugin for completions, then the same licence quietly enables an agent mode or a cloud agent with very different data flows and permissions.
- Settings drift. A training or retention setting is checked once at procurement and never again, while the vendor changes defaults or the organisation moves to a different licence tier.
- Organisation-wide tokens for convenience. A single broad token is shared so an agent can work across many repositories, which turns one prompt injection into an organisation-wide write capability.
- MCP servers installed from a chat message. Developers paste a configuration snippet from a forum or blog, and an unpinned package runs with full user privileges on every start.
- Bots on the bypass list. An agent identity is added to the branch protection bypass list to "unblock" automation, removing the human gate entirely.
- Instruction files nobody owns. Agent rules files sit in the repository root with no code owner, so anyone with write access can change how every assistant behaves.
- Secret scanning after the fact. Scanning runs nightly rather than at push, so a secret written by an assistant sits in history and forks before anyone sees it.
Practitioner checklist
If you only have an hour, check these first.
- Confirm the training and retention settings at organisation level and lock them against user override.
- List every token and app installation the assistant uses and cut each to the repositories and permissions it needs.
- Enforce an allowlist of MCP servers and extensions with pinned versions.
- Turn off unattended command execution on developer machines and confine it to disposable sandboxes.
- Enable secret scanning push protection on every repository in scope.
- Require human approval on protected branches with no bypass for agent identities.
- Put agent instruction and MCP configuration files under code owner review.
- Export the assistant's admin audit log and alert on setting changes.
Standards and references
- OWASP: Top 10 for LLM Applications 2025, especially LLM01 Prompt Injection, LLM02 Sensitive Information Disclosure, LLM03 Supply Chain and LLM06 Excessive Agency.
- Model Context Protocol: Security Best Practices (revision 2026-07-28).
- OWASP GenAI Security Project: Top 10 for Agentic Applications for 2026.
- NIST: SP 800-218A Secure Software Development Practices for Generative AI and Dual-Use Foundation Models.
- NIST: SP 800-218 Secure Software Development Framework (SSDF) Version 1.1.
- OWASP: Secrets Management Cheat Sheet.
- OWASP: Non-Human Identities Top 10 2025.
Related NHI Mgmt Group resources: AI Coding Agents Security Guide · AI IDE and Coding Agent Security Guide · MCP Server Security Checklist · AI Coding Tools and Secrets Sprawl