r/devsecops • u/theJacofalltrades • Oct 07 '26
Coding agents can now edit files and run commands, so where does IDE security start?
We rolled out AI assistants to about 120 engineers and the policy is two paragraphs long. The assistants can read the repo and write files and some of them shell out. Our appsec review covered the model vendor and nothing about what the agent does locally. Im trying to work out where the control points even are, since the laptop is now executing code nobody reviewed. Secrets in env files are the part keeping me up. How are people scoping this?
38
Upvotes
9
u/Gryeg Oct 07 '26
Mandating a sast plugin that's automatically installed and forces the AI assistant to regenerate insecure code. We also restrict what files the AI assistant can touch and what commands it can run. It's a real balancing act.
3
u/GitSimple Oct 07 '26
Your first control point is that policy. There's no way that is robust enough to be effective. A good framework for an AI agent policy should have at least three parts - Agent permissions (what they can and cannot do, obviously never be able to approve anything...), clear rules for human review (who is responsible for what, the prompter cannot be the approver, etc.), and proactive attention to token use (resource allocation if you're running an internal model).
That said, from what you've provided it sounds like that first part is your current need. Harness engineering should be your initial focus. Chart out what files the agents can actually edit, what commands they can actually run, what tools are connected, what permission levels they have, etc. When you have a clear picture of all the things the agents can do, it's easier to see where the risks are.
SAST/DAST scanning has already been mentioned here so I second that. I'm guessing from the two paragraph policy you don't have a compliance framework to worry about, but if you do, that's another level of scrutiny.
1
u/iamjessew Oct 21 '26
Yeah, this is the part that worries me. A coding agent with shell access is basically an unvetted contractor with your dev laptop's permissions: SSH keys, cloud creds in ~/.aws, prod kubeconfigs, the works. And prompt injection through a README or an issue comment is a very real path.
Practical controls that don't kill the productivity:
Disclosure: I'm a Jozu co-founder. Our free Agent Guard Policy Gateway does command and tool policy on the desktop, if you want something off the shelf: https://jozu.com
1
u/CriticalAd4765 Oct 29 '26
the agent runs with whatever the devs shell holds, so env files come first. which ones hold live keys comes out of a trufflehog pass across laptops or hush security, and those move to sso issued creds that expire or a secret manager cli
1
u/rglauser 27d ago
Secrets out of env files into a vault the agent can't read, and approval before it runs a command.
1
u/Designer_Educator920 11d ago
I'd start by looking at what the agents can actually access and execute, rather than just reviewing the model vendor. Shell commands, file access, and secrets are probably the biggest areas to scope first.
Have you looked into Harden (harden.run)? It checks coding agent tool calls before execution and lets teams enforce policies across developer machines.
Full disclosure, I'm part of the Harden team. It doesn't replace sandboxing or proper credential management, but might help with the execution controls you're looking for.
1
u/danekan Oct 07 '26
Engineers with any High level of Internal only access is now a higher risk than ever. JIT/PAM for break glass, on-demand role access that we all hyped so much two years ago, is a minimum reality. roles need to be studied and broken down more and more now than ever
1
u/_N-iX_ Oct 07 '26
The control surface is broader than the model vendor once an assistant can read files and execute commands locally. File access, command execution and network access can each become separate permission boundaries. Secrets also deserve a different treatment from ordinary source files. A useful setup can keep credentials outside the agent's readable scope while restricting shell and network access, rather than relying on the assistant to avoid sensitive files by instruction.
1
u/endor_aditya Oct 07 '26
(Disclaimer Im from endor labs so we sell stuff related to this)
MDM style deployment onto the dev's machine is key here. Just depending on a single point of enforcement isn't enough anymore, especially with agents going around doing stuff and non-engineers who don't know the proper SDLC suddenly writing a bunch of code.
1
u/materialsec Oct 07 '26
For the secrets worry, they also live outside env files. In a study of 159 Google Workspace orgs, the average had about 2.4 million source code files in Drive, and that code often holds API keys and database credentials. Mailboxes hold credentials from onboarding and reset emails too.
If an engineer connects a coding assistant to their Google account, it reads with that engineer's access, so those secrets are in reach as well. When you map what the agent can touch, include what the engineer's connected accounts expose, not just the local file system.
1
u/TippiestBanjo Oct 08 '26
I think the important distinction is that AI coding agents aren't just writing code anymore. They're also interacting with the software supply chain.
If an agent can run shell commands, it can potentially install dependencies, pull packages from public registries, execute build scripts, and access credentials available to the local process.
So I'd look beyond the IDE itself and consider a few control points:
The dependency part is particularly interesting to me. Using a centralized package repository like ProGet lets organizations control which packages and versions agents can download, rather than relying entirely on the agent to make safe dependency choices.
Of course, that doesn't solve the secrets problem. You'd still need credential isolation, least-privilege permissions, and restrictions on what commands agents can execute.
I suspect the bigger shift is that we need to move some security controls outside the IDE, so they remain effective regardless of whether the code is written by a human or an AI agent.
1
u/zero_backend_bro Oct 08 '26
Devs will just pkill the daemon the second autocomplete lags by 200ms, seen it happen twice this month. Once a secret hits vendor logs you already lost anyway. We gave up on file perms and just point local traffic through
127.0.0.1:8080to regex-scrub aws keys and db uris before outbound requests. Still breaks on weird yaml, but at least creds arent sitting in prompt history.1
u/Army-4234 Oct 13 '26
The biggest concern is giving agents access only the files and commands they actually need.
1
u/radim11 Oct 14 '26
The .env concern is exactly why we created Stashbase. Once an assistant can launch Python or bash, “don’t read that file” needs to hold for those processes too.
We have filesystem rules, Docker sandboxing and scoped API access. Profiles are TOML files, so permission changes can go through Git review. Docs if useful: https://docs.stashbase.dev/agents
1
u/Individual-Shower973 Oct 14 '26
I'm working on this exact problem, so here's how I'd map the control points for 120 engineers, if it's Claude Code:
3 and 4 are what I build Paveo for: one policy file for Claude Code and Codex, running locally on each machine (github.com/paveo-dev/paveo). If you tell me what your two paragraphs say, I'll turn them into a starting policy you can try.
1
u/SheldonP49 Oct 14 '26
It's good to treat the coding agent like untrusted code execution, not just another IDE plugin. Start with least-privilege filesystem access, isolated execution, restricted network access, and keeping secrets out of the agent’s environment by default. Also worth auditing shell commands and requiring approval for sensitive operations.
1
u/FieldCTO_Pubsec_Ping Oct 15 '26
The underlying issue is that the agent is acting by assuming the engineer's full identity with no meaningful boundary. Whatever that engineer can reach, env files, cached tokens, secrets, connected accounts, the agent reaches too, and it does it silently within the same session. Secrets in env files are just the most visible symptom.
The framing that tends to help: treat the agent as a separate principal/identity with its own scoped permissions rather than a proxy for the human who invoked it. This should represent a subset of the human permissions. JIT permission/credential issuance tied to agent sessions, revoked at task completion, gives you an audit trail and meaningfully shrinks the blast radius if something goes wrong. Most teams document what the engineer is authorized to do; far fewer document what the agent inherits when it acts on their behalf, and those are often very different scopes in practice.
1
u/radim11 Oct 19 '26
I think it's good idea to start by treating the coding agent as an untrusted process, not just another IDE extension.
We've been working on exactly this with Stashbase. We run Claude Code and Codex in Docker sandboxes with restricted filesystem and network access. Credentials stay outside the sandbox, and a proxy injects them only into allowed requests.
The "tricky" part is giving developers enough freedom to actually use these tools without exposing everything on their machines.
Are your engineers running agents locally, or do you have some centralized/remote environments too?
0
u/Intrepid_Purchase_69 Oct 07 '26
Use AI to build a plug in and use MDM to roll it out so it’s always installed. The plug-in should scan code for secrets and block them from being committed. Other things it can look for are cool down period settings of package managers eg npm can’t install the latest version of a package it can only install 7 days old package. Depending on what product you’re using you should try to tweak the settings that you can for example Cursor Admin settings…. You should also look into rules like cursor rules and skills to again roll out as you’re getting the Plug in installed. Another thing that many companies never get around too is inventorying extensions installed at the IDE level, which you can use the plug in to silently collect to build an AllowList of instead of allowlist = [‘*’] which is the default setting to allow all on most modern ides. It’s a tedious project but does stop a genuine vector.
0
u/badbleep0204 9d ago
secrets in env files are the scariest u gotta start hy finding out which ones hold live keys then move those to shorter creds when ur using trina ax the agent runs on a private server with per person folder perms