r/devops • • 4d ago

Discussion Never felt comfortable with Agents

As a DevOps/SecOps engineer, I am never comfortable granting broad permissions for agents to execute actions, and I have never permitted any open-source agents (such as Nanoclaw, Astrolabe, and others) because of the fear of AI and the need to separate privacy. Is it normal for y’all ??

12 Upvotes

47 comments sorted by

64

u/Cyberbird85 4d ago

Then, don’t grant broad permissions? Least privilege principle applies here as well.

9

u/JinpaLhawang 4d ago

This is the take. Even with only read perms, you can get a lot of planning, analysis, diagnosis etc out of an agent. And then you can move up to non-destructive writes if and when you want to. It is very much about trust building.

3

u/MindlessJellyfish439 3d ago

Yeah, but how do you actually enforce 'non-destructive writes' at the credential level though? Most API tokens I've worked with bundle write and delete together. GitHub fine-grained tokens get you per-repo, but not 'can comment but can't close or delete'. Curious if people are doing that with separate service accounts per task, or something in front of the API.

3

u/samc621 2d ago

Mostly you can't at the token level, the scopes just aren't that granular. What helps is a second layer that checks the action instead of the credential. In Claude Code, permissions.deny or ask rules like Bash(gh repo delete *) or Bash(kubectl delete *) are enforced by Claude Code, not the model, so they hold even if something it read talks it into trying. A PreToolUse hook can inspect the full command when a pattern isn't enough.

Neither catches a script the agent writes and then runs, so keep the token as tight as it'll go and use the hook layer for the deletes the token can't exclude.

Disclosure: I work on AgentTrail. Our open-source Guard (https://github.com/agenttrailhq/guard) ships those hooks prebuilt for Claude Code, Cursor and Codex, so things like kubectl delete, terraform apply -auto-approve and force-push get held or blocked before they run. It matches commands, so the same script caveat applies.

2

u/MindlessJellyfish439 2d ago

thanks, that's really useful. the script gap is exactly the part I was worried about

1

u/JinpaLhawang 3d ago

You could get really fine grained with the token permissions. But Claude or Codex or whatever usually has a setting to say don't do destructive things. Even without saying don't delete stuff, I find Codex shies away from it anyways. It always wants to just create more and never clean up, if anything

1

u/MindlessJellyfish439 3d ago

makes sense. but curious, do you trust that for prod too or mostly dev? prompt injection is the case I keep thinking about, the setting only works if the model listens

1

u/JinpaLhawang 3d ago

Ah, yeah I don't do anything in prod. I started only limiting to a local cluster, but I have broadened to a dev VM, driven moreso by just needing more clusters to support multiple streams of work I am now doing concurrently

1

u/bitweis 3d ago

Mostly you can't at the credential level. Tokens bundle verbs, so a token that can comment can usually close and delete too. Separate service accounts per task works but sprawls fast. The thing that scales better is enforcing per call in front of the API: the agent has its own identity, a policy says which verbs on which resources are allowed, and anything destructive goes to a person while reads and comments go through. The real token stays behind that layer.

I'm the founder of Permit, and this is the layer we're building for AI coding agents. Docs: https://docs.permit.io/software-factory-security/

2

u/Dobsen_Runjie 4d ago

yeah it really shouldn't be any different from scoping permissions for a regular service account.

13

u/Wide_Commission_1595 4d ago

Treat them like you would any other person who you have less than 100% trust in. Give them enough access tomdo what you want them to do, but not enough access to screw you over!

For example, I let my agents have read only access to the Aws account they deploy to, but they can only deploy via merge requests that I look at. No access to secrets etc, and private repos only

7

u/Holiday-Medicine4168 4d ago

Can’t stress the secrets part here enough. Agents should trigger jobs, not deploy things. If you have them running locally doing read only things they can use AWS profiles on you machine, if you paste in credentials then they are compromised and it’s time to rotate them. We mostly use Claude and it will yell at you if you do that and tell you the same. 99% of horror stories start with giving agents or humans overly scoped permissions so the path of least permission applies here too.

5

u/lordnacho666 4d ago

Why don't you start with read-only keys? The biggest benefit is that the agent can gather up the logs, graphs, and code changes for you. Normally you would want a person to check the thinking regardless when there's an incident.

If you want it to suggest PRs, you can just allow it up to some stage where a human has to approve it.

1

u/malik22531 4d ago

That’s what I’m already doing, but sometimes I feel like in the era of AI why I’m doing stuff by hand, why can’t just agent do this.

1

u/lordnacho666 4d ago

What is it you're already doing by hand?

1

u/malik22531 4d ago

Deployments, upgrades, admin tools, db management and more

1

u/lordnacho666 4d ago

So for things that make changes, you can use agents to line them up, but you need a human to check. The agent can help, it can't be responsible.

1

u/malik22531 4d ago

I’m doing good exactly this way, even before lining up I ask for reference docs and make sure it works with our infra architecture

1

u/Rei_Never 3d ago

Accountable***

3

u/SKFr33_ 3d ago

I run A LOT of agents in my GitOps repo. This is not really per my own choice as I have been instructed to test every step of my work if it can be accelerated with AI.

And this is where I landed after roughly 2 years of testing and incremental improvements:

AI has NO CLI access to the cluster, so no AWS CLI and no kubectl. It CAN change configs, commit and create PRs. But it cannot push straight to main. Anything goes through PRs.

If the agent needs access to CLI it gives me the commands it wants to execute. I check both the command before pasting it to the terminal server and the output before handing it to AI.

And that’s it. We migrated the technical documentation from notion into GitHub so agents get access. But anything that hits main and gets deployed is by my hand.

But it’s FAST. I went through SEVERAL updates for External Secrets and ArgoCD just this morning. This would have taken a week of research before AI. Now it’s just a thing to do before breakfast.

1

u/malik22531 3d ago

Same as mine, my rule with agents is they’re the brain, I’m the hands

1

u/SKFr33_ 3d ago

Are your agents also trying to avoid their bounds on a regular basis?

I once forgot to redact the IP from the terminal server when pasting output from a command.

It instant tried to SSH into the terminal server to access the CLI from there :D

Spooky times….

1

u/malik22531 3d ago

NO, I have done the proper harness for my agents and i bash them through harness if they do anything like this. Never faced any instance like it

1

u/Gooner96PL 2d ago

What advantage you see in comparison with renovate? Does your agent blindly bump versions or also have env context and verify configuration changes?

2

u/SKFr33_ 2d ago

No, no agent changes anything blindly.

I work primarily in orchestrator patterns. We currently use multiple different harnesses with different payment plans.

So the expensive agents are the orchestrators and they spawn Claude Haiku or similar agents for the actual work.

Every worker gets its local git worktree that is decoupled from the upstream, there they can do whatever they want. The harness i use for this is build to withstand escape attempts from the worktree, so it catches agents touching files outside of their CWD.

From there, every worker reports back to a merger, to avoid spending expensive tokens for simple merging work. Only logical conflicts are send to the more expensive agent and that one can escalate to me if needed.

This is all completely decoupled from dependency updates. We do run renovate. For all renovate PRs an agent is spawned to create a risk evaluation for that specific update, considering our REAL setup and not just some upgrade guides online.

But merging renovate PRs, same as any other PR, is my job.

So we do use both and both has its own purpose. Tracking dependencies with AI would be a waste of tokens. Deterministic, cheap(in comparison to AI almost any normal deployment is cheap) systems like renovate exist for a reason.

1

u/TorrentsAreCommunism 4d ago

I give them admin permission and let them do all the work for me, while I’m chilling.

If we are to be replaced by AI, I will at least make this process more enjoyable.

2

u/malik22531 4d ago

And one day your keys are exposed on moltbook :p

2

u/TorrentsAreCommunism 4d ago

So? Not my company.

2

u/daemonmode_ 2d ago

That's a pretty standard approach. OWASP lists excessive agency as a risk and recommends least-privilege permissions limiting the tools an agent can use, and requiring human approval for high-impact actions.

Read-only access and scoped credentials help limit potential damage, while running agents in a sandbox adds another layer of isolation.

https://genai.owasp.org/llm2026/llm032026-excessive-agency/

2

u/laconix31337 2d ago

i use agents more for read only type tasks, gathering reviewing esp long running tedium that needs no babysitting but does need to be long running to complete. then those results i work with directly in a session i control. nothing hands off gets any write or change type access.

1

u/g-nice4liief 4d ago

Least privileges still apply. I use a devcontainer running in a microvm and even then you still have to be carefull they not try to go outside of the sandbox they're running in.

1

u/mxtchstick 4d ago

Yes this is pretty typical. Read-only access key scoped or account scoped to only what the agent needs is a sensible approach.

Agents should always be ran in a sandboxed environment, ideally a disposable VM either in the cloud on your machine (something with a separate kernel ideally, although this isn’t a silver bullet).

1

u/justrunme1 4d ago

Pretty normal, but I'd point the worry at the credentials, not the model. Give the agent its own short-lived identity instead of your user's token, start it read-only, and send writes through the same policy check and approval a human would go through. Then the worst case is whatever that role allows. The ones I'd actually keep off my laptop are agents that just inherit your shell env with every cloud cred in it.

1

u/rankinrez 4d ago

What’s the difference with the open source ones?

1

u/CoaxVex 3d ago

I am running mine in containers. No access to ssh, k8s or cloud credentials. But they have unlimited network access, so still a work in progress.

2

u/MindlessJellyfish439 3d ago

I'd put them on a docker network with internal: true, so there's no outbound at all, then run squid on both networks and allowlist just the domains they need. If the proxy also holds the API keys, the container never sees a real credential. My two cents.

1

u/RubSad3416 3d ago

Isolate agents with hyper specific permissions.

1

u/fell_ware_1990 3d ago

Well. Where i ended up for now:

A form of work enters my queue:

- Identification of ‘type’;
- ‘type’ is matched to a minimal set of information needed by system;
- System goes and get’s the logs and data for timeframe;
- Classifier identifies if they contain the information needed, done in a bulk call to drop parts from ticket.
- Gathers memory about those part’s; decisions; changes; git history; failure modes; related tickets
- Agent investigates the issue and pops up a ticket;

All of this happens on a separate system, all my tools run on system A. Everything the agent touches run’s on System B on a separate VLAN the only access they have is to 2 Api’s. One is my gateway which handles the AI ( there only key is for this connection ). The other is my own, so they can ‘stage’ there done items.

The agent’s run on ephemeral podman gvisor containers, these are even kernel protected. The access they have it /tmp /var/run and a few more. The only SSH they could potentially see is the public key from my connection to the podman ( which is used by the software to execute all tool calls inside ) which is handled by my software again. This is where block or unblocks happen. This system has rules. So an ‘rm’ and more does not go through.

They work on a JJ workspace, which even has the .git and .jj readonly. They can still commit, but can’t reach for other branches or anything. This temp mount is also created and managed by me. JJ is also used for checkpointing, every edit get’s a automatic commit : ‘WIP:<tool><command><exitcode>. This goes all the way till an item is accepted.

If they call for testing, this is done on my temp forge. They can branch, PR, commit, merge everything they wan’t there. ( Also handled by my system ). Till its end’s up on a merge branch. I will get notified, including a suggestion of the correct commit’s. If excepted the forge stages it to the actual forge. It runs all necessary checks again. I then have to press the button, SSH key from FiDo key.

They never had any access to a real system, if they miss a thing. It’s HITL.

1

u/Hostman_com 3d ago

A separate service account won't split permissions the API bundles together. For your comment-only example, expose a tool that accepts a repository, issue number and comment body, checks the repository against an allowlist, and calls only the create-comment endpoint. Keep the underlying token outside the agent's environment.

In a test repo, verify that posting works but requests to close an issue or target another repo are rejected. The restriction needs to hold even when the agent ignores its instructions.

1

u/MissiveFinding6111 4d ago

agents with read-only permissions? So useful! I am able to use them to disprove hypothesis so quickly.

Agents with write permissions? That's a good way to accidentally delete your whole environment.