r/devops • u/Beginning_Delay_4421 • Sep 02 '26
Discussion Anyone else nervous about what coding agents can actually run?
Using Cursor a lot more with tools enabled. Love the speed. Don't love the part where the only thing between "delete this" and it happening is me watching the terminal.
Is anyone doing something more solid than prompts + hope, or do you just keep it away from prod/cloud entirely? Had any close calls?
Genuinely just curious how people are handling this.
0
Upvotes
10
u/Equivalent_Loan_8794 Sep 02 '26
cloud dev/staging. Push only what works from thorough testing to prod, then read-only AI triaging, no more, in prod
5
u/BehindTheMath Sep 02 '26
I use Docker Sandbox (sbx) to restrict what the agent has access to.
1
u/Beginning_Delay_4421 Sep 03 '26
Out of curiosity, is anyone actually using a gateway/proxy between the agent and external tool/API calls for this or are most people still piecing it together with hooks, IAM, sandboxes, etc ?
1
u/twistdafterdark DevOps Sep 03 '26
I'm using copilot cli and what I've done is configure the preToolUse hook. I've made a list of commands and paths which will always be denied regardless of its current permissions. And for a subset of commands it must always request permission.
Furthermore I've made a small application that monitors all the events made by the AI so I can always have a look at what was executed during a given session.
And of course stated in the instructions that is only allowed to use read-only commands.
1
u/clock-drift Sep 02 '26
I mean, this problem already existed before AI agents went mainstream. Don't give your agent permissions it shouldn't have.
1
u/das_smoot Sep 03 '26
Look into specifying guardrails and configuring system prompt constraints for your specific AI agent.
1
u/outthere_andback DevOps / Tech Debt Janitor Sep 03 '26
I've been using the pattern lately of telling my agent:
So any code change things are facilitated through a PR and me manually doing those in any environment
I also do not like either that it's just words guarding most of AI from dropping every database or cluster etc - but it hasn't actually failed me yet 😅
1
u/dogfish182 Sep 03 '26
Yeah we spend 1.5-2 engineers a month on harness engineering. The agents touch code and code is promoted through static gates to prod.
Works great, speed is insane, code base was well defined and structured before that and fable is incredible
1
u/aragossa Sep 04 '26
the sandbox/permission-scoping answers are the right long-term fix. separately, some agent CLIs let you hook the literal command string before it runs and kill it right there. Claude Code has this. point it at rm -rf, terraform destroy, and a couple other obvious ones, and the model can decide whatever it wants, that command still never executes. doesn't get you real least-privilege, just stops the one thing you're actually worried about.
1
u/MoneyWithJJ Sep 06 '26
Put the guard in the code, not the prompt.
My upload script looped over every package. It would have re-uploaded 5 that were mid review, and that sends them back to the end of a multi day queue. So I added a status check inside the loop, anything not in draft gets skipped.
Now it doesnt matter what the agent decides to run. The damage isnt reachable.
1
u/usually_guilty99 Sep 15 '26
I think the missing layer is between permission and execution. An agent may legitimately have AWS access, but
delete this one test resourceanddelete this clustershouldn’t inherit the same authority. Evaluate the actual action, target and blast radius before the call executes. Prompts are the wrong place to enforce that.1
u/usually_guilty99 Sep 21 '26
I think the missing distinction is capability vs authorization-in-context. IAM and sandboxes answer whether the agent can call an API. They don’t tell you whether deleting this resource is safe given dependencies, blast radius, rollbackability and current system state. I’d treat the agent as an untrusted principal and put the gate around side-effecting actions, not just around credentials.