Skip to main content

Security Checklist for AI Coding Agents

By the OnlineAppCreator editorial team4 min read

Short answer

Securing AI coding agents means limiting what they can execute and reach, keeping secrets and personal data out of their context, treating all external content as potential prompt injection, and reviewing every change and dependency they introduce. The controls below cover accounts, permissions, sandboxing, MCP servers, supply chain, data protection and audit, and most can be put in place within a week.

On this page
  1. 1. Accounts, plans and data terms
  2. 2. Permissions and sandboxing
  3. 3. Secrets and personal data
  4. 4. Prompt injection and untrusted input
  5. 5. MCP servers and integrations
  6. 6. Supply chain and code review
  7. 7. Rollout checklist

A coding agent is a program that reads untrusted text, decides what to do and runs commands with your developer's permissions. That combination creates risks that classic secure development policies do not cover. Most incidents with AI coding agents are not exotic attacks but ordinary mistakes: a token in a prompt, an agent allowed to run anything, a dependency nobody checked. This checklist groups the controls by area so security teams and tech leads can work through them systematically. It applies to Claude Code, Codex, Cursor, GitHub Copilot and similar tools.

1. Accounts, plans and data terms

Start with governance. Use business or enterprise plans whose terms state how code and prompts are retained and whether they are used for model training. Enforce single sign-on where available, so access ends when someone leaves. Block personal accounts for company code by policy and, where possible, technically. Record which model providers and regions process your data, because this matters for GDPR and for customer contracts. Document all of this in an AI usage policy that developers have read.

2. Permissions and sandboxing

The agent should only be able to do what the task requires. Configure allowlists for shell commands and deny rules for destructive ones such as force pushes or deleting directories outside the project. Prefer running agents in containers, virtual machines or the vendor's sandbox modes, especially for unattended runs. Restrict outbound network access to known hosts such as your package registry. Never run agents with administrator privileges on developer machines or with access to production infrastructure. Tools differ in how they express this: Claude Code uses permission rules and hooks, Codex uses approval and sandbox modes, and IDE agents use settings that require confirmation before commands.

3. Secrets and personal data

Keep credentials out of the repository, prompts and context files. Use a secret manager and environment variables injected at runtime, and add secret scanning to pre-commit hooks and CI. Exclude files such as .env from what the agent may read where your tool supports it. Personal data deserves the same care: do not paste customer records into prompts or connect agents to production databases. If agents need realistic data, use synthetic or anonymized datasets; Textwash Pro anonymizes text with local machine learning before it reaches any AI system.

4. Prompt injection and untrusted input

Agents read issues, web pages, documentation, code comments and tool outputs. Any of these can contain instructions crafted to make the agent leak data or run harmful commands. Treat every external input as untrusted. Require human approval for actions with side effects such as pushing code, calling external APIs or writing to databases. Be cautious with agents that browse the web or process content from outside contributors, and avoid giving those sessions access to secrets at the same time.

5. MCP servers and integrations

Model Context Protocol servers extend what an agent can reach, and each one is code with credentials. Maintain an allowlist of approved servers, prefer official ones, pin versions and review what each tool exposes. Use scoped, read-only tokens. Our explainer on MCP servers for developers describes the protocol and its risks in more depth.

6. Supply chain and code review

Agents add dependencies readily and sometimes suggest packages that do not exist, which attackers exploit by registering those names. Require review of every new dependency, use lockfiles and run software composition analysis in CI. Apply the same branch protection, required reviews and static analysis to agent changes as to human ones. Pay attention to authentication, authorization and input validation, the areas where generated code most often looks right and is wrong; see quality signals for AI-generated code.

7. Rollout checklist

  1. Approve tools and plans, and publish an AI usage policy.
  2. Enforce SSO and remove personal accounts from company work.
  3. Configure permission allowlists, deny rules and sandbox modes in shared project settings.
  4. Move all secrets to a secret manager and enable secret scanning.
  5. Define approved MCP servers and token scopes.
  6. Require review and CI checks for every agent pull request, including dependency checks.
  7. Enable logging of agent sessions where the tool supports it, and keep logs per your retention policy.
  8. Train developers on prompt injection, data handling and review, and repeat the training yearly.

Assign an owner to each item and set a date; a checklist without owners rarely gets finished. Revisit it whenever you add a new tool, a new MCP server or a new team, because each of these changes the attack surface.

Larger organizations and public bodies need more than per-team settings: central policies, audit trails, approved models and integration with identity management. KalaidoCreate is an all-in-one AI platform for enterprises and the public sector with compliance features, governance and custom APIs, which helps bring AI use under one controlled roof. jocapps, the company behind OnlineAppCreator, works under ISO 9001 and states ISO 27001 certification, and we apply this checklist when we build and launch digital products. For training, see secure agentic coding practices every team should learn.

Frequently asked questions

What is the biggest security risk with AI coding agents?

Excessive permissions combined with untrusted input. An agent that may run any command and reads attacker-controlled text, such as a crafted issue, can be manipulated into leaking secrets or damaging systems.

Should coding agents have access to production?

No. Keep agents in development and staging environments with scoped credentials, and deploy to production only through your reviewed CI/CD pipeline.

Do AI coding agents send my code to the vendor?

Cloud-based models process the code you share with them. Check your plan's retention and training terms, use business plans for company code and keep secrets and personal data out of the context.

Want this done right, the first time?

OnlineAppCreator takes products from idea to operation. Tell us where you stand and get a concrete plan in a free 15-minute call.