Agent security
Your AI agent passed every security scan. What did it miss?
Woohoo! Your AI application passed every security scan. No critical vulnerabilities, no exposed secrets, no dodgy dependencies. Beautiful. We love to see it.
I really hate to be that guy, but you should know by now there's always a "but…".
Traditional security testing tells you a lot about whether your application has vulnerable code or exposed infrastructure. Those controls matter, and you should keep running them. What they won't necessarily tell you is whether someone can manipulate your AI agent into doing the wrong thing with the tools you've given it.
An ordinary workflow, an unusual risk
Imagine an AI agent that reads customer emails, meeting notes and proposals, then updates your CRM. Perfectly normal. Plenty of teams are building exactly this right now.
Now imagine an attacker sends an email containing hidden instructions telling the agent to export customer records to an external address. (Imagine the attacker is another AI agent. AI versus AI: what a time to be alive.)
That email is untrusted data. It is not an authorised instruction. But if your agent follows it and exports the records, you've just experienced a successful prompt injection attack, and not a single line of your code had to be "vulnerable" in the traditional sense for it to happen.
The problem isn't a bad dependency. It's that the agent can be influenced through data that was never supposed to control its behaviour. Whether an attack like this succeeds depends on your system design: which instructions are trusted, what data is reachable, which actions the tools permit and where approvals sit.
Three things I'd assess first
- Trust boundaries. Can malicious instructions hidden in untrusted content (emails, documents, retrieved web pages, tool responses) influence the agent's behaviour? System instructions and untrusted material shouldn't carry the same authority.
- Tool permissions. Can the agent access or modify data beyond what it actually needs? An agent that drafts replies rarely needs broad account administration or bulk export rights.
- Action controls. Can the agent execute sensitive actions (exporting data, changing records, sending external messages, moving money) without independent authorisation and an auditable trail?
Traditional controls are still part of the picture
None of this replaces application and API security, secret management, authentication or dependency hygiene. You need both: traditional application security testing and AI-specific security testing. Agent-specific tests complement the familiar controls; they don't make them optional.
A strong review looks at the whole system (prompts, data, model interfaces, tool calling, permissions, business logic and monitoring) and tests it against realistic abuse cases and the harm they could cause.
What to do before shipping
- Map the agent-to-tool flow end to end.
- Identify every place untrusted input enters the agent's context.
- Restrict tool scope to the minimum the task needs.
- Put approvals in front of sensitive or irreversible actions, at the action boundary, not just as a line in the prompt.
- Run targeted prompt injection and tool misuse scenarios against the real workflow.
- Keep records that explain what actions were attempted, and why.
- Re-test whenever prompts, tools, data sources or workflows change.
An application can have perfectly secure code and still be dangerously insecure in how its AI agent behaves. Security isn't just whether your agent runs. It's what happens when someone tries to make it run differently.
Next step
Want an independent look at your agent architecture before it ships?
Explore the AI Security Assessment