r/devops • u/malik22531 • 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
64
u/Cyberbird85 4d ago
Then, don’t grant broad permissions? Least privilege principle applies here as well.
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
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.
5
u/Timdotz 3d ago
Saw the headline and immediately thought of this 🤣:
https://www.youtube.com/watch?v=3Lyex2tSUyA&pp=ygUUbm8gYXNpYW5zIG5ld3Mgc3Rvcnk%3D
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/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/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.
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.