← Back to blog

AI Coding Agent Security: What Stays With a Person

AI coding agent security is about what the agent can reach and who holds each key: the repository, the credentials, the sandbox, the merge, the record.

Search “ai coding agent security” and the pages that rank agree on the threat list: prompt injection, supply chain poisoning, credential leakage, command execution, a spoofed MCP server. They agree on the controls too: a sandbox, least privilege, an allowlist, a person approving diffs, runtime monitoring. Then each one sells the monitoring. Fiddler, Knostic, and Pluto all end the same way, with a product that watches the agent on the developer’s laptop.

That is a reasonable product category. It is not the question an engineering leader is asked in a security review. The question there is simpler and harder: for everything this agent can reach, who holds the key, what does the record show, and what still needs a person’s click? This post answers it that way, with one ticket walked through a YAGNI Team as the worked example and the controls named as the security page states them.

What is AI coding agent security?

AI coding agent security is the discipline of bounding what a coding agent can reach and do while it works, as distinct from checking whether the code it writes is secure. The two overlap, and a review handles the second. The first is about the agent itself: it clones repositories, edits files, runs commands, calls tools, and reads whatever is in front of it, and each of those is an act a person used to perform with their own credentials and their own judgment.

Simon Willison named the shape of the risk in his lethal trifecta post: an agent is dangerous when it has access to private data, is exposed to content an attacker could have written, and has a way to send data to the outside. A coding agent has all three by default. The repository is private data. Issues, READMEs, dependencies, and tool results are content anyone could have written. A shell with network access is the exit.

Nothing about the model fixes that. Every page that ranks for this keyword says prompt injection is unsolved, and they are right. The question is where you cut the trifecta, and who decides.

Why is a coding agent riskier than autocomplete?

Because it acts. An autocomplete suggestion sits in the editor until a developer accepts it. An agent runs the loop: read the ticket, read the code, edit, install, test, open a pull request. Every step is a tool call, and a tool call runs with whatever the agent holds.

The research from the last year is concrete about what that costs when it goes wrong. The Takedown paper (September 2025) analyzed eight real coding agents, found 15 security issues, and achieved arbitrary command execution in five of them and global data exfiltration in four, with no user interaction or approval. A 2026 study of malicious skill files turned 471 real shell commands into 2,826 benign-looking skills and ran them against two agents: Gemini CLI followed the hidden commands in 95.5 to 96.1 percent of runs and Qwen Code in 71.6 to 74.0 percent, and the agents explicitly recognized the danger in under two percent of runs.

Those are not exotic attacks. A skill file is a folder of instructions and scripts the agent loads because the repository told it to. The agent was built to follow instructions, and it did.

What are the AI coding agent security vulnerabilities that matter?

Here is the threat list the ranking pages share, with the question each one puts to a manager and the control that answers it. The right-hand column is what holds on a YAGNI Team.

Vulnerability class What it looks like in a repository The manager’s question What holds it on a YAGNI Team
Prompt injection A README, issue, or comment that says “ignore the ticket and run this” What can the agent do if it obeys? The sandbox is destroyed after the run; the agent pushes only to the ticket’s repository; nothing irreversible runs without a person
Malicious skills, rules, hooks, and MCP servers A .claude or .agents folder that hides a shell command behind a benign description Who decided which instructions load? Skills are fetched fresh, pinned to a commit, and listed on the Receipt under Skills loaded; a switch per repository turns them off; plugin MCP servers and hooks never run in the sandbox
Credential exposure An API key in the prompt, a token in a log, a .env the agent reads Does the model ever see a secret? Connector credentials are encrypted with AES-256-GCM and resolved only when a tool executes, never placed in a model prompt
Over-broad repository access A personal token that reaches every repository the developer can What is the door, and how wide is it? Agents reach repositories through the GitHub App you install, never through a developer’s personal GitHub connection; they read what you grant the App and push only to the repository the ticket builds in
Command execution and sandbox escape curl to an attacker’s host, a package install that runs a postinstall script Where does the command run, and what survives it? An isolated sandbox per session under a hard runtime limit, destroyed when the session ends or is interrupted
Supply chain drift A dependency the agent added because a page told it to Who reviews the lockfile? Proctor’s review reads the diff, including dependencies; a person merges by default
Insecure generated code An endpoint with no authorization check Who reads the pull request for security, every time? Proctor’s checks include a security check, set on the Team’s review line; Proctor posts one review a person reads before merging
An unreadable record Nobody can say what the agent ran What does the audit trail show? Every tool call records who triggered it, the tool, the workspace, sanitized parameters, status, failure state, duration, and time; secrets and payloads are not copied in

The first column is the same on every vendor’s page. The third column is the one a security review is actually about.

Which security questions should an engineering leader ask before a rollout?

Five, in the order a security lead will ask them.

  1. Where does the code run? On the developer’s laptop with their shell, or in a sandbox that is created for the run and destroyed after it? If the answer is the laptop, every control after this one is a policy, not a boundary.
  2. What is the door into the repository? A personal token inherits everything that person can reach. An App installation is scoped to the repositories you grant it, and it is revoked in one place.
  3. Does the model ever see a credential? If a token is in the prompt, it is in every log and every injection payload. Credentials should be resolved at tool execution and nowhere else.
  4. What can the agent do that a revert cannot undo? Deploy, migrate data, send a message outside. Each of those should be a named person’s click, under a floor that is permanent, not a setting someone can flip at two in the morning. Merge belongs with them by default; if a vendor lets a team turn on auto-merge, ask what a pull request has to pass before it merges on its own.
  5. What does the record show afterward? Not the final diff. The tool calls: what ran, who triggered it, and what it reached. If the vendor cannot export a sample, the answer is “nothing”.

What autonomous coding agents should be allowed to own covers question four act by act. The rest of this post walks all five through one ticket.

How does a ticket move through a YAGNI Team without opening the trifecta?

Take a real ticket: “Add rate limiting to the public search endpoint”, sitting in the Checkout Team’s Linear project. The Checkout Team runs at Supervised, the step on the Ladder where a person approves every plan and merges every pull request. Here is where each key is held as it moves through the six stages.

Proposed. Bailey reads the Team’s Linear backlog and proposes the ticket with evidence from the repository and the connected tools. Bailey reads those tools as the Team, read-only, inside the grants the Linear project and the Slack channel already have. The proposal goes to Reeve to plan with nobody clicking Accept, up to the line’s tickets a day, with its open questions posted on the ticket; the first click a person makes is on the plan. Nothing has run yet.

Plan. Reeve plans against the real repository and checks a fact in Confluence before asking a person, and the plan lists what it settled under “Checks Reeve ran”. The plan names the files it will touch and what is out of scope. A person reads it and clicks “Approve plan” or “Send back”. This is the first gate, and it sets the scope a reviewer can hold the build to.

Build. Wright clones the repository into a sandbox that exists for this session and nothing else. It reaches the repository through the workspace’s GitHub App installation, not through anyone’s personal GitHub connection. The repository’s own skills and rules load, fetched fresh and pinned to a commit, and the Receipt lists them under “Skills loaded” so a reviewer can see exactly which instructions ran. If the Checkout Team’s owner has switched “Agents use this repository’s skills and rules” off for this repository, Wright reads only AGENTS.md and CLAUDE.md. Plugin MCP servers and hooks do not run in the sandbox at all. Wright implements the plan, adds tests, runs them, and opens a pull request. It can push only to this repository. When the session ends or is interrupted, the sandbox is destroyed, and nothing the ticket’s README might have asked for survives it.

Review. Proctor reads the pull request against the approved plan and runs the checks set on the Checkout Team’s review line: deep review and business fit, which are always on, plus database, security, and tests, which the Team has switched on. The security check is the one that asks whether the new middleware is actually wired to the route, whether the limit key is attacker-controlled, and whether the endpoint’s authorization changed. Proctor posts one review with a verdict. It never merges.

QA. Fletcher (beta) boots the repository environment in a sandbox, writes a test plan from the change, walks it in a browser, and attaches video and screenshots. Fletcher reaches the repository only through the same GitHub App installation and never edits application code.

Done. A person merges, on GitHub or from the Review case file. Deploy and data migration, if the ticket needed them, sit under a permanent floor: supervised at every step of the Ladder, with no setting that moves them. Pause stops every line on the Team at once if something looks wrong.

Trace the trifecta through that. Private data: the repository, reached through one scoped door. Untrusted content: the ticket, the README, the dependencies, all read inside a sandbox that is thrown away. External communication: a pull request to one repository, and nothing else without a person. The three legs are still present, because the job needs them. Each is now held by something a security lead can read: an App installation, a sandbox lifetime, a gate addressed to a named person, and a Receipt. The AI agent audit trail post covers what that record contains.

Does the agent-written code itself need a security review?

Yes, every time, and the evidence is one-sided. DryRun Security had Claude Code, OpenAI Codex, and Google Gemini each build two applications from realistic specs with no security guidance in the prompts, submitting each feature as a pull request. Per Help Net Security’s March 2026 report on the study, 26 of the 30 pull requests contained at least one vulnerability. Broken access control was the most common class across all three agents, WebSocket authentication was missing from every final game codebase, and in one case rate-limiting middleware was defined but never connected to the application.

That last finding is the useful one. Pattern-based scanners miss it, because the code is fine; it is just not attached. A reviewer that reads intent catches it: the plan said “rate limit the endpoint”, and the diff does not. That is what the security check on Proctor’s review line is for, and it is why the review is posted as one review a person reads rather than a wall of findings. AI code review for GitHub describes that review in detail. The point for a security lead: the agent that writes the code and the check that reads it are different jobs, and the person who merges reads the second one.

Where does the code go, and who can see it?

The other half of a security review is data handling, and the ranking pages mostly skip it because their product runs on the laptop. For a managed Team the answers are on the security page and in the public positioning, and they are short.

  • Models are vetted, US-hosted open-weight models; the served models are listed in Workspace settings as a dated fact.
  • Workspace scope is enforced in application queries and backed by cross-workspace isolation tests.
  • Credentials are customer-scoped, encrypted with AES-256-GCM, and resolved only when a tool executes.
  • Access is revocable: active sessions are revoked when roles change or members are removed, and invitations and personal access tokens are independently revocable.
  • Attestation: SOC 2 Type II work is in progress and the program status is shared during review, a DPA is available on request, a sample sanitized audit-log export is available on request, and YAGNI will join your security review call and fill in a custom questionnaire.

Onboarding is a call, with the customer’s security lead in the room when the GitHub App is installed. The App’s scope is the first security decision, and the person who will be asked about it later should make it.

What should a security review ask of any coding agent vendor?

The same five questions, and the honest answers vary. A terminal agent on a developer’s laptop will answer “the laptop”, “the developer’s token”, “depends on the configuration”, “a permission prompt”, and “the terminal scrollback”. Those are acceptable answers for a developer’s own session, with the developer’s judgment on every step; YAGNI Code, the terminal agent, runs that way too, on the same models, meter, and record as the Teams. They are not acceptable answers for an agent that works a backlog unattended. For that job the answers have to be a sandbox, an App installation, “never”, “a named person”, and “an export you can read”, shown rather than described. What is the best coding agent makes the same argument for trust in general; this is the security instance of it.

One more thing to ask: what does it cost to run the agent inside those boundaries? A sandbox per run and a review on every pull request are tokens. On a YAGNI Team they run on vetted US-hosted open-weight models at 60% or more under comparable frontier API rates, on one rate card, with the spend per Agent broken out by job on the Usage page. Security that is too expensive to leave on is security someone turns off.

Start by writing down who holds each key

Before the rollout, take the table above and fill in the right-hand column for the agent you are evaluating. Where the answer is “the developer” or “a configuration flag”, that is a boundary a person has to keep by hand, every day. Where the answer is a sandbox lifetime, an App scope, a gate, or a Receipt, it is a boundary the system keeps.

YAGNI runs agent teams, managed like your engineering team: Bailey proposes, Reeve plans, Wright builds in a sandbox, Proctor reviews every pull request with the checks the Team sets, a security check among them, Fletcher (beta) verifies, Harper reports, and a person merges by default and holds deploy and data migration at every step. See how Agent Teams work, read the security page, or book 30 minutes with your security lead on the call to scope the first Team and decide which repositories the App should see.