Chandrasekar Rathinam logo
Back to all articles
AI Security7 Aug 20268 min read

AI Security for Websites: Protecting LLM Features from Abuse

Chatbots, AI search and summarisation features introduce a new attack surface. Here is how prompt injection, data leakage and cost abuse actually happen — and how to stop them.

Chandrasekar Rathinam

Chandrasekar Rathinam

Cyber Security Consultant · Chennai

Share:

Your chatbot is an application entry point

The moment a website embeds an LLM, it gains an interface that accepts untrusted natural language and acts on it. Traditional input validation does not translate cleanly, because the payload is meaning rather than syntax.

Prompt injection, direct and indirect

Direct injection is a user instructing the model to ignore its system prompt. Indirect injection is far more dangerous: malicious instructions hidden in a web page, PDF or support ticket that your retrieval pipeline later feeds to the model. If the model can call tools, injected text becomes remote code execution by proxy.

Sensitive data disclosure

Two recurring failures: system prompts containing credentials or internal URLs, and retrieval indexes built without per-user authorisation, so one tenant's documents surface in another tenant's answers. Authorisation must be enforced at retrieval time, not by asking the model to be discreet.

Cost and availability abuse

Unauthenticated AI endpoints are free compute for attackers. Without per-identity rate limits, token ceilings and spend alerts, a single script can generate a five-figure bill overnight.

Controls that work

  • Treat all model output as untrusted; never render it as raw HTML and never pass it to a shell or SQL layer
  • Deny-by-default tool access with explicit allowlists and human confirmation for state-changing actions
  • Enforce document-level permissions inside the retrieval layer, filtered by the caller's identity
  • Keep secrets out of prompts; inject them server-side at the tool boundary
  • Rate limit and cap tokens per user, per IP and per API key, with anomaly alerting on spend
  • Log prompts, retrieved context and tool calls for forensics — with PII redaction

Testing the AI layer

An AI penetration test targets these specific behaviours: injection through every ingestion path, tool-abuse chains, tenant isolation in the vector store, guardrail bypasses, and model denial-of-wallet. Map findings against the OWASP Top 10 for LLM Applications and re-test after every prompt or pipeline change.

Related Topics & Tags

#AI security#prompt injection#LLM security#OWASP Top 10 for LLM#AI penetration testing

Have Questions? Get in Touch!

Whether you need an architecture review, a penetration test, or a security programme built from scratch — let's talk about where you are and what comes next.

Contact Me