AI Coding Assistants Are an Unmanaged Endpoint: What Cursor's Auto-Execution Flaws Teach the NIST AI RMF
Cursor and its peers turned the code editor into an autonomous agent — one that reads repositories, fetches dependencies, and executes code with minimal human confirmation. Security researchers have disclosed multiple…
Chase Sutphin
Founder, AI Governance Solutions · Enterprise Security Engineer
Executive Summary
Cursor and its peers turned the code editor into an autonomous agent — one that reads repositories, fetches dependencies, and executes code with minimal human confirmation. Security researchers have disclosed multiple flaws in this class of tool: prompt injection hidden in repo files that triggers command execution, auto-run settings that bypass user approval, and sandbox escapes that let a "read this codebase" task turn into arbitrary code running on a developer's machine. Most organizations have no governance process for this at all — it isn't tracked as software, isn't scoped in AppSec review, and isn't covered by existing AI policies written for chatbots. The NIST AI RMF gives us a way to name this gap and close it. This guide maps the risk through Govern, Map, Measure, and Manage, using a security engineer's read on what's actually exploitable.
The Real-World Reality
AI coding assistants adopted faster than any tool I've watched move through engineering orgs — faster than containers, faster than IaC. Developers installed Cursor, Copilot, Windsurf, and similar tools on their own laptops, often before security or IT knew they existed. That's shadow IT with execution privileges.
Here's the part that gets my attention as a security engineer: these aren't passive autocomplete tools anymore. Cursor's agent mode can clone a repo, read its contents, install packages, and run shell commands — often with an "auto-run" or "YOLO mode" setting that skips the human-approval step entirely. Researchers have disclosed cases where a poisoned repository — a malicious instruction buried in a README, a config file, or an MCP server response — gets interpreted by the agent as a command to execute. That's indirect prompt injection turned into remote code execution, and it happens on a developer's actual workstation, often with access to production credentials, internal repos, and CI/CD tokens.
Compare that to how we treat a new open-source dependency. Most mature AppSec programs run SCA scanning, license checks, and a review gate before a package ships. AI coding assistants get none of that. They're installed as an IDE plugin, they auto-update, and they have standing permission to read your entire codebase and execute commands — with a much larger and less predictable attack surface than a pinned npm package.
Traditional approaches fail here for a simple reason: endpoint security and AppSec tooling were built to catch known malware signatures and static code patterns, not an agent whose behavior changes based on the text it reads. A poisoned repo doesn't need to smuggle in a malicious binary. It just needs to write a sentence the model will treat as an instruction. That's a fundamentally different threat model, and most governance programs — AI or otherwise — haven't caught up to it yet.
NIST AI RMF Application
I'm working through the NIST AI RMF in the open, and AI coding assistants are one of the clearest cases I've found where the framework's four functions map directly onto a concrete, exploitable technical risk. Here's how I'd walk it.
Govern: Who owns this, and does a policy even exist?
Govern is where most organizations are starting from zero. Ask the honest question: is there a named owner for "AI tools with code-execution privileges," or does this fall into the gap between security, IT, and engineering leadership?
GOVERN 1.1 calls for policies, processes, and procedures that address AI risk across the lifecycle. In practice, that means:
- A written policy on which AI coding assistants are approved, and under what configuration (auto-run off by default, sandboxed execution required, no direct access to production credentials).
- A designated risk owner — not "engineering will figure it out," but a specific role accountable for approving new AI dev tools the way you'd approve a new SaaS vendor.
- An intake process before a tool like Cursor gets installed org-wide, not after someone notices it's already on 200 laptops.
The common pitfall here is treating AI coding assistants as a productivity decision instead of a security decision. Engineering leadership picks the tool for velocity; security finds out when a pen test or an incident report surfaces it. GOVERN 2.1 (roles and responsibilities) and GOVERN 3.2 (third-party risk) both apply directly — Cursor is a third party with execution access to your source code, and it needs to be evaluated the way you'd evaluate any vendor with that level of access.
If you're in a regulated environment — healthcare, finance, anything touching CUI or FCI — Govern is also where you decide whether AI coding assistants are permitted in scope for regulated codebases at all, or restricted to non-sensitive repos only. That's a business decision informed by risk, and it needs to be made deliberately, not by default.
Map: What's actually in your environment, and what can it touch?
Map is about context — understanding the specific system, its use case, and its risk surface before you try to measure or manage anything. This is where the security engineer's instincts matter most, because Map is really an asset-inventory and attack-surface problem wearing an AI governance label.
Start with discovery. You cannot govern what you don't know exists. Run an inventory:
- Which AI coding assistants are installed across engineering, and in what configuration?
- Which of those tools have agentic capabilities — code execution, file system access, shell command access, MCP server connections — versus simple autocomplete?
- What credentials, tokens, and secrets are reachable from the machines running these tools?
- Which repositories are these tools pointed at — internal proprietary code, customer data pipelines, OT/ICS-adjacent codebases, third-party open source?
MAP 1.1 asks you to establish the context of use. For a coding assistant, that context includes the blast radius: a developer laptop with agent-mode Cursor installed and access to a CI/CD pipeline isn't just a productivity tool anymore — it's a privileged endpoint that can push code, read secrets, and execute arbitrary commands based on text it encounters in a repo.
MAP 2.3 — third-party software and data — is the category that most directly captures the poisoned-repo scenario. Every external repository your team clones, every open-source dependency, every MCP server your agent connects to is now a potential injection vector. That's not hypothetical: security researchers have shown that a malicious instruction embedded in a repo file — something as unremarkable as a comment or a config value — can be interpreted by an auto-running agent as a command. If your Map exercise doesn't explicitly flag "external repos as an AI attack surface," you've mapped the wrong boundary.
This is where the OT lens helps, even though coding assistants aren't OT tools themselves. In OT/ICS security, we don't trust a device just because it's on the network — we segment, we apply the Purdue model, we assume east-west traffic needs inspection. Apply the same instinct here: don't trust a coding agent just because it's "just helping write code." Segment what it can reach. A coding assistant with access to a build server that touches OT-adjacent firmware repos is a very different risk than one scoped to a marketing site's frontend.
Common pitfall in Map: scoping the assessment to "the AI tool" instead of "the AI tool plus everything it's connected to." The risk isn't Cursor in isolation — it's Cursor plus your GitHub org, your npm registry, your MCP servers, and your CI/CD secrets store, all reachable from one auto-running agent.
Measure: What are you actually testing for?
Measure is where most organizations either skip the step entirely or default to "we ran it and it seemed fine." That's not measurement — that's a vibe check.
For AI coding assistants, Measure should include:
- Sandbox validation. If the tool claims sandboxed execution, test the sandbox. Sandbox-escape flaws have been publicly disclosed in this category of tool — don't take the vendor's isolation claims at face value. This is a place where offensive-security thinking is directly useful: think about how you'd try to break out of the sandbox, then check whether that path is actually closed.
- Prompt injection testing. Build test repos with embedded instructions in READMEs, config files, and comments, and observe whether the agent executes them without human confirmation. This is functionally the same discipline as testing for injection vulnerabilities in a web app — you're testing whether untrusted input can control execution.
- Configuration audit. Confirm auto-run/YOLO-mode settings are actually disabled fleet-wide, not just disabled by default with users free to flip them on. Settings drift is a real problem — check it periodically, not once.
- Credential exposure testing. Verify what happens if the agent is compromised: what secrets, tokens, and repo access does that compromised session actually have?
MEASURE 2.7 (AI system security and resilience) is the direct hook here — it explicitly calls for evaluating systems against adversarial conditions, including attempts to manipulate system behavior. A poisoned repo is exactly that: an adversarial input designed to manipulate the system into unintended action.
The pitfall in Measure is treating this as a one-time pilot evaluation instead of an ongoing control. These tools auto-update. A sandbox that held last quarter may not hold after a vendor pushes a new agent capability. Measure needs to be a recurring cadence, not a launch gate you clear once and forget.
Manage: What do you actually do about what you find?
Manage is where the findings from Map and Measure turn into controls, and where I'd expect most of the real work to land.
Practical controls that map to Manage:
- Least privilege for the agent. Scope the coding assistant's credentials the same way you'd scope a service account — no standing access to production secrets, no broad repo access beyond what the task requires.
- Human-in-the-loop for execution. Require explicit approval before the agent runs shell commands or installs packages, especially against unfamiliar or external repositories. This is the single highest-leverage control against the poisoned-repo scenario, and it's also the setting most likely to get disabled for convenience — watch for that drift.
- Network segmentation for dev environments. The same instinct that governs OT network design applies to AI-agent-equipped dev endpoints: don't let them reach production directly, and don't let a compromised dev laptop become a pivot point into CI/CD.
- Incident response playbook update. Does your IR plan currently account for "AI coding agent executed attacker-controlled code from a poisoned dependency"? If not, that's a gap to close before it's tested by a real incident instead of a tabletop.
MANAGE 2.3 and MANAGE 4.1 — responding to identified risks and monitoring for effectiveness — both apply. This isn't a "set the policy and move on" risk. It's a living one, tied to a fast-moving vendor category that's still shipping new agentic capabilities monthly.
The common pitfall in Manage: writing a policy that bans "unsafe AI coding tools" without defining what unsafe means in technical terms. A policy that says "developers must not enable unattended code execution" is enforceable. A policy that says "use AI responsibly" is not.
Real-World Implementation
Here's how I'd sequence this if I were rolling it out, starting from the assumption that most organizations are at zero maturity on this specific risk today.
Weeks 1–2: Discovery. Inventory every AI coding assistant in use, across every team, including the ones nobody officially approved. Pull this from endpoint management tools, browser extension inventories, and IDE plugin lists — not just a survey, because surveys undercount shadow IT badly. Flag which tools have agentic/execution capabilities versus simple autocomplete.
Weeks 3–4: Configuration audit and quick wins. For every tool identified, check auto-run settings, credential scope, and repo access. Disable auto-run/YOLO-mode fleet-wide as an immediate control while the fuller assessment runs. This is the highest-impact, lowest-effort move available, and it should happen before anything else.
Month 2: Risk assessment and Measure testing. Run the sandbox-validation and prompt-injection tests described above against your approved toolset. Document findings the same way you'd document a pen test finding — severity, exploitability, affected systems. This is also where OT-adjacent codebases, if you have them, deserve explicit scoping: a poisoned repo touching firmware or industrial control code carries a different blast radius than one touching a marketing site.
Month 3: Policy and control rollout. Publish the AI coding assistant policy from Govern, implement least-privilege scoping for agent credentials, and update the IR playbook. Train engineering leads on what the new controls mean for their workflow — this is a change-management effort as much as a technical one.
Ongoing: Recurring measurement. Re-test sandbox and injection resilience quarterly, or after any major vendor update to the tool's agentic capabilities. Track configuration drift on auto-run settings monthly.
Resource requirements: this doesn't need a large team. A security engineer with AppSec and endpoint visibility, partnered with an engineering lead who can speak to actual developer workflows, can run discovery and the initial audit in under a month. The heavier lift is the Measure phase — building and running the adversarial test repos takes deliberate offensive-security thinking, which is exactly the lens that's often missing from generic AI governance efforts.
Success metrics: percentage of AI coding assistants inventoried and configured to policy; time-to-detection for a simulated poisoned-repo test; number of tools with auto-run disabled fleet-wide; whether the IR playbook has been tested against this specific scenario in a tabletop exercise.
Quick-Start Checklist
- [ ] Inventory every AI coding assistant installed across engineering — including unofficial installs
- [ ] Identify which tools have agentic capabilities (code execution, shell access, MCP connections) vs. simple autocomplete
- [ ] Confirm auto-run/YOLO-mode is disabled fleet-wide, not just by default
- [ ] Map what credentials, secrets, and repos are reachable from AI-agent-equipped endpoints
- [ ] Test sandbox isolation directly — don't take vendor claims at face value
- [ ] Build a poisoned-repo test case and check whether it triggers unattended execution
- [ ] Assign a named owner for AI coding assistant risk (not "engineering will handle it")
- [ ] Write a policy that defines "unsafe" in technical terms, not vague language
- [ ] Update your incident response plan to cover a compromised AI coding agent scenario
- [ ] Schedule recurring re-testing — this risk moves as fast as the vendors ship updates
Red flags to watch for: any AI coding tool with execution enabled by default, no named risk owner, no record of when the tool was last re-tested, and any policy document that doesn't mention credential scope or network segmentation.
Next Steps
This is a live example of where the NIST AI RMF earns its keep — not as a compliance checkbox, but as a structure for reasoning through a risk most organizations haven't named yet. I'm still building out my own read on this as I work through the framework, and I'd rather show the process than pretend it's finished.
If you want to see where your organization actually stands on AI governance maturity, you can get a free maturity score and your top 3 risk findings at ai-governance-solutions.com — no credit card, no time limit, instant results.
Ready to find your compliance gap?
Book a free 30-minute discovery call. We'll run through your AI inventory and show you exactly where the exposure is.
Book a Free Discovery Call