AI agents
AI Coding Agents in the Enterprise: Security, Data and EU Rules
How to adopt AI coding agents such as Claude Code, Codex and GitHub Copilot safely: selection criteria, security controls, data handling and EU rules.
In short
AI coding agents use a language model to read a repository, edit files and run commands until a software task is done. Enterprises adopt them safely by enforcing central policy, sandboxing execution, denying network access by default, checking where code and prompts are processed, logging agent actions and meeting EU duties such as AI literacy.
Key takeaways
- There is no best AI coding agent in general: compare tools on central policy, isolation, repository trust, data terms, EU processing options, audit evidence, model choice and how quickly the vendor fixes security flaws.
- Permission prompts are not a sandbox, so enforce operating-system sandboxing and default-deny network access through central policy rather than relying on developers' approvals.
- Treat every repository as untrusted input: two of Anthropic's 2026 Claude Code advisories involved repository settings files that took effect before the user had confirmed trust.
- Anthropic and OpenAI do not train on business data by default, but retention, local transcripts and EU processing options differ by product, plan and route, so check each surface you plan to use.
- Coding agents are generally not high-risk under the EU AI Act, but AI literacy, the GDPR, NIS2, DORA and the Cyber Resilience Act still shape how you deploy them and what evidence you keep.
What are AI coding agents?
AI coding agents use a language model to complete software tasks, not just suggest lines. They read a repository, plan a change, edit files, run commands and tests, and repeat until the task is done or handed back to a developer. Claude Code, OpenAI Codex, GitHub Copilot cloud agent and OpenCode are examples.
They run in three places:
- On a developer’s machine, in a terminal or integrated development environment (IDE), with that developer’s files, credentials and network access.
- In the vendor’s cloud, on a copy of the repository: Codex cloud uses isolated OpenAI-managed containers, Claude Code cloud sessions use isolated Anthropic-managed virtual machines, and Copilot cloud agent pushes to a branch and opens a draft pull request.
- In pipelines and automations, triggered by issues, comments or schedules.
The software that runs this loop is the agent’s harness; see what an agent harness is.
How are coding agents different from code completion assistants?
A completion assistant proposes code that a developer accepts or rejects. A coding agent acts: it chains steps, runs commands and changes files with the permissions it holds, and a person may see only the result.
Claude Code’s Manual mode, for example, starts read-only and asks before editing files or running commands; its other modes ask less. The security question becomes: what can this process reach, and who notices when it goes wrong?
Which AI coding agent is best for an enterprise?
There is no best AI coding agent in general, only the tool whose controls, data terms and model options fit your codebase, risk appetite and obligations. Shortlist on these criteria, then pilot on your own repositories. For two common shortlist entries, see our guides to GitHub Copilot for enterprises and Cursor for enterprises.
| Criterion | Why it matters | What to ask or check |
|---|---|---|
| Central policy | Local settings can weaken controls | Policies on permissions, sandboxing and allowlists that users cannot override |
| Isolation | Injected instructions can turn tools against you | An operating-system sandbox, with network access denied or allow-listed by default |
| Repository trust | Project files can change agent behaviour | What loads before trust is confirmed, including in headless runs? |
| Data terms | Prompts and code leave the machine | Training, retention, zero data retention, local transcripts |
| Location | Residency rules and DORA contract terms | Can inference and storage stay in the EU for every surface you use? |
| Evidence | You must show what happened | OpenTelemetry export, audit logs, attributed and signed commits |
| Model choice | Sovereignty, lock-in and cost | Cloud provider routes, gateways, self-hosted models |
| Patching and extensions | Fixes are frequent and add-ons widen reach | Published advisories, enforced updates, allowlists for Model Context Protocol (MCP) servers, plugins and skills |
What are the security risks of AI coding agents?
The main risks are prompt injection that turns the agent’s tools against you, malicious repository content, leaked code and secrets, insecure or invented dependencies, and reviewers who trust output too readily. They matter because the agent acts with a developer’s access to source code, keys and production systems.
In a 2024 joint paper on AI coding assistants, BSI and ANSSI, Germany’s and France’s national cybersecurity agencies, highlight package confusion, where attackers publish malicious packages under names that models hallucinate; indirect prompt injection, such as instructions planted in package documentation; poisoning of training data or model weights; and extensions that can reach internal resources such as logs and mail.
Anthropic publishes Claude Code’s security advisories on GitHub, and four of the 2026 entries show how such risks surface:
- A repository’s settings file could point Claude Code at an attacker’s API endpoint and leak API keys before the user confirmed trust (CVE-2026-21852, fixed in 2.0.65).
- A committed settings file could select the mode that bypasses permission prompts and skip the trust dialog (CVE-2026-33068, fixed in 2.1.53).
- Worktree handling let code run outside the macOS sandbox after a user ran the agent on a malicious repository with prompt injection content (CVE-2026-55607, fixed in 2.1.163).
- Server-managed organisation policy could fail to apply when a stored API key took precedence over enterprise sign-in; settings delivered by mobile device management (MDM) or file were unaffected (CVE-2026-103012, fixed in 2.1.260).
Treat every repository, issue and web page as untrusted input, patch quickly (the fixes reached users on standard auto-update) and check that central policy is in force on each device. Ask every vendor for the same transparency. Our AI agent security guide covers the wider threat model.
How do you secure Claude Code, Codex and other coding agents?
Set controls centrally, isolate execution, keep the network closed by default, review what agents change and record what they do.
Enforce policy centrally. Claude Code’s managed settings and Codex’s managed configuration (requirements.toml) let administrators enforce standards, such as the approval policies Codex users may choose. Claude Code’s interactive terminal and VS Code sessions start by default in auto mode, where a separate classifier model reviews actions and blocks those it judges unsafe; organisations can turn it off. Block modes without safeguards, such as Codex’s --dangerously-bypass-approvals-and-sandbox, which OpenAI marks as not recommended.
Sandbox commands, not just prompts. Claude Code’s working-directory boundary is only a prompt, so an approved shell command can write anywhere the user’s account can, and its deny rules match command text; reliable network limits need its operating-system sandbox. Codex’s default workspace-write mode keeps network access off, isolates commands with Seatbelt on macOS or bubblewrap and seccomp on Linux, and keeps .git and .codex read-only. Require sandboxing through policy and allow only the destinations a task needs. Our guide to OpenAI Codex in the enterprise covers Codex’s sandbox modes, managed requirements and data routes in more depth.
Distrust repositories and headless runs. Claude Code shows a workspace trust dialog in untrusted folders, but a non-interactive -p session shows neither that dialog nor the approval prompt for a project’s MCP servers. In continuous integration (CI), run agents in short-lived containers with narrowly scoped tokens.
Use cloud agents’ guardrails. GitHub restricts Copilot cloud agent’s internet access with a firewall, limits it to one branch, stops it approving or merging its own pull requests, bars the requester from approving them and, by default, holds Actions workflows until someone with write access approves them. Claude Code keeps GitHub credentials out of cloud session VMs; Codex removes cloud secrets before the agent phase, which runs offline unless you enable internet access.
Govern extensions. Anthropic reviews connectors before listing them in its directory but does not security-audit MCP servers. Allowlist approved servers, as our MCP security guide explains, and review skills like code (see how to govern agent skills).
Record what agents do. Claude Code can export usage data through OpenTelemetry. Copilot cloud agent signs its commits, lists the requesting developer as co-author and links each commit to a session log; administrators also see audit log events. Keep human review and branch protection for every agent change.
Where do your code and prompts go?
To the model provider, at minimum: prompts, files the agent reads, command output and responses leave the machine. The rest depends on plan, sign-in and provider route.
- Training. Anthropic does not train generative models on code or prompts sent to Claude Code under commercial terms (Team, Enterprise, API and third-party platforms) unless the customer opts in. OpenAI does not train on business data from ChatGPT Business, Enterprise, Edu or its API Platform by default.
- Retention. Claude Code commercial data is kept for 30 days as standard, with zero data retention for qualified Claude for Enterprise accounts. ChatGPT Enterprise administrators set retention; OpenAI may keep API inputs and outputs for up to 30 days, with zero data retention for eligible endpoints. Check which plan covers each developer’s Codex use.
- Local copies. Claude Code keeps session transcripts in plaintext on the developer’s machine for 30 days by default. They can hold code, secrets and personal data, so cover them in endpoint and retention rules.
- Location. Anthropic’s own API runs inference in the US or globally and stores workspace data in the US; on Amazon Bedrock and Google-managed Claude models in Google Cloud, your chosen endpoint sets the region. OpenAI offers European data residency to eligible API customers and new ChatGPT Enterprise and Edu workspaces, with in-region inference for eligible Enterprise and Edu customers, covering the Codex app and CLI but not Codex Web. GitHub’s EU residency for Copilot applies to GitHub Enterprise Cloud with data residency, through a policy that is off by default.
- Integrations. Data sent to MCP servers, external apps or web search follows those providers’ terms, so assess them too.
What do EU rules require when developers use coding agents?
No EU law targets coding agents, but several apply. Which bind you depends on your sector, role and products; this is general information, not legal advice.
- EU AI Act. Coding agents are generally not high-risk: the Commission’s high-risk use cases, such as employment, education, essential services and law enforcement, do not include software development. AI literacy applies: under Article 4, as amended in 2026, providers and deployers take measures to support the AI literacy of staff using AI on their behalf, without a mandated level. An internal training record is enough, and national market surveillance authorities have supervised the duty since 2 August 2026.
- GDPR. Repositories, tickets and logs often hold personal data, from commit authors’ email addresses to customer records in test fixtures. Sending them to a model provider is processing, usually by a processor: require sufficient guarantees under a contract (Article 28), security appropriate to the risk (Article 32), minimal personal data in the agent’s context (Article 25) and an assessment of any transfer outside the EEA (Chapter V).
- NIS2. Through national law, essential and important entities must take risk-management measures that include supply chain security and security in system acquisition, development and maintenance, with vulnerability handling (Article 21(2)(d) and (e)). A coding agent is a supplier, a development tool and a privileged identity at once.
- DORA. Since 17 January 2025, financial entities remain fully responsible when they use ICT third-party services. A coding agent service generally is one: record it in the register of information (Article 28) and make the contract state where it is provided and where data is processed and stored (Article 30). See DORA, NIS2 and the AI Act in financial services.
- Cyber Resilience Act. If you place products with digital elements on the EU market, code and dependencies an agent adds are part of them. Manufacturers must exercise due diligence on third-party components, including open-source ones (Article 13(5)), and since 11 September 2026 must report actively exploited vulnerabilities and severe incidents, with an early warning within 24 hours (Article 14). The main obligations apply from 11 December 2027.
How do you roll out coding agents across engineering?
Start with a risk analysis and a sanctioned option, then widen access as controls prove themselves. BSI and ANSSI recommend a systematic risk analysis before introducing AI tools, enterprise accounts rather than employees’ private ones, and clear rules on which tools may be used with which data.
- Assess. Classify repositories by sensitivity, list the secrets and systems an agent could reach and review vendor contract terms on data use.
- Set defaults centrally. Configure permission modes, sandboxing, network and extension allowlists and minimum versions before issuing seats.
- Pilot. Start with a few teams and lower-sensitivity repositories.
- Measure. The agencies found no conclusive evidence of productivity gains and recommend an evaluation phase with measurable goals and key figures, such as new code volume and security team workload.
- Scale assurance. They advise growing application security and DevSecOps capacity in line with output, and keeping developers responsible for checking generated code.
- Train and document. Cover prompt injection, secrets and review duties, keep the training record as AI literacy evidence, and document which AI tools produced which code, which the agencies say helps auditors.
- Monitor and patch. Follow advisories, enforce updates and review telemetry for blocked actions and unexpected destinations.
Can you run a coding agent on private models?
Yes, if the agent lets you set its model endpoint and your inference server offers the API it expects. Claude Code is built on Anthropic’s APIs and reaches Claude through Anthropic, Amazon Bedrock, Google Cloud or Microsoft Foundry. For open-weight models on your own GPUs, choose an agent that supports them: OpenCode, for example, discovers local Ollama, LM Studio and vLLM servers and accepts other OpenAI-compatible runtimes as custom providers.
You then own more of the stack: test tool calling with the exact model and serving engine, and add the sandbox, network policy and logging the agent lacks. Our guide to running OpenCode with local models covers the set-up, and the LLM GPU sizing calculator estimates the hardware.
How SysArt helps
SysArt helps engineering and security leaders adopt AI coding agents with controls designed in. We assess tools against your policies, configure central policy, sandboxing, network rules and logging, and map the evidence to the AI Act, GDPR, NIS2, DORA and the Cyber Resilience Act. Where code must stay on infrastructure you control, we design the private-model route. Read more about our enterprise AI agents work.
Featured image by Christopher Gower on Unsplash.
Frequently asked questions
What are AI coding agents?
AI coding agents are tools that use a language model to carry out software tasks rather than suggest single lines. They read a repository, plan a change, edit files, run commands and tests, and repeat until the task is done or handed back to a developer. Claude Code, OpenAI Codex, GitHub Copilot cloud agent and OpenCode are examples. They run on developers' machines, in vendors' clouds or in pipelines.
What is the best AI coding agent for an enterprise?
There is no best AI coding agent in general. Compare candidates on central policy controls, sandboxing and network isolation, behaviour with untrusted repositories, data use and retention terms, EU processing options, audit evidence, model choice and how quickly the vendor fixes security flaws. Then pilot the shortlist on your own repositories, with normal code review, and measure the results against goals set in advance.
Is Claude Code secure enough for enterprise use?
It can be, once configured. Claude Code offers managed settings that administrators enforce, permission modes, an operating-system sandbox for shell commands, OpenTelemetry export and, for qualified Claude for Enterprise accounts, zero data retention. Interactive terminal and VS Code sessions start in auto mode, where a classifier model reviews actions, so decide centrally whether to allow it. Keep versions current: 2026 advisories include fixed flaws that let malicious repositories get around the trust dialog.
How do you secure OpenAI Codex?
Keep Codex in its sandbox: the default workspace-write mode leaves network access off, and Seatbelt on macOS or bubblewrap with seccomp on Linux isolates commands. Use managed configuration to restrict which approval policies developers may choose, and do not allow the --dangerously-bypass-approvals-and-sandbox mode, which OpenAI marks as not recommended. In Codex cloud, secrets are removed before the agent phase, which runs offline unless you enable internet access.
OpenCode vs Claude Code: which should an enterprise choose?
Decide by where your models must run. Claude Code is built on Anthropic's APIs and reaches Claude through Anthropic, Amazon Bedrock, Google Cloud or Microsoft Foundry, with managed settings for central policy. OpenCode can discover local Ollama, LM Studio and vLLM servers and use other OpenAI-compatible runtimes, so it suits open-weight models on your own infrastructure. Either way, add sandboxing, network limits, code review and logging.
Do AI coding agents fall under the EU AI Act?
Yes, but usually lightly. Software development is not among the high-risk use cases the European Commission lists, so coding agents are generally not high-risk systems. The AI literacy duty still applies to organisations whose staff use them: take measures to support those people's AI literacy; an internal record of training is enough as evidence. National market surveillance authorities have supervised this duty since 2 August 2026. The GDPR, NIS2 and other laws apply alongside it.
What is coding agent governance?
Coding agent governance is the set of decisions, controls and records that keep AI coding agents within agreed limits: which tools and models are approved, which repositories and data they may touch, which permission, sandbox and network settings are enforced centrally, which extensions are allowed, how agent changes are reviewed, how activity is logged and how vendors' security fixes are applied. It produces the evidence auditors and regulators ask for.
Sources
- Anthropic: Claude Code documentation, Security · checked 30 October 2026
- Anthropic: Claude Code documentation, Data usage · checked 30 October 2026
- Anthropic: Claude Platform documentation, Data residency · checked 30 October 2026
- GitHub: Claude Code security advisories (anthropics/claude-code), including CVE-2026-21852, CVE-2026-33068, CVE-2026-55607 and CVE-2026-103012 · checked 30 October 2026
- OpenAI: Codex documentation, Agent approvals & security · checked 30 October 2026
- OpenAI: Enterprise privacy at OpenAI (updated 8 January 2026) · checked 30 October 2026
- OpenAI Help Center: Data residency and inference residency for ChatGPT · checked 30 October 2026
- GitHub Docs: Risks and mitigations for GitHub Copilot cloud agent · checked 30 October 2026
- GitHub Docs: GitHub Copilot with data residency (GitHub Enterprise Cloud) · checked 30 October 2026
- OpenCode documentation: Providers · checked 30 October 2026
- BSI and ANSSI: AI Coding Assistants, joint recommendations (published 4 October 2024) · checked 30 October 2026
- European Commission: AI Act regulatory framework, high-risk use cases and timeline (updated 19 October 2026) · checked 30 October 2026
- European Commission: AI literacy, questions and answers (updated 20 October 2026) · checked 30 October 2026
- EUR-Lex: Regulation (EU) 2016/679, General Data Protection Regulation · checked 30 October 2026
- EUR-Lex: Directive (EU) 2022/2555 (NIS2), Article 21 · checked 30 October 2026
- EUR-Lex: Regulation (EU) 2022/2554 (DORA), Articles 28 and 30 · checked 30 October 2026
- EUR-Lex: Regulation (EU) 2024/2847, Cyber Resilience Act (23 October 2024), Articles 13, 14 and 71 · checked 30 October 2026