AI Security

How to Secure AI

Once AI governance is in place, the security job is to turn the policy into enforceable technical controls. Do not start by buying an “AI security platform” and hoping it solves the problem. Start by understanding where AI is being used, what data it can reach, what actions it can perform, and what could go wrong.

Make sure you start with governance!

Read our other post here.

A useful model is:

Discover → Classify → Control → Monitor → Test → Improve

This aligns well with industry standards to govern, map, measure and manage AI risks, and with AI-specific guidance, which highlights risks such as prompt injection, insecure output handling, sensitive information disclosure, excessive agency, insecure plugins and supply-chain vulnerabilities.

Figure 1: An Approach to Securing AI in your Organisation

1. Start with the risk scenarios, not the products

For most organisations, the main AI security risks are:

RiskExample
Sensitive data leakageStaff paste client data, credentials, contracts or personal information into public LLMs.
Shadow AIUsers sign up for unapproved AI tools or browser extensions.
AI embedded in SaaSExisting platforms quietly add AI features that access organisational data.
Prompt injectionMalicious content in emails, documents or websites manipulates an AI tool or agent.
Excessive agencyAn AI agent can send emails, modify files, query systems or trigger workflows without enough control.
Over-permissioned agentsDesktop or SaaS agents inherit broad user permissions and access too much data.
Insecure AI-generated codeDevelopers ship code generated by AI without proper review.
Data poisoning / bad groundingAI uses untrusted, outdated or manipulated data sources.
Insecure plugins and connectorsAI tools connect to email, files, CRM, finance or ticketing systems without strong controls.
Poor logging and investigationThe organisation cannot reconstruct what prompt, output, action or data flow caused an incident.

The ugly truth: AI agents are a bigger security problem than basic chatbots. A chatbot mostly produces text. An agent can observe, decide and act. That means identity, privilege, data access, logging, approval and kill-switch controls become critical.


2. Segment AI use into security tiers

Do not apply the same controls to every AI use case. Classify AI usage into tiers.

TierExampleSecurity posture
Tier 1: Public LLM useChatGPT, Claude, Gemini, Perplexity, etc. used for generic drafting or researchRestrict sensitive data, monitor usage, educate users
Tier 2: Enterprise LLM useMicrosoft 365 Copilot, Google Gemini for Workspace, ChatGPT Enterprise, internal knowledge assistantsStrong identity, DLP, data access review, logging, configuration hardening
Tier 3: AI embedded in business appsCRM AI, HR AI, finance AI, ticketing AI, security AIVendor review, role-based access, data-flow review, monitoring
Tier 4: AI applications built by the organisationRAG tools, chatbots, workflow copilots, AI customer supportSecure SDLC, threat modelling, testing, prompt injection controls, output validation
Tier 5: Desktop or autonomous AI agentsAgents that operate browsers, files, email, desktop apps or workflowsLeast privilege, sandboxing, approvals, session recording, egress control, kill switch

For Tier 5 agents, assume compromise or manipulation is plausible. Microsoft and others have acknowledged agentic AI risks such as cross-prompt injection, where malicious content embedded in UI elements or documents can override agent instructions and cause unintended actions such as data exfiltration or malware installation.


3. Build an AI security architecture

A practical AI security architecture should have these layers:

Layer 1 — Identity and access control

AI tools and agents must be treated as identities, not just software.

Implement:

  • SSO and MFA for all enterprise AI tools.
  • Conditional access policies.
  • Role-based access control.
  • Privileged access management for admin functions.
  • Separate service accounts for AI agents.
  • No shared AI accounts.
  • Least privilege access for AI connectors.
  • Regular access reviews.
  • Disable consumer AI accounts for business use where practical.

For agents, use the rule:

An AI agent should never have more access than the minimum needed for the specific task, and ideally less than the human user.

Layer 2 — Data security

This is usually the most important layer.

Implement:

  • Data classification.
  • Data loss prevention.
  • Data discovery and labelling.
  • Data security posture management.
  • SaaS data exposure review.
  • SharePoint / OneDrive / Google Drive permission clean-up.
  • Controls preventing sensitive data being entered into unapproved AI tools.
  • Retention and deletion rules for prompts, outputs and logs.
  • Encryption and key management.
  • Controls over training, fine-tuning and retrieval datasets.

Before enabling enterprise AI like Microsoft 365 Copilot or Gemini, fix your data permissions. Otherwise, AI will simply make existing overexposure faster and easier to exploit.

Layer 3 — Endpoint and browser control

Users will access AI through browsers, desktop apps, plugins and agents.

Implement:

  • Endpoint detection and response.
  • Mobile/device management.
  • Browser security controls.
  • Browser extension control.
  • Application allowlisting or application control.
  • Local admin restriction.
  • Clipboard and upload controls for sensitive data where appropriate.
  • Isolation or sandboxing for desktop AI agents.
  • Monitoring of AI desktop applications.
  • Blocking unauthorised AI executables and plugins.

Desktop AI agents are particularly sensitive because they may interact with local files, browsers, email clients and applications.

Layer 4 — Network, cloud and SaaS control

Implement:

  • Secure web gateway or SSE/SASE controls.
  • Cloud access security broker capabilities.
  • DNS filtering.
  • Firewall and proxy controls for known AI services.
  • API gateway controls for AI APIs.
  • Cloud security posture management.
  • SaaS security posture management.
  • Logging from AI platforms into SIEM.
  • Egress monitoring for unusual data transfers.

You need visibility into both sanctioned and unsanctioned AI use.

Layer 5 — AI application security

For AI systems you build or configure, implement:

  • AI threat modelling.
  • Secure development lifecycle controls.
  • Prompt injection testing.
  • Output validation.
  • Input sanitisation.
  • Retrieval source filtering.
  • Guardrails for dangerous actions.
  • Rate limiting.
  • Abuse detection.
  • Secrets scanning.
  • Model and API key protection.
  • Red teaming for higher-risk systems.
  • Human approval before sensitive actions.
  • Segregation between instructions, user data and retrieved content.

OWASP identifies prompt injection, insecure output handling, sensitive information disclosure, insecure plugins, excessive agency and overreliance as key LLM application risks, so these should be explicit test cases in your security assurance process.

Layer 6 — Monitoring, detection and response

Implement:

  • SIEM integration.
  • User and entity behaviour analytics.
  • DLP alerting for AI tools.
  • AI usage logs.
  • Prompt and output logging where legally and operationally appropriate.
  • Agent action logs.
  • API usage monitoring.
  • Model abuse detection.
  • Incident playbooks for AI-related incidents.
  • Ability to suspend AI tools or agents quickly.

For AI agents, logs should answer:

  • Who invoked the agent?
  • What was the user trying to do?
  • What data did the agent access?
  • What instructions did it receive?
  • What external content did it process?
  • What tools or connectors did it use?
  • What actions did it take?
  • Was human approval required?
  • What output was produced?
  • Was data sent outside the environment?

4. Product categories you should consider

Do not treat this as a shopping list where every organisation needs every category. For a mid-sized organisation, I would normally prioritise identity, endpoint, DLP, CASB/SSE, DSPM, SIEM and SaaS posture before buying niche AI security tooling.

Core security products

Product categoryWhy you need it for AI
Identity provider / IAMEnforces SSO, MFA, conditional access and access reviews for AI tools.
Privileged access managementControls admin access to AI platforms, plugins, APIs and agents.
Endpoint detection and responseDetects malicious activity from desktop AI tools, agents, scripts and plugins.
Mobile/device managementEnforces device compliance before accessing enterprise AI.
Secure web gateway / SSE / SASEDetects and controls access to public AI websites and data uploads.
CASBDiscovers shadow SaaS and AI tools, applies controls to cloud services.
DLPPrevents sensitive data from being uploaded, pasted or shared into unauthorised AI systems.
DSPM — Data Security Posture ManagementFinds sensitive data and excessive access across cloud, SaaS and data stores before AI exposes it.
SSPM — SaaS Security Posture ManagementIdentifies risky AI features, misconfigurations and excessive SaaS permissions.
SIEM / XDRCentralises AI-related logs and detects suspicious activity.
SOAR / automationSupports repeatable response to AI data leakage, misuse or agent incidents.
Secrets managementProtects API keys, model tokens and service credentials.
API gateway / WAAPSecures AI APIs and integrations.
Secure code scanningReviews AI-generated code for vulnerabilities and secrets.

AI-specific or AI-enhanced security products

Product categoryUse case
AI security posture managementDiscovers AI assets, models, datasets, prompts, plugins, agents and risks.
LLM firewall / AI gatewayMediates prompts and responses, applies policy, blocks sensitive data, logs activity and controls model access.
Prompt injection testing toolsTests LLM apps and agents against known attack patterns.
AI red teaming platformsAssesses jailbreaks, prompt injection, data leakage, unsafe outputs and agent abuse.
Model monitoring / evaluation platformsTracks accuracy, drift, hallucinations, toxicity, bias and security failures.
AI agent control planeManages permissions, actions, approvals, logs and kill switches for agents.
Content provenance / watermarking toolsHelps identify AI-generated content where this is required.

Be careful with vendor claims. The AI security product market is immature and full of overstatement. OWASP itself notes it does not endorse commercial products, and its LLM guidance should be used as a control and testing reference rather than a vendor selection shortcut.


5. What I would do first

Step 1 — Discover AI use

Find out:

  • Which public LLMs are being used.
  • Which enterprise AI tools are licensed.
  • Which SaaS platforms have AI features enabled.
  • Which browser extensions are installed.
  • Which desktop AI agents are installed.
  • Which APIs are calling AI models.
  • Which departments are using AI for client, HR, finance, legal, cyber or customer-facing work.
  • Which data sources are connected to AI tools.
  • Which users have elevated access to AI-enabled systems.

Use:

  • CASB/SSE logs.
  • DNS/proxy logs.
  • Endpoint software inventory.
  • Browser extension inventory.
  • SaaS admin consoles.
  • Procurement records.
  • Expense claims.
  • API gateway/cloud logs.
  • Staff survey.
  • Business-unit interviews.

Output: AI asset and usage register.

Step 2 — Map data exposure

Identify:

  • What data AI tools can access.
  • Whether sensitive data is exposed.
  • Whether permissions are excessive.
  • Whether AI can access email, files, chat, CRM, HR, finance or ticketing systems.
  • Whether data is used for model training.
  • Whether prompts and outputs are retained.
  • Whether data leaves Australia or approved jurisdictions, if relevant.

Use:

  • DSPM.
  • DLP.
  • Microsoft Purview / Google data protection tooling.
  • SaaS permission reports.
  • Cloud data discovery.
  • Records and privacy reviews.

Output: AI data exposure map.

Step 3 — Classify AI use cases

Classify each AI use case by:

  • Data sensitivity.
  • User population.
  • Business criticality.
  • External exposure.
  • Legal or regulatory impact.
  • Degree of autonomy.
  • Whether it affects people.
  • Whether it can take action.
  • Whether it uses untrusted content.
  • Whether it integrates with business systems.

Output: risk-tiered AI use-case register.

Step 4 — Threat model the high-risk use cases

For each high-risk AI system or agent, assess:

  • Prompt injection.
  • Data leakage.
  • Excessive agency.
  • Insecure connectors.
  • Credential exposure.
  • Bad output causing business harm.
  • Unauthorised action.
  • Supply-chain compromise.
  • Model or prompt theft.
  • Abuse by insiders.
  • Overreliance by staff.
  • Inability to investigate incidents.

Use OWASP GenAI / LLM Top 10 as a checklist. NIST’s AI RMF can frame this as mapping, measuring and managing risks across the lifecycle.

Output: AI threat model and control plan.

Step 5 — Define control baselines by AI tier

Example:

ControlPublic LLMEnterprise LLMSaaS AIInternal AI appDesktop / autonomous agent
Approved tool onlyYesYesYesYesYes
SSO/MFAPreferredRequiredRequiredRequiredRequired
DLPRequiredRequiredRequiredRequiredRequired
LoggingBasicRequiredRequiredRequiredDetailed
Human approvalFor sensitive useRisk-basedRisk-basedRequired for material outputsRequired for actions
Prompt injection testingNoLimitedVendor assuranceRequiredRequired
Data access reviewYesRequiredRequiredRequiredRequired
Vendor reviewYesRequiredRequiredN/A or supplier reviewRequired
Sandbox / isolationNoNoNoEnvironment-basedRequired
Kill switchBlock accessDisable serviceDisable featureDisable app/APIMandatory

Output: minimum AI security control standard.

Step 6 — Implement controls in priority order

My recommended order:

  1. Block or control unapproved public AI tools.
  2. Approve a small number of enterprise AI tools.
  3. Implement DLP for AI usage.
  4. Clean up excessive data permissions.
  5. Disable risky SaaS AI features until assessed.
  6. Control browser extensions and desktop AI applications.
  7. Require SSO/MFA and conditional access.
  8. Log AI activity into SIEM.
  9. Add AI to incident response.
  10. Test high-risk AI systems and agents.

Step 7 — Monitor and improve

Track:

  • AI tools discovered.
  • Shadow AI usage.
  • Sensitive data attempted in AI tools.
  • Approved vs unapproved AI usage.
  • AI incidents and near misses.
  • Prompt injection test results.
  • Agent actions performed.
  • High-risk use cases awaiting review.
  • Vendor AI feature changes.
  • Exceptions granted.
  • Training completion.

6. Specific guidance for LLMs

For public or enterprise LLMs:

Controls to implement

AreaControls
AccessSSO, MFA, conditional access, approved users only
DataDLP, data classification, no sensitive data in public tools
ConfigurationDisable model training on organisational data unless explicitly approved
LoggingCapture user, tool, timestamp, data category, prompt/output metadata where appropriate
UsageApproved use cases, human review, no high-impact decisions without approval
OutputVerification required for legal, financial, security, medical, client-facing or factual outputs
BrowserRestrict AI browser extensions and plugins
APIsCentralise through approved AI gateway or API gateway
VendorsContractual controls for data use, retention, training, incident notification and deletion

Controls for internal LLM apps

Add:

  • Secure SDLC.
  • AI threat modelling.
  • RAG source validation.
  • Retrieval filtering.
  • Prompt injection testing.
  • Output encoding and validation.
  • Secrets scanning.
  • Rate limiting.
  • Abuse detection.
  • Red-team testing.
  • Evaluation suite.
  • User feedback and incident capture.

7. Specific guidance for desktop AI agents

This is where I would be strict.

Desktop agents should be treated like semi-autonomous privileged users. They can interact with files, browsers, emails, applications and websites. That creates a material risk of prompt injection, data leakage and unauthorised action.

Minimum controls for desktop agents

ControlRequirement
Formal approvalNo desktop AI agent without business, security and privacy approval.
Separate identityAgent runs under a dedicated constrained identity where possible.
Least privilegeOnly access required apps, folders and systems.
SandboxingRun in isolated workspace, VM, browser container or managed agent environment.
No local adminAgent must not have admin rights.
App allowlistingAgent can only invoke approved applications and tools.
File access controlLimit folders, repositories, drives and sensitive locations.
Network egress controlRestrict external destinations and uploads.
Human approvalRequired before sending emails, deleting files, changing records, making purchases, submitting forms, executing code or triggering workflows.
Session loggingRecord actions, tool calls, accessed data and outputs.
Kill switchSecurity team can immediately disable the agent.
TestingPrompt injection and malicious document testing before deployment.
MonitoringEDR, DLP, SIEM and behavioural monitoring.

A desktop agent should not be allowed to freely browse the web, read email, inspect documents, access internal systems and take actions unless you are comfortable defending that design to your board after an incident.


8. A practical target-state control stack

For a typical organisation, I would aim for this stack:

Foundation layer

  • Identity provider with SSO/MFA/conditional access.
  • EDR/XDR.
  • MDM/device compliance.
  • SIEM.
  • DLP.
  • Secure web gateway / SASE / CASB.
  • Email and collaboration security.
  • Vulnerability management.
  • Secure configuration management.
  • Backup and recovery.

Data and SaaS layer

  • Data discovery/classification.
  • DSPM.
  • SSPM.
  • SaaS app governance.
  • SharePoint/OneDrive/Google Drive permission review.
  • Records and retention tooling.
  • Privacy management tooling.

AI control layer

  • Approved AI tool catalogue.
  • AI gateway / LLM proxy for APIs.
  • AI usage monitoring.
  • Prompt and response policy enforcement.
  • AI application testing/red teaming.
  • Agent sandbox or control plane.
  • Model monitoring for internally built systems.
  • Vendor AI risk assessment process.

Assurance layer

  • AI threat modelling.
  • Secure SDLC.
  • Control testing.
  • Internal audit.
  • Incident exercises.
  • Red teaming.
  • Metrics and board reporting.

9. Controls mapped to standards and guidance

Security areaControlsStandards / guidance
AI risk managementInventory, classification, assessment, monitoringNIST AI RMF Govern/Map/Measure/Manage
Cybersecurity governancePolicy, roles, risk appetite, oversightNIST CSF 2.0 Govern; ISO/IEC 27001
LLM application securityPrompt injection testing, output validation, least privilege, plugin controlsOWASP Top 10 for LLM Applications
Data protectionDLP, classification, minimisation, retention, privacy impact assessmentISO/IEC 27001, ISO/IEC 27701, privacy law
AI management systemAI policy, impact assessment, lifecycle controls, monitoringISO/IEC 42001
Supplier managementVendor due diligence, contract clauses, assurance evidenceISO/IEC 27036, ISO/IEC 42001
Secure AI designSecure-by-design architecture, monitoring, threat detectionGoogle Secure AI Framework / SAIF
Incident responseAI incident playbooks, escalation, containment, lessons learnedNIST CSF Respond/Recover; ISO/IEC 27035

Google’s Secure AI Framework also reinforces the point that many AI risks should be addressed by extending established security practices into AI systems, rather than treating AI as completely separate from existing security architecture.


10. The implementation roadmap

First 30 days — gain visibility and stop obvious leakage

Do this first:

  • Build an AI usage register.
  • Identify public LLM usage.
  • Identify desktop AI agents and browser extensions.
  • Review enterprise AI licences.
  • Identify SaaS platforms with AI enabled.
  • Issue interim security rules for AI.
  • Block clearly unacceptable AI tools.
  • Enable logging for approved tools.
  • Add AI sites to proxy/CASB monitoring.
  • Start DLP monitoring for AI uploads.
  • Identify high-risk users and teams.

Outcome: you know where the obvious AI risk is.

Days 31–60 — classify and design controls

  • Classify AI tools and use cases by risk.
  • Map data access for enterprise AI.
  • Review permissions in document repositories.
  • Define approved AI tools.
  • Define prohibited AI uses.
  • Define minimum controls by AI tier.
  • Create vendor AI security questionnaire.
  • Create AI incident response playbook.
  • Define desktop agent approval criteria.
  • Select technology gaps.

Outcome: you have a risk-based AI security control model.

Days 61–90 — implement priority controls

  • Enforce SSO/MFA/conditional access.
  • Implement DLP policies for AI.
  • Block unapproved browser extensions.
  • Configure CASB/SSE controls for public AI.
  • Clean up over-permissioned data repositories.
  • Integrate AI logs with SIEM.
  • Review and harden enterprise AI platforms.
  • Assess top 10–20 AI use cases.
  • Test high-risk AI apps for prompt injection.
  • Pilot controls for desktop agents.

Outcome: controls are operating, not just documented.

Months 4–6 — mature the architecture

  • Deploy DSPM or strengthen data discovery.
  • Deploy SSPM if SaaS AI exposure is material.
  • Implement AI gateway for internal AI/API use.
  • Build AI red-team test cases.
  • Create agent sandboxing standards.
  • Update procurement and contracts.
  • Add AI scenarios to tabletop exercises.
  • Report AI security metrics to leadership.

Outcome: AI security becomes business-as-usual.

Months 6–12 — assure and optimise

  • Conduct independent assurance.
  • Test DLP and CASB effectiveness.
  • Red team high-risk AI apps and agents.
  • Review AI incidents and near misses.
  • Update control baselines.
  • Validate vendor claims.
  • Mature monitoring and response.
  • Reassess AI risk appetite.

Outcome: you can prove the controls work.


Summary

For a normal organisation, the priority is not buying a shiny AI security platform. The priority is:

  1. Know where AI is being used.
  2. Stop sensitive data leakage.
  3. Clean up excessive data access before enabling enterprise AI.
  4. Control browser extensions and desktop agents.
  5. Treat AI agents as privileged identities.
  6. Force high-risk AI through threat modelling and testing.
  7. Log enough to investigate incidents.
  8. Have a kill switch.