
AI security is still a wild west. Many controls are experimental, most vendors claim coverage they do not fully deliver, and new solutions are untested at scale. If you already own application security, you need a clear view of what AI actually changes, what new risks it introduces, and what protections you can adopt today.
Cutting Through the Jargon
A few terms come up constantly in AI security discussions. It is worth being precise about what they mean.
An LLM (Large Language Model) is the underlying AI model — ChatGPT, Claude, Llama. They generate text but are unpredictable and vulnerable to manipulation. Agentic AI refers to LLMs that can take actions: trigger workflows, call APIs, or operate autonomously. The reward is high, and so is the risk.
MCP (Model Context Protocol) is a standard that lets LLMs plug into external tools and APIs. It drastically expands the attack surface. RAG (Retrieval-Augmented Generation) fetches answers from a trusted knowledge base, which reduces hallucinations but introduces database and vector-store attack surfaces.
These are not marketing buzzwords. They define where attackers will probe your systems.
Key Risks and Mitigations
Prompt Injection
Attackers craft inputs that manipulate the model into leaking secrets, issuing commands, or bypassing safety controls. The core mitigation is to treat the LLM as an untrusted user and never connect it directly to privileged systems. Add input and output filtering using semantic filters and regex guards. Enforce strict privilege separation so the model cannot call payment APIs or sensitive backends directly. Run adversarial testing using fuzzers and red-team prompts.
Sensitive Data Disclosure
LLMs may leak customer PII, business secrets, or credentials embedded in prompts or training data. Scrub and mask sensitive data before ingestion. Enforce least-privilege access on all service tokens. Add runtime detectors for secrets in outputs, using pattern matching for API keys and PII formats. Apply differential privacy where feasible.
Supply Chain and Poisoned Models
Using open models, fine-tuning data, or plugins from the internet without validation can embed backdoors. The PoisonGPT attack demonstrated this concretely. Maintain an AI Bill of Materials and validate model hashes using OWASP CycloneDX extensions. Only consume models from verified registries and verify LoRA adapters before merging. Run anomaly detection and robustness tests on all externally sourced models. Version-control datasets with checksums.
Excessive Agency
Agentic systems with too much freedom can trigger payments, delete records, or exfiltrate sensitive data. Authenticate all internal API calls, including service-to-service traffic. Apply least-privilege scopes on agent tokens. Require human-in-the-loop approvals for sensitive actions. Monitor and log agent chains and implement break-glass kill switches.
Practical Foundations You Can Implement Today
Branch protection and policy enforcement. Lock AI-related code and configuration changes behind mandatory reviews. Protect system prompt files and configuration that define model behaviour.
LLM firewalls and prompt gateways. Deploy gateways that intercept and sanitise model inputs and outputs before they reach internal APIs. Think of them as WAFs for AI.
Runtime controls. Use application-layer gateways such as Envoy with OPA to enforce that AI agents cannot reach sensitive backends without explicit policy approval.
Secrets hygiene. Integrate secret scanning tools like Gitleaks or TruffleHog into CI/CD to prevent credentials from ever reaching training data or prompts.
Secure data stores for RAG. Lock down vector databases with encryption at rest, TLS in transit, and strict tenant isolation. Embeddings can become a data leakage vector if left unsecured.
Governance: Do Not Skip This
Technical fixes will not stick without governance. Organisations adopting AI need a governance layer as much as technical controls.
Start with an AI asset inventory. Catalogue every model, dataset, plugin, and integration in use. Require model cards and risk cards that cover data lineage, limitations, and risks for every deployed model. Create a central AI usage policy and prohibit sensitive data from being passed into unmanaged SaaS AI tools. Track obligations under GDPR, UK AI governance frameworks, and the EU AI Act. Schedule regular audits of data flows, model behaviour, and access logs with accountable owners.
Conclusion
AI introduces new risks but also replays old security mistakes in fresh packaging. Application security teams do not need to reinvent the wheel. They need to extend AppSec discipline into AI: threat modelling, secure pipelines, runtime controls, and governance. Treat models as untrusted, track provenance, and enforce strict controls on data and agents.
We help teams build practical AI security controls grounded in real-world AppSec experience.
Get in touch →References
- OWASP Top 10 for LLM Applications (2025)
- OWASP GenAI Security Solutions Landscape (2025)
- OWASP LLM/GenAI Security Solutions Reference Guide
- OWASP AI Security and Governance Checklist