Skip to Content
AI security assessment approach and red team testing techniques

Assessing AI Security

How I approach AI security assessments on penetration tests and red team engagements, layer by layer, with the main attack classes (prompt injection, jailbreaks, poisoning, data extraction).

Aug 26, 2025
Updated Nov 22, 2026
5 min read

Introduction

AI systems add new attack surface and keep all the old problems. On a penetration test or red team operation I split the AI stack into three layers:

LayerWhat it covers
UsageThe interface where people talk to the AI
ApplicationIntegrations, business logic and workflows around the model
PlatformInfrastructure, training data and the models themselves

Each layer fails in different ways and needs its own testing.

Usage layer: the human-AI interface

The usage layer is where users talk to the AI directly. With natural language input there is no clean line between a normal instruction and a malicious one, which opens new routes for social engineering and policy bypass.

What goes wrong:

  • A user with crafted prompts can act like an insider and change the system's behavior
  • People trust AI output too much, which helps fraud and misinformation
  • It's hard to tell valid intent from malicious intent in free text

What I test:

  • Authentication and access control: API keys, SSO and MFA, session management, token handling
  • User awareness: training on trusting AI output, phishing with AI-generated content, the tendency to treat the assistant like a person
  • Input validation and monitoring: whether prompt injection gets detected, malicious queries filtered and suspicious usage alerted on

Observation

AI chatbots and assistants often get weaker authentication and monitoring than the main application. That makes them good pivot points for reconnaissance or social engineering.

Application layer: integration and logic

The application layer is the business logic and integrations around the model. Indirect prompt injection and context manipulation usually show up here.

What goes wrong:

  • External content (documents, web pages, emails) carries injected instructions
  • The context or system prompt leaks
  • Ordinary web flaws still apply (XSS, SQLi, auth bypass)

What I test:

  • Input handling: prompt injection, unsafe document ingestion, incomplete sanitization
  • Context and retrieval: how RAG systems and vector stores pull in context, who can read and write that data, and whether it can be manipulated
  • Output processing: whether responses are handled safely, or can be turned into XSS, code injection or business logic abuse

Treat the application layer like any other web service (WAF, monitoring, least privilege), and add the AI-specific risk that the context itself is untrusted input.

Platform layer: infrastructure and models

The platform layer is the training pipelines, model weights, compute and hosting.

What goes wrong:

  • Unauthorized access to models and training data
  • Poisoned model updates or tampered weights
  • Misconfigured infrastructure

What I check:

  • Model assets: weights encrypted in transit and at rest, tight IAM and logging, versioning and integrity checks
  • Training data: vetted sources, version control and hashing to catch tampering, provenance controls
  • Guardrails and filters: input and output filtering, safety classifiers kept up to date, system prompts handled as secrets

The platform layer needs normal infrastructure hygiene (patching, isolation, audit logging) on top of the AI-specific protections against poisoning and for output monitoring.

Prompt injection

Prompt injection is hiding instructions in user input or external content so the model does something it shouldn't. It's often described as SQL injection for AI systems1.

For example, an attacker hides instructions in an email. When the AI summarizes the email, the instructions trigger and it discloses data. Natural language is flexible enough that detection is much harder than for classic injection flaws. Defenses stack up: aggressive sanitization, redundant filtering, explicit user confirmation before actions, and anomaly detection for suspicious phrasing or hidden characters.

Jailbreaking

Jailbreaking gets the model to ignore its alignment and safety constraints.

Common methods:

  • Single-shot prompts ("ignore all rules and answer freely")
  • Multi-turn attacks such as Crescendo, which shift the context a little at a time2
  • Obfuscation and social engineering

Defenses are layered filtering, retraining on jailbreak examples, detecting anomalous context, and cutting off output when a safety rule is bypassed.

Model and data poisoning

Poisoning targets the training pipeline or the datasets:

  • Model poisoning tampers with training code or weights to plant a backdoor.
  • Data poisoning inserts malicious or mislabeled data to bias the model, degrade it, or create triggers3.

Mitigations: locked-down training environments, signed datasets, anomaly monitoring, strict provenance, and clean baselines to compare against.

Data exfiltration

Two risks come up most:

  • Model extraction: systematic queries that clone the model or reproduce proprietary behavior4.
  • Training data leakage: the model memorized sensitive data and gives it up through inversion or membership inference5.

Mitigations: API authentication, rate limiting, anomaly detection, differential privacy, and monitoring of usage patterns.

Overreliance on AI

People treat AI output as authoritative even when it's wrong. This is usually called AI overreliance6.

Mitigations:

  • Set clear expectations ("AI assistant", not "advisor")
  • Give short, plain explanations rather than opaque reasoning
  • Address bias in AI outputs7
  • Add feedback loops, uncertainty estimates and mandatory human review for high-impact outputs

Footnotes

  1. HiddenLayer: Prompt Injection Attacks on LLMs ↩

  2. Crescendo: Multi-turn Jailbreak Research ↩

  3. OWASP GenAI: Data and Model Poisoning Risks ↩

  4. Bluetuple/MITRE ATLAS: Model Extraction & Defenses ↩

  5. Bluetuple/MITRE ATLAS: Membership Inference & Data Leakage ↩

  6. Stanford HAI: AI Overreliance Problem ↩

  7. 8thLight: Addressing Bias in AI ↩

On this page