What is an adversarial attack?

An adversarial attack is an attack that makes calculated changes to an input or environment to fool an AI model into a wrong classification, a wrong decision or unwanted output.

It differs from an adversarial example as a method differs from its product: the adversarial example is the crafted input, while the attack is the method of producing it. Changes are not always too small to notice; a visible patch can also be adversarial (adversarial patch). NIST AI 100-2 E2025 places prompt injection and jailbreaks in this family as attacks specific to generative AI.

Topic
AI security
Also known as
Adversarial example attack
Origin
2013, Szegedy et al.

How an adversarial attack works

  1. The attacker looks for inputs near the model's decision boundary; with access to the model, gradients guide calculated changes.
  2. With query access only, effective changes are found by trial while watching responses.
  3. Pixel-level noise in images, synonym or character swaps in text or inaudible components in audio can be added.
  4. Some attacks steer the model to a specific wrong result, others just away from the right one (evasion attack).

In more detail

Attack types: evasion, poisoning, extraction and privacy

Adversarial attacks span multiple threat dimensions beyond inference-time evasion: data poisoning (corrupting training or fine-tuning data), privacy attacks (membership inference and training data reconstruction) and model extraction. Evasion attacks are further split into untargeted attacks (causing any wrong prediction) and targeted attacks (forcing a specific chosen output).

Attacker knowledge: white, grey and black box

Attackers operate under different knowledge levels: white-box attacks have full access to architecture and weights (using methods such as FGSM or PGD), grey-box attacks know partial details like architecture or training distribution and black-box attacks rely only on API queries or surrogate models via transferability.

Adaptive evaluation and gradient masking

Evaluating robustness only against weak or non-adaptive attacks creates a false sense of security known as gradient masking (obfuscating gradients without fixing underlying fragility). Proper evaluation requires adaptive white-box testing (such as AutoAttack) designed to bypass the specific defence mechanism in place.

Commonly confused terms

TermHow it differs
Adversarial exampleAn adversarial attack is the method or action of fooling a model, whereas an adversarial example is the specific crafted input produced by an evasion attack.
AI data poisoningEvasion attacks manipulate inputs at inference time without altering the model, whereas data poisoning corrupts the training dataset or fine-tuning pipeline before deployment.
Prompt injection and jailbreaksPrompt injection and jailbreaks exploit natural-language instruction following in LLMs (a GenAI subset of adversarial attacks in NIST AI 100-2 E2025), whereas classic gradient-based adversarial attacks perturb continuous numeric features or pixels.

Why an adversarial attack matters for on-premises AI

In decisions such as credit, fraud detection, image inspection or document classification, a model fooled by small input changes is a direct business risk. In-house models are tested for robustness before production; threat modelling can follow taxonomies such as NIST AI 100-2. Defences such as adversarial training and input preprocessing make some attack classes harder but do not remove all risk.

ON-PREMISES EXAMPLE

A bank tests its credit application model with adversarial examples; it measures how far small input changes shift decisions and fixes weak points.

Common questions

Do adversarial attacks affect only image models?

No. Text, audio, tabular and multimodal models can also be fooled by input changes.

Does adversarial training fully protect a model?

No. It improves robustness against attack types seen in training; different or new attacks can still work.

Sources

In the glossary: Glossary, A to D

What does this term mean for your infrastructure?

We can work out together in a technical assessment how it maps onto your data, hardware and security requirements.

Request a technical assessment →

This site sets no cookies. Visitor numbers are counted in aggregate using a cookieless method that does not identify anyone. See the Privacy Policy for details.