r/devsecops • u/developerKarl • 4d ago
How do you get started with coding agents when you can only use approved packages?
I keep hearing people talk about “agent swarms,” and I’m still over here asking an AI for hints in a chat window and writing most of the code myself.
Part of why we’ve stuck with chat is that we only use approved packages, and we need to know which apps use each version in case a vulnerability turns up later. I’d like to try giving an agent a small coding task. The part I can’t picture is what happens when it decides it needs a new dependency.
If you’ve made that jump, how did you start? Did you point the agent at your internal package feed and let it install what it needed, or have it ask before adding anything? I’d love to hear what worked for you on that first project.
3
u/taleodor 3d ago
I believe limiting agents at the point of work is in many cases impractical. With that, by all means tell it to only use your approved packages, but that would be recommendation, not control.
To control that behaviour, what I recommend here is deterministic governance once something is written to check against what is allowed.
I did a community meeting last week with our tool ReARM on how to manage swarms if you're looking for example: https://www.youtube.com/watch?v=EB_Oj5euJEY
And this plays nicely with the concept of continuous SBOM diffing which I introduced at OWASP talk: https://www.youtube.com/watch?v=Z6Q_9gUtRDw (ReARM would just do it automatically for you).
Essentially, the flow becomes: agents does work - you diff - if you unexpectedly see new packages, that's a reason to stop and evaluate (human in the loop).
2
u/Different_Pain5781 4d ago
Watch it hallucinate a package name that exists on public registries with a totally different maintainer than your internal mirror.
2
u/LordPorra1291 3d ago
Just don't make it install things and review the code? I don't see the issue.
1
u/punctual_success 4d ago
Its funny, everyone talks about agent swarms like they’re plug and play but the second you’re in a regulated shop the whole thing turns into dependency management hell.
We started by giving ours a pre-seeded venv with our internal feed already configured and a hard rule, if it wants a package not on the approved list, it has to dump the request into a Slack channel with a justification. First few tasks it tried to pull in half of PyPI and got denied, but after a couple of those it learned to check the available list first.
The real trick was logging every import it used against the version so we could trace things later. Not glamorous but it kept the security team from losing their minds.
1
u/DeleriousMadman 3d ago
You can have it make it’s own libraries if you feel stifled.
1
u/Classic-Shake6517 3d ago
Ours is connected to a local Nexus repo so all packages have to come through that. It is not supposed to work with any packages outside of that repository and generally won't, but prompts will always be a strong suggestion as opposed to a technical barrier. Our configuration allows for a new, latest package to be downloaded if it does not already exist, security checks run, and then if it passes, it can be used. This is not perfect, but it is way better than nothing. We also have Snyk doing SCA on the backend. It is still in progress but promising.
1
u/WholeCommon9989 2d ago
For a first project I'd keep it boring: make the agent go through exactly the same path as a human, then make new dependencies a question rather than an action.
Concretely, the agent uses your shell, so if ~/.npmrc or pip.conf already points at your internal feed, its installs hit the same mirror your devs do. Check that before you start, because a lot of laptops still have the public registry as a fallback. Then put package installs on "ask" rather than "allow" in the agent's config. Claude Code has an ask list in its permissions file for exactly this, e.g. npm install and pip install. You get a prompt every time it wants something new, which on a small task is maybe twice.
For the "which apps use which version" part, nothing changes. The lockfile is still the record, and a CI check that fails on any lockfile entry not in your approved list catches whatever slips past the prompt.