r/aws • u/mountainlifa • 4d ago
general aws Controlling AI agent usage
Part of a small team as tech lead. There's an ops person who has persuaded company owner to provide them prod credentials. Recently we've had a string of outages due to manual config in the console. I analyzed cloud trail logs and it's clear this config was executed by an AI agent using this person's credentials. So essentially the employee is allowing the agent to use prod credentials to do this work in the account as they have no experience with AWS. How would you handle this situation given the political situation? From my perspective, I don't see how I can successfully support a production system that is open to random AI agent config in the whims of an unqualified employee. Am I overreacting here?
7
u/N7Valor 4d ago
I think the typical recommendation is to lock down the account so that changes can only come through Terraform.
Typically, using AI to do things via CLI is bad in the same sense that a person doing it manually is bad. It's just that with AI, it's bad if you don't understand why changes are being made (no historical record).
With IaC and a basic change management process, I would view a proper production change as something you'd need to do through CICD + Terraform. Code change => Pull Request => Terraform plan => Peer Review. If it doesn't get reviewed, the plan doesn't get applied.
It's less chaotic with that approach since IaC tends to force something like code comments or Pull Request descriptions (what are you changing? why are you changing it?). Depending on how the environment is built, reverting a change can be as easy as running "Terraform destroy" on a particular module.
11
u/pausethelogic 4d ago
No you’re not overreacting. No one should have prod credentials to AWS that are allowing AI to make random changes they don’t understand.
Do you have IaC? If so, there’s no reason for anyone to have constant write permissions to AWS
This isn’t really a political situation, and if it becomes one, then it’s a cultural issue more than a technical one
3
u/magnetik79 4d ago
... this will (sadly) be the norm in 2027 - suddenly everyone is an AWS Cloud platform engineer that can vibe their way to success.
What can possibly go wrong?
The usual steps - block all write access to production, all changes through IaC and through pipelines. Wishing you all the best - I'm sure this will be an uphill battle for you.
3
u/Pretend-Sun-8460 3d ago
since you already have cdk, you don't need to argue against the ai, just change where it writes. the ops person keeps the agent, but their role goes read-only (the ReadOnlyAccess policy), and the agent's changes come in as a pull request on the cdk repo. put the `cdk diff` output in the PR, so the owner sees exactly what it wanted to change before anything is deployed.
i built an agent for a client that works this way. it only saves drafts, and a person decides what goes live. it can't break anything on its own, so nobody has to trust it blindly.
the cloudtrail events you already pulled make the case. list each outage next to the console change that caused it, with times.
2
u/TheRealJesus2 4d ago
That’s insane. You have the logs…what more do you need to revoke those credentials? Or talk to the owner to do so?
2
u/Patient-Tea-922 4h ago
You're not overreacting. Giving an AI agent access to prod with no proper controls is a serious risk, especially after repeated outages. I'd push for least-privilege access and a proper review process before any changes go live.
1
u/mrlikrsh 4d ago
Get some SCPs in place to at least protect the data - tables, buckets, etc. Or better just add a blanket deny for the ops guys Role and deal with politics later. You already have a trail of instances to show that there are outages caused by the said persons role. Best practices are already out there, I feel like you’re missing the guts to just push back a dumb move.
1
u/oneplane 4d ago
GitOps is the way to go
1
u/Admirable_Ones 4d ago
You already have IaC, so I’d focus the owner conversation on the outages and recovery time. Propose one rule for everyone: AI can draft changes, but production changes need review before deployment.
If they won’t back that, clarify who owns the resulting incidents. You can’t be accountable for reliability without control over production changes.
1
u/Junior_Bee7274 3d ago
Block direct console write access across the board and route everything through your existing IaC pipelines. The ops person can still use AI to generate Terraform if they want, but it goes through proper review first. That's the compromise that actually works.
1
u/Beginning_Visual5634 2d ago
You're not overreacting, but I'd argue about attribution, not the AI. Right now CloudTrail says the ops person made those changes. If anyone asks who approved a change to prod, the honest answer is nobody. An agent did it on someone else's login.
The fix is small. Give the agent its own role and require a source identity on it. Then every CloudTrail event shows it was the agent, and that can't be changed afterwards.
CloudTrail still won't tell you what the agent was asked or by whom, so keep the agent's own log of requests next to it.
Make the human's access read-only and route changes through PRs on your CDK repo. The ops person keeps the AI, just not the keys.
My team went through a lot of audits, and auditors mostly don't care how you do things. They check that what you say you do is actually what happens. "All prod changes go through PRs" doesn't survive a CloudTrail log full of console edits from one person's login.
-3
u/Efficient_Access6102 4d ago
It’s disturbing that you’re a tech lead and have to come to Reddit to be spoon-fed.