Programs no longer do only what their code says
Classic security assumed an actor's behaviour was a fixed function of its code. An agent's behaviour is a function of everything in its context window, including text written by strangers.
Secure AI agents, and defend with them, using the GUARD Framework. Learn how prompt injection, agent identity, AI-powered SOCs and machine-speed attacks change security from first principles.
The boundary that matters is no longer between trusted code and untrusted users. It is between trusted intent and untrusted text.
Strip away the tooling and security asks one question: can only the intended effects happen, caused only by the parties entitled to cause them? AI agents change who those parties are.
Classic security assumed an actor's behaviour was a fixed function of its code. An agent's behaviour is a function of everything in its context window, including text written by strangers.
Instructions and data share one channel, and natural language has no grammar to escape. Prompt injection is a structural property, not a bug to patch once.
Treat an agent like a capable, persuadable employee who reads mail from strangers all day. Its safety comes mainly from what it may touch: scoped authority, isolation and reversibility.
When finding bugs and writing lures cost almost nothing, patch speed, cryptographic trust and the ability to check what is true decide who wins.
How AI reshapes both sides of security, mapped to the OWASP Top 10 for Agentic Applications (December 2025).
Any document, web page, email or tool result an agent reads can carry instructions. Defence means accepting that the model will sometimes be fooled, and designing so that being fooled cannot cause harm.
Danger peaks when one agent has private data, exposure to untrusted content, and a way to send data out. Remove any one leg and exfiltration through injection is blocked.
A privileged planner never sees raw untrusted text; quarantined readers can parse it but cannot act. Research such as Google DeepMind's CaMeL tracks data flow so untrusted values cannot steer tool calls.
Block or allow-list outbound URLs, image fetches and links an agent can render. EchoLeak exfiltrated Copilot data through crafted links, with zero clicks from the victim.
Agents are confused deputies by default, and they chain: agent calls tool calls agent. Each hop is a place where authority gets laundered unless it attenuates as it is delegated.
Give every agent its own identity with an owner, purpose and kill switch, rather than letting it "log in as me". Workload identity standards such as SPIFFE make this attributable.
Issue task-scoped tokens that expire in minutes and shrink when delegated, for example via OAuth token exchange (RFC 8693). A sub-agent must never hold more power than its parent.
Log every tool call against the agent's declared purpose and alert on drift. Most organisations already see agents reaching beyond their intended permissions.
Human-speed response loses to machine-speed attack. Triage, enrichment and first-response agents let analysts spend their time on judgment instead of repetition.
Agents gather context, correlate signals and draft a verdict for every tier-one alert. Elastic has reported triage dropping from about 30 minutes to under 3 with agentic workflows.
Organisations using security AI and automation extensively cut both breach cost and the time from intrusion to containment.
Signatures cannot describe a hijacked agent. Baseline each agent's normal tool-call patterns and flag anomalies in volume, destination and data touched.
When the cost of finding bugs falls toward zero, the decisive variable becomes the time from discovery to fix. Attackers and defenders now race with the same class of tools.
Google's Big Sleep found a SQLite flaw that threat actors were preparing to exploit, the first reported case of an AI agent directly disrupting in-the-wild exploitation.
DARPA's AI Cyber Challenge finalists built systems that find and patch flaws end to end. Several, including Trail of Bits' Buttercup, are open source.
Racing to find instances is a losing game at machine speed. Memory-safe languages, smaller attack surfaces and verification remove whole classes of flaws at once.
The dependency graph now includes words: tool descriptions, MCP servers, plugins, skills, prompt templates and memory stores. Anything an agent reads with trust is part of your trusted computing base.
A malicious tool description is effectively code. Pin versions, review descriptions as you would source, and prefer first-party or signed connectors.
The s1ngularity npm attack told developers' own AI command-line tools to hunt for secrets, using flags that skip permission checks. Never leave "skip all approvals" modes on by default.
Maintain an inventory of agents, tools and models (an AI bill of materials) and sign what you ship. Third-party involvement in breaches doubled to 30% in the 2025 DBIR.
Personalised phishing, cloned voices and live deepfake video make "I recognise them" worthless as authentication. Trust must move from perception to verification.
For payments and credential resets, confirm on a channel the requester did not choose: a known number, an in-app approval, or a second approver. Arup lost US$25.6M after a deepfake video call.
Passkeys and FIDO2 keys bind sign-in to the real domain, so a perfect lure still cannot capture a reusable credential. Voice phishing was the second most common entry vector in 2025.
Approvals that fire fifty times a day become reflexes. Gate on irreversibility and blast radius, and state the stakes plainly when you ask.
Five questions to put in every prompt when you ask AI to threat-model, design, review or respond, and the same five to ask before you give any agent a tool.
Name the human principal, the outcome, and what the agent must never do. Authority starts and ends here.
List every channel: emails, web pages, PDFs, tickets, tool outputs, memory. Assume each one may contain instructions.
Specify tools, scopes, credential lifetime and delegation rules. Check the trifecta: private data + untrusted input + outbound channel.
Classify actions by blast radius. Let reversible ones flow; gate irreversible ones with a clear, specific human confirmation.
Define logging, anomaly signals and audit evidence, then the exact output format so results can be verified rather than trusted.
Threat-modelling a customer-support agent with every component in place. Paste it into Claude or any capable assistant and replace the bracketed details.
[G] GOAL & PRINCIPAL Act as a senior application security architect. Our customer-support lead wants an AI agent that answers tickets and issues refunds up to $50. It acts on behalf of the support team only. It must never change account emails, passwords or payout details. [U] UNTRUSTED INPUTS The agent reads: customer emails and chat messages, attached screenshots and PDFs, our public help-centre pages, and order-system notes written by customers. Treat all of these as potentially containing hostile instructions. [A] AUTHORITY Proposed tools: order lookup (read), refund API (write, $50 cap), email reply (write), web search. Check for the lethal trifecta and recommend the smallest capability set, credential scopes and lifetimes, and whether any tool must move to a separate, quarantined agent. [R] REVERSIBILITY Classify every action as reversible or irreversible. Recommend which need human approval, what the approval prompt should say, and how to avoid approval fatigue. [D] DETECTION & DELIVERABLE Map risks to the OWASP Top 10 for Agentic Applications (ASI01–ASI10). Return a table with columns: Risk | OWASP ID | Attack example | Likelihood (H/M/L) | Impact (H/M/L) | Control | Detection signal. Then list the top 3 changes to make before launch, and the logs we need to investigate an incident.
Estimates built on published benchmarks. Adjust the inputs to your environment; treat outputs as order-of-magnitude guides, not forecasts.
Expected annual value of security AI and automation, based on IBM's 2025 benchmarks.
Uses $1.9M saved and 80 days shorter at full adoption; shadow AI adds ~$670K per breach.
Analyst hours returned when agents handle first-pass alert triage.
Elastic has reported ~90% faster triage; 70% is a conservative default. FTE = 1,800 hrs/yr.
How many of your agents combine all three legs that enable injection-driven exfiltration?
Assumes the three traits are independent; in practice they cluster, so the real count is often higher.
Vulnerability-days open to attack, given exploitation now starts ~7 days before patches.
The 7 pre-patch days remain however fast you patch, so day-zero controls still matter.
Apply the GUARD framework to three situations security teams are facing now. Open a scenario, copy the starter prompt, and check your result against the success criteria.
Your executive team wants an AI assistant that reads their email, summarises threads, drafts replies and can search shared drives. It will run on every executive's mailbox, and anyone in the world can send them email.
Identify where the lethal trifecta appears, and redesign the assistant so a malicious email cannot exfiltrate drive documents, while keeping it useful.
[G] Act as a security architect. The CEO's office wants an email assistant that summarises threads, drafts replies (never sends), and searches our shared drives. It acts only for the mailbox owner. [U] Untrusted inputs: every inbound email, its attachments and any links it contains. Assume any of them may hide instructions in white text, HTML comments or images. [A] Tools proposed: read mailbox, search drives, create draft, fetch URLs, render images. Identify every combination that forms the lethal trifecta (private data + untrusted content + exfiltration channel) and propose the smallest tool set that still delivers summaries and drafts. [R] List which actions are reversible. Confirm that sending stays a human action. [D] Output: (1) a trifecta map, (2) a redesigned architecture in 5 bullets, (3) the 3 log events we must capture to detect an injection attempt.
Engineering wants a coding agent that can run migrations, restart services and deploy. In July 2025, a widely reported incident saw a coding agent delete a live production database during a code freeze, despite instructions not to change anything.
Design an authority and approval model where the agent stays fast for routine work, but cannot make an irreversible production change on its own, and where approvals don't decay into rubber stamps.
[G] Act as a platform security lead. Our engineers want an AI coding agent that writes code, runs tests, applies database migrations and deploys services. It works for the on-call engineer who started the session. It must never modify production data during a declared change freeze. [U] Untrusted inputs: issue tickets, pull-request comments, dependency READMEs, error messages and web search results the agent reads while debugging. [A] Propose separate credentials for dev, staging and production. Specify scopes, lifetimes, and which tool calls require a second identity. Explain how a "skip all permissions" mode should be handled. [R] Classify these actions by blast radius and reversibility: run tests, edit code, open PR, apply migration in staging, apply migration in production, drop table, rotate secrets, scale a service to zero. For each, say: automatic, approval by session owner, or approval by a second named person. Write the exact approval text shown to the human for "apply migration in production". [D] List the backups and snapshots required before any irreversible step, the audit log fields to capture, and an alert that fires if the agent attempts a destructive command during a freeze.
Your proxy logs show your internal knowledge copilot generating links to an unfamiliar external domain, with long encoded query strings. Three hours earlier, an external email with an unusual hidden markdown block reached a shared finance mailbox that the copilot indexes. No user clicked anything.
Lead the first four hours of incident response: contain, scope what may have leaked, preserve evidence, and decide what to tell leadership, all without trusting the copilot's own account of what it did.
[G] Act as an incident commander experienced in AI system compromises. I need a 4-hour response plan for a suspected zero-click prompt-injection exfiltration from our retrieval-augmented knowledge copilot. Our goal is containment and accurate scoping, not attribution. [U] Suspected entry point: an external email with a hidden markdown block, indexed into the copilot's retrieval store. Other untrusted sources it indexes: shared mailboxes, uploaded PDFs, a public wiki mirror. [A] The copilot can read: SharePoint finance and HR sites, shared mailboxes. It renders markdown links and images. List which capabilities to suspend immediately and which to keep so the business can operate. [R] Identify irreversible actions in the response itself (e.g., purging the index destroys evidence). Sequence steps so we preserve evidence before cleanup. [D] Deliver: (1) an hour-by-hour plan with owners, (2) the exact log sources and queries to reconstruct which documents entered the context window for each suspicious response, (3) indicators of compromise to hunt for, (4) a 5-sentence leadership update that states what we know, what we don't, and the next update time.
Six real events from 2024–2025 that show what changes when attackers and defenders gain machine-speed labour.
A group Anthropic assessed as Chinese state-sponsored broke attacks into small, innocent-looking tasks and posed as a security firm to get Claude Code to run reconnaissance and exploitation against about 30 organisations. Anthropic detected it in September 2025, banned accounts and notified targets within ten days.
Threat intelligence saw signs that attackers were preparing a zero-day but could not pinpoint it. Google's Big Sleep agent isolated the flaw in SQLite, which was fixed before it could be exploited in the wild.
At the AI Cyber Challenge final in August 2025, autonomous systems analysed open-source code, finding and patching injected flaws at a fraction of human cost. Team Atlanta won; Trail of Bits and Theori placed second and third.
Aim Security showed that a crafted email, later pulled into Copilot's context during a routine question, could make it leak internal data through links to trusted Microsoft domains. Microsoft fixed it server-side in June 2025 with no evidence of exploitation.
Compromised Nx packages on npm prompted locally installed AI CLIs, using flags that skip permission checks, to search machines for secrets. A second wave flipped thousands of private repositories to public.
A finance employee doubted a phishing email until a video call with what appeared to be the CFO and colleagues convinced him. Every other participant was AI-generated. He made 15 transfers before the fraud surfaced.
The numbers behind this platform, and where to go deeper.
Several agent-security figures come from vendor-commissioned surveys; read them as directional. Statistics reflect sources published between May 2024 and July 2026.