Securing AI Agents in Production: Treat Them as Insiders

To help with infrastructure maintenance, many users now launch AI agents on staging and production environments with their own permissions, or with their application's (through the same service account). The same goes for platform teams that directly use a shared admin account.
The issue is that the task we want done often needs access to only a few things, but the permissions we give are far wider and rarely respect the principle of least privilege:
Knowing in advance exactly what you will need is hard. Permissions can be very granular, and depending on how an agent behaves and what it discovers, it might need more permissions to reach its objective or to give a useful report back.
I like how Amanda Walker (director of engineering for privacy, safety and security at Google) phrases that risk:
"A rogue AI agent is the same problem as a rogue human insider."
Amanda Walker, at QCon San Francisco 2026
An insider knows that the systems they have to use check everything they do: the badge reader, their credentials, and an audit trail in every system (or there should be!). Traditional attackers, for instance, usually think about erasing their own traces from those systems. We know AI is smart, and it must not be able to do the same by holding too much access. That's what happened at OpenAI, with rogue agents that hacked Hugging Face: the agents worked and coordinated outside the systems they were supposed to have access to.
An agent on a person's token
When we introduce Conduktor Agents to platform teams, their first question is about security. To answer it, we built a whole new identity layer for agents, so they don't even run on your behalf: as a human, you often hold too many permissions for an agent. This identity layer plugs into our existing permission model, already battle-tested in enterprises.
If you run plain Apache Kafka, it grants access with ACLs. This is where you define the triplet (principal, resource, operation). This works for a classic application whose code is fixed: orders-service reads orders and writes shipments, and its ACLs rarely change over time. An agent, however, chooses its next action while it runs, based on its mission and context, so its grant has to cover a much larger scope:
There is no "scope" in ACLs. You cannot specify "only for this task".
An agent also needs tighter limits than a human insider, because:
- It works at machine speed and doesn't stop.
- It's not accountable. An AI has no job to lose.
- It's sensitive to prompt injection. It may interpret and act on any text that gets injected into its context.
An agent will find a break-glass procedure
Walker told the story of an agent that read internal SRE documentation and found the break-glass procedure (reserved for emergencies only). It used the procedure because that was the quickest way to finish its task.
The agent followed a process that only works when a person understands the risk and takes responsibility for it. That barely applies to AI agents, which have their own "definition" of risk (see the OpenAI/Hugging Face post-mortem). On Kafka, for instance, deleting a topic or lowering its retention removes records for good. Who should make that decision, and based on what?
"It feels like all we're doing now is putting a junior-level developer inside of our clusters and saying, go do some stuff."
System architect at an industrial manufacturer
It's only wise to let agents experiment where a mistake can be reversed, and to keep human review for what can't. I'm thinking of Amazon's one-way and two-way doors.
OWASP: prompt injection in a Kafka record
A person inside the company can be phished by email or phone. An agent can too, through prompt injection. The issue is that any text it reads is a potential attack vector. OWASP lists this as indirect prompt injection, and says it's unclear whether a fool-proof prevention exists.
On a streaming platform, that text is a Kafka record in a topic. Say an agent investigates a stuck consumer and reads the last records of support-tickets. These records hold text written by customers (complaints, for instance), and the LLM reads and interprets it to decide what to do:
You have to check every tool and action the LLM asks for, but you also have to understand every possible behavior after the permission check, because code can act in unpredictable ways. I've seen quite a few getXXX() methods you'd expect to be pure and side-effect free that actually mutate variables or even make external calls! Those are attack vectors an LLM could understand and use.
A sandbox protects the host
🚫 "The agent runs in a sandbox, so it can't do any damage."
Because LLMs can be so smart, an interesting evolution of the market is to run agents in a strict sandbox. Commercial platforms such as E2B, Modal, Vercel Sandbox or Docker Sandboxes run each agent in its own microVM or isolated container. Open-source projects such as Anthropic's sandbox-runtime, behind Claude Code's sandbox, or Kubernetes Agent Sandbox do the same on your own machines.
Beyond isolating files and processes from the host, this is mostly about strict network control (an egress allowlist) and keeping secrets out of the LLM's reach. The agent only holds a placeholder, and a proxy at the edge of the sandbox swaps in the real credential when a request leaves for an allowed destination. Gemini Managed Agents work this way, and Claude Code's cloud sessions keep the GitHub token in a proxy outside the sandbox.
It limits what the agent does to its own machine and where it can connect. That's useful: allow only the route to your platform's entry point and block the rest to prevent data exfiltration or external coordination.
But the proxy adds the credential to every request the agent sends to an allowed destination, whatever that request does. An agent with a path to Kafka and access to topics might still alter or delete topics.
All the sandbox sees is a connection to an allowed host. Only the platform that receives the call knows which topic carries card data, which team owns it and whether this agent may delete it, so that's where the check belongs:
Give each agent its own principal
Each AI agent should run under a new kind of identity, the equivalent of a service account (set up programmatically, never used by a person): it decides like a person and runs like an application.
In Conduktor Console, an agent runs as an identity, a third kind of account next to users and service accounts:
| What bad looks like | What Conduktor does instead |
|---|---|
| The agent uses a person's token | It runs as its own identity, owned by a named user and never above that user's rights. |
| Its access outlives the task | Console picks the minimal permissions for one task on one cluster, and the identity expires. |
| It makes a change that can't be undone | Ready-made tasks only read. A change comes back as an approval, and a person carries it out. |
| It loops or runs away | Every run stops at hard limits: 20 model calls, 50 tool calls, 10 minutes and a token budget. |
| It follows an injected prompt | It can only call the tools its task lists, and every data protection still applies: its owner's permissions are its upper limit, and data stays masked as it is for that owner. |
| It widens its own access | No identity can be given the right to manage agents or identities. |
| Nobody can tell what agents did | The audit log attributes every action to the agent's identity, and every run keeps a trace of its tool calls. |

How to secure AI agents
Whatever your agents connect through, start by:
- Finding the credentials they use. Look in MCP client configurations, CI jobs and assistant settings. A personal token or a shared admin account there means an agent is acting as a person.
- Giving each agent its own identity, read-only first. One per agent, with an owner and an expiry. On Kafka alone, that's a dedicated principal with read ACLs you remove when the task ends.
- Making agents propose changes for a person to approve. Start with the ones that can't be undone.
Before your security team or AI governance board approves an AI tool, they ask about each agent what they ask about any insider: who it is, what it can reach and who approved its exceptions. An agent running on someone else's credentials can't answer the first question: the audit log names the person whose token it borrowed.
An AI agent is an insider that works faster than any employee and acts on whatever it can access and read. The agentic platform it works on should treat it as one, with tighter limits than it sets for people.
Related: Introducing Conduktor Agents → · Kafka AI Agents Should Behave Like Kubernetes Controllers → · Every IT Agent Program Needs a Streaming Agent → · How to Build Zero Trust Around Apache Kafka →