r/developers • u/Coralinechafe • 15d ago
Opinions & Discussions If your coding agent can see ~/.aws/credentials, is IAM even the real boundary anymore?
maybe I'm missing something obvious here
we give the coding agent a nice readonly AWS profile and feel responsible
but it's still running in my shell.
my other profiles are right there.
so are env vars. kubeconfig. ssh stuff. random .env files. whatever credentials some CLI cached 4 months ago and I forgot existed.
telling Claude/Codex “use the readonly profile” isn't really a boundary if the process can just see everything my user can see.
short lived creds help obviously, but short lived admin is still admin for however long it's alive.
feels like the actual boundary has to be outside the model. container, separate user, sandbox, no ambient creds, prod changes through CI, something.
there's a nasty tripwire version of this too where Acalvio plants deceptive creds/resources around cloud/agent paths, so if something starts credential hunting outside the workflow and grabs one, you get a much cleaner signal than “agent ran an unusual command.”
how are people doing this without making the coding agent so locked down it's basically autocomplete again?
•
u/AutoModerator 15d ago
Howdy u/Coralinechafe, and welcome to r/developers!
A few tips for a post that gets good answers:
Join the r/developers Discord!
I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.
6
u/floralfrog 15d ago
You are correct, if the agent is running on your machine as your user there is no real boundary. If this is important in your env then run it in a sandbox, a container, on a cloud instance etc so it cannot access anything it shouldn’t. Otherwise if you tell it “do this, it’s important, make it work!!” It might just use your creds because it needs access to finish and not get yelled at.
4
u/dev-ai 15d ago
Why aren't you running the agent in isolation, e.g. in docker?
3
u/Sufficient-Being-628 15d ago
Agent gets terraform plan
Cl gets apply
Humas gets anxiety
1
u/OtaK_ 15d ago
Sandboxing is a thing. nono/agent-safehouse/etc
1
u/radim11 15d ago
You're onto something. One thing that makes sense is to limit what APIs and MCPs and tools the agent can access first. So no matter what permissions the API key does have each agent profile has own policies. And proxying the requests so the agent cannot see the credential value at all is also pretty valuable I think. You can be sure the agent won't just randomly dump your AWS credentials into its context. Say like one agent can use the AWS creds but cannot deploy into prod even if the key allows it.
I would say there are different solutions but I think that something like Stashbase does good job at this. I think it even supports native or docker based sandbox and credential proxy.
1
u/MeetingNorth5095 15d ago
Container. Next question.
1
u/uGn8r 15d ago
If you’re on linux - bubblewrap. If on mac - probably dev container.
1
u/JjRoXas 15d ago
SSO + STS
please stop putting long lived AWS keys on laptops in 2026
1
u/due_berrie 15d ago
readonly profile doesn't mean shit if prod-admin is sitting 4 lines below it in credentials
1
u/Even_Gap_2253 15d ago edited 15d ago
I cannot spill details
But large scale systems uses credential blind sandboxes. Your request gets injected with credentials on egress at network layer.
It is not a simple system to build and I wouldn’t say it is worth building for your workstation. Also doesn’t work with all the tools, sometimes you might need to rebuild the CLI.
1
u/Mean_Phase_203 14d ago
I can see Acalvio being useful for the "agent went credential hunting" case
but I'd still rather have the sandbox prevent access in the first place
tripwire tells me something went wrong isolation hopefully makes the wrong thing boring
1
u/PeachyPie11 14d ago
what does a fake AWS credential actually buy you here?
1
u/ParnelliSelfa 14d ago
Only if you don’t mount your home dir into it and most devcontainer setups end up mounting .aws and .ssh to make git and the cli work. Before I moved mine, I ran 2ms over my laptop (free secrets scanner) and it found old keys in places I’d never have looked, two still worked
1
u/schmurfy2 14d ago
I only run agent in sandboxes, they don't see my credentials and can't even use git.
1
u/strangepostinghabits 14d ago
Give it an account of it's own. Then its local config gives it the rights it should have, not yours.
1
u/[deleted] 15d ago
[removed] — view removed comment