In early 2025, "AI agent" mostly meant a demo or a limited pilot. Twelve months later, agents triage tickets, answer customers, review pull requests, run SOC playbooks and operate cloud consoles. Many run continuously, triggered by events rather than by a person typing a request. OWASP has published threat catalogues and a Top 10 dedicated to agentic applications. Security teams are discovering agents in their environments much as they once discovered shadow SaaS.
The question is no longer whether agents create new risks. It is how to see and control them at scale.
Five ingredients of agent risk
Almost every serious agent incident we have analysed or tested combines some of the same five ingredients:
- Untrusted input: content from outside the organisation, such as emails, web pages, public issues, uploaded files or messages from other agents.
- Sensitive data: access to documents, repositories, customer records or secrets.
- Tools with side effects: the ability to send, write, execute, deploy or pay.
- Persistent memory: state that carries instructions or "facts" from one run into the next.
- Autonomy: actions that happen without a human seeing them first.
Each is manageable on its own. The danger is in the combinations. An agent that reads untrusted input, can see private data and can send data out is an exfiltration channel waiting for the right prompt. Security researchers have been warning about this "lethal" combination since 2025, and it remains the single most useful test to apply to any agent design.
flowchart TB
U[Untrusted input] --> A{Agent}
D[(Sensitive data)] --> A
A --> X[Outbound action<br/>email, HTTP, PR, message]
style X stroke:#ff6a88,stroke-width:2px
N["If all three meet in one context<br/>with no human check, one injected<br/>instruction can exfiltrate data"]
X -.- NAn architecture that holds up
Identity: every agent is a principal
Agents should never run as a copy of a human's session. Give each agent (and ideally each agent deployment) its own non-human identity, with:
- its own credentials, short-lived and federated where possible,
- permissions scoped to its job,
- an accountable human owner, and
- a clear record of which user, if any, it is acting on behalf of.
This is what makes agent activity reviewable, revocable and attributable.
Authorisation: decide per action, outside the model
The model can propose an action. A deterministic policy layer, not the model, decides whether it happens, based on the agent's identity, the user it serves, the target resource and the data involved:
# Illustrative policy for a support agent
agent: support-triage
on_behalf_of: requesting_customer
allow:
- action: tickets.read
where: ticket.customer_id == on_behalf_of.id
- action: tickets.comment
requires: content_filter.pass
deny:
- action: "*.delete"
- action: email.send
where: recipient.domain != on_behalf_of.domain
require_human_approval:
- action: refunds.create
where: amount > 0Context isolation: keep the dangerous combinations apart
- Process untrusted content in a context that has no access to sensitive tools. Pass on only structured, validated results, not free text that can carry instructions.
- Restrict outbound channels. Allow-list domains, disable automatic rendering of links and images, and require approval for messages leaving the organisation.
- Separate agents by trust level rather than building one agent that can do everything.
Memory hygiene
Treat long-term memory as a data store with integrity requirements: record where each memory came from, expire it, let humans inspect and delete it, and never let untrusted content write standing instructions.
Runtime monitoring
Log every prompt, plan, tool call and result with the agent's identity. Baseline normal behaviour per agent, and alert on deviations: new tools, unusual volumes, access to data outside the agent's usual scope, or outbound traffic to new destinations.
Change control
A change to a system prompt, a new MCP server or an extra tool changes an agent's behaviour as much as a code change does. Put agent configuration in version control, review it, test it against an adversarial suite and deploy it through a pipeline.
Questions to ask about every agent
- What untrusted content can it read?
- What sensitive data can it reach?
- What can it change or send, and which of those actions need a human?
- Whose identity does it use, and who owns it?
- What does it remember, and who can write to that memory?
- Where are its actions logged, and would anyone notice if it misbehaved?
If an agent team cannot answer these quickly, the agent is not ready for production.
The takeaway
Agents are a new kind of workforce: fast, tireless, useful and easy to manipulate with text. The controls that work are the ones security teams already know (identity, least privilege, segmentation, monitoring and change control) applied deliberately to a new kind of actor.
EthicalHat's red teaming now includes agent-focused attack paths, and our agentic AI security team designs agents around these controls from the start.