Definition · AI agents
Coding agent
A coding agent is an AI agent that does software work on its own. A coding agent reads a code repository, edits files, runs commands such as tests, and can open a pull request. It has the access of its developer, container or cloud machine. Thus its commands can use files, credentials and the network.
Last reviewed
Key points
- A coding agent edits code and runs shell commands to finish a task. Claude Code, OpenAI Codex and GitHub Copilot cloud agent are examples.
- The agent has the access of its user or its host. Its commands can use files, keys and the network.
- Prompt injection is one risk. In a 2025 study, attacks on Cursor and GitHub Copilot ran malicious commands in a maximum of 84% of tries.
- Vendors use the same controls: a sandbox, an approval before risky steps, and a human check of each change.
- In August 2025, malicious Nx packages told installed coding agents to skip their permission prompts and find secrets.
How a coding agent works
A coding agent is an AI agent with a file editor, a shell and git as its tools. Control software sends the task and the code to a language model. The model selects a step, the control software does it and sends back the result.
A typical task has these steps:
- Read the issue and the files that it touches.
- Edit one or more files.
- Run the tests and read the output.
- Repair what fails and run the tests again.
- Commit the change and open a pull request.
Why coding agents are a security risk
A coding agent runs commands as its usual work. Thus text that changes its plan can become code execution on the host. The agent has the access of its user: source code, cloud keys, SSH keys and the network.
Three risks come from this:
- Prompt injection. An issue, a README or a web page can contain instructions. OpenAI says prompt injection “can cause the agent to fetch and follow untrusted instructions”.
- Unexpected code execution. The AIShellJack study (September 2025) tried 314 attack payloads on Cursor and GitHub Copilot. Malicious commands ran in a maximum of 84% of tries.
- Abuse by local malware. Malware on the machine can start the agent and use its access.
In practice
Where coding agents operate
| Product | Where it operates | Default limits (vendor documentation, October 2026) |
|---|---|---|
| Claude Code | Terminal, IDE, desktop app, browser, cloud VM | Auto mode: a classifier model examines each step. Manual mode: starts read-only and asks before edits and commands |
| OpenAI Codex | Local CLI and cloud | Network access off. Sandbox modes read-only, workspace-write, danger-full-access |
| GitHub Copilot cloud agent | Ephemeral cloud environment | Pushes to one branch. A human examines and merges each draft pull request |
Coding agent scores on SWE-bench
The first SWE-bench study (October 2023) used 2,294 GitHub issues from 12 Python projects. The best model, Claude 2, solved 1.96%. The SWE-agent paper (May 2024) is a different result. It gave a model a custom interface to view and edit files. SWE-agent reached a pass@1 rate of 12.5% on SWE-bench.
Four controls that vendors use
- A sandbox for files and network. Anthropic says a good sandbox must isolate the two. Without network limits, a compromised agent can send out SSH keys.
- An approval before risky steps. Claude Code does not auto-approve
curlorwgetby default. In Manual mode, it asks before it runs them. Codex has the approval policieson-request,neverandgranular. - Credentials kept away from the agent. In Claude Code cloud sessions, GitHub credentials do not go into the session VM.
- A human check before merge. GitHub makes a human examine and merge each draft pull request from Copilot cloud agent. By default, CI workflows do not start until a person approves them.
The Nx advisory says that the stolen data went to a public s1ngularity-repository in the GitHub account of the user.
Trade-offs
Each approval makes the developer slower, and many approvals cause approval fatigue. Anthropic reports that its sandbox cut permission prompts by 84% in its internal use (October 2025). This is a vendor figure for its own staff.
The alternative is a flag that skips all approvals. The Nx malware used these flags. A team that permits such a flag needs a sandbox around the agent, with no secrets and no open network.
Questions and answers
What is the difference between a coding agent and a code assistant?
A code assistant suggests code, and a person accepts it and runs it. A coding agent does the steps itself. It edits files, runs tests, reads the output and tries again. GitHub Copilot cloud agent, for example, makes changes "in the background" and opens a draft pull request.
How do you operate a coding agent safely?
Limit what the agent can use, not only what it is told. Put it in a sandbox that isolates files and network. Keep network access off by default. Get an approval before risky commands. Keep credentials out of its environment. Make a human examine and merge each change.
Sources
- Claude Code overviewAnthropic
- Claude Code securityAnthropic
- Making Claude Code more secure and autonomous with sandboxingAnthropic, 20 Oct 2025
- Agent approvals and securityOpenAI
- About GitHub Copilot cloud agentGitHub
- Risks and mitigations for GitHub Copilot cloud agentGitHub
- SWE-bench: Can Language Models Resolve Real-World GitHub Issues?arXiv (Jimenez et al., ICLR 2024), 10 Oct 2023
- SWE-agent: Agent-Computer Interfaces Enable Automated Software EngineeringarXiv (Yang et al., NeurIPS 2024), 6 May 2024
- "Your AI, My Shell": Demystifying Prompt Injection Attacks on Agentic AI Coding EditorsarXiv (Liu et al.), 26 Sep 2025
- Malicious versions of Nx and some supporting plugins were publishedNx (nrwl) on GitHub, 27 Aug 2025
- Supply Chain Security Alert: Popular Nx Build System Package Compromised with Data-Stealing MalwareStepSecurity, 27 Aug 2025
Guides that use this term
Related topics
In the news
- Gemini 4 Argon leads IBM Java migration test at 75.2%
- Changed variable names made AI agents write code that is not safe
- AOS-Bench shows coding agents lose up to 23 points on stacked work
- OpenAI repairs faults that let AI agents hide from its monitors
- Microsoft open-sources Agensh for 1,024 agents at one time
- A study finds a coding agent harness can add 3 times the cost
- Google releases Data Agent Kit to all users with 2 types of control
- Parts with hidden test names were defective in 80.6% of agent runs
- Snowflake lifts a small coding agent from 47.4% to 62.0% in tests
- OpenCode bug lets a bad MCP server start code on Windows
- Vercel Labs releases fx, an open source coding agent
- BeyondTrust says each AI instruction sends almost 10 commands
- The repository has more effect on agent pull requests
- Cloudflare leads tsrs, a fast Rust checker for TypeScript code
- VS Code 1.137 gives each AI agent a container
- Microsoft releases Scope, an open source test tool for coding agents
- Fake news has 62% success against trading agents, injection only 14%
- New step in the Apex Accelerator npm malware campaign
- Text in a repository made coding agents propose a dangerous rule
- AI agents can replay a software fault with Antithesis and test a repair
- Coding agents can copy some biological AI tools with no internet access
- A new test bed compares 5 parts of the set-up for teams of coding agents
- OutSystems makes Agent Experience available for AI coding agents
- Sonnet 5.5 costs 77% less for each task at the xhigh level than at max
- A new score shows good data to train AI coding agents
- Reward hacking can move from one coding agent to other agents
- The AI tool REA has more than 10,400 stars on GitHub
- Arbiter gives 152 results for the system prompts of 3 coding agents