Connecting Large Language Models to your internal AWS infrastructure is like giving a brilliant, fast-talking intern the keys to the server room. It is incredibly powerful, but if you do not set the right boundaries, things can go sideways fast.
1. Over-provisioning agent identities
The most
common slip-up is giving an AI agent a broad, 'god-mode' IAM role. In many AWS accounts, non-human identities already outnumber actual employees. If your agent reuses a service role with wide-ranging permissions, a simple prompt injection could allow the model to bypass all your fancy text filters and call AWS APIs directly. Always start with a read-only baseline to see exactly what your automation can touch before you grant it the power to change things.
2. Confusing prompt filters with true security
It is easy to fall into the trap of thinking that Bedrock Guardrails or prompt filters are a complete security solution. While these are great for catching unsafe content or PII leakage, they are essentially just linguistic filters. They act on the text, not the underlying permissions. If an agent has the technical permission to delete a database, a text filter cannot stop it if the model decides to ignore the 'do not delete' instruction. Real security happens at the IAM and tool-level, not just in the chat window.
3. Allowing agents to execute mutating actions alone
In a secure production environment, agents should generally be proposers, not executors. A major mistake is allowing an agent to directly trigger actions that change the state of your infrastructure—like patching a deployment or modifying a security group. Instead, use a pattern where the agent proposes a change, and a separate, highly scoped process (like a dedicated Lambda function) executes it only after a human has reviewed and approved the specific parameters.
4. Neglecting the 'Human-in-the-Loop' for high-impact tasks
Automation is the goal, but blind automation is a liability. For high-consequence actions, you must implement a clear approval workflow. This means a specific person must approve the exact target and the exact parameters of an action. Crucially, the person approving the action should never be the same entity that requested it. This separation of duties ensures that a rogue agent or a hijacked session cannot self-approve its own destructive commands.
5. Failing to redact sensitive data before it hits the model
Sending raw logs or database outputs directly to an LLM is an invitation for data exfiltration. If your agent pulls a log file that contains bearer tokens, AWS access keys, or PII, that data is now part of the model's context. You should implement redaction in your code to mask these secrets before the tool output ever reaches the model. Think of it as a digital shredder that cleans up the data so the AI only sees what it actually needs to know.
6. Using a single point of failure for read-only access
If you are building an AI SRE or an investigative agent, you want it to be read-only. A common mistake is relying solely on the prompt telling the agent to 'only read.' That is the weakest form of control. To do this right, you need multi-layered enforcement: the tool code itself should only perform read calls, the cluster identity should have restricted RBAC bindings, and the IAM policy should strictly forbid write actions. If one layer fails, the others should hold the line.
7. Ignoring the audit trail for AI decisions
When an automated system makes a mistake, 'the AI did it' is not an acceptable answer for an auditor. Many teams fail to capture the specific reasoning and the exact parameters used during an agent's execution. You need a way to produce tamper-evident evidence of what was proposed, who approved it, and what the final outcome was. Without a signed, verifiable record of these interactions, you are flying blind during an incident response.
8. Mismanaging outbound credentials
How does your agent actually talk to your tools? A massive security hole is hard-coding credentials or passing long-lived keys into the agent's environment. Instead, leverage modern identity management like IAM Roles for Service Accounts. This allows the agent to assume a scoped role dynamically, ensuring that no permanent secrets are stored within the agent's runtime, which significantly reduces the blast radius if the agent is compromised.













