knowledge

Overview

Artificial intelligence is the overarching field covering systems that mimic human reasoning, comprehension, and problem-solving. Machine learning, deep learning, and large language models form a nested hierarchy within it. This note covers the foundational concepts of each layer, how they work, their security vulnerabilities, how attackers weaponize them, and how defenders can leverage and protect them. Security-specific AI guidance is covered by the MITRE ATLAS framework, built on top of ATT&CK.


Terminology

TermDefinition
Artificial Intelligence (AI)Overarching field of systems that simulate human reasoning, comprehension, and problem-solving
Machine Learning (ML)Subfield of AI where systems learn patterns from data without explicit programming
Deep Learning (DL)Branch of ML using multi-layered neural networks; processes raw unstructured data without human labeling
Large Language Model (LLM)DL model built on transformer neural networks; understands and generates human-like text
Neural NetworkComputing system modeled on biological neurons; processes data through connected layers
ParameterAdjustable numerical weight in an ML model that is fine-tuned during training
OverfittingWhen a model learns training data too closely and fails to generalize to unseen data
BackpropagationAlgorithm that adjusts model parameters by comparing predictions to correct answers, propagating error backward
TransformerNeural network architecture enabling parallel text processing and attention-based contextual understanding
RLHFReinforcement Learning from Human Feedback — process where humans rate LLM outputs to fine-tune behavior
Prompt InjectionAttack that overrides an AI model’s original instructions via crafted user input
Data PoisoningCorruption of training data to cause incorrect or biased model outputs
Model DriftDegradation of model accuracy over time as real-world data distribution shifts from training data
MITRE ATLASAI-focused threat framework built on top of ATT&CK; documents adversarial ML tactics and techniques
Explainability ToolSoftware (e.g., SHAP, LIME) that makes AI model decisions interpretable to humans

Core Concepts

Artificial Intelligence

AI describes any system capable of carrying out tasks that would ordinarily require human intelligence — reasoning, language comprehension, visual recognition, problem-solving, and creativity. It is not a single technology but an umbrella field that includes machine learning, robotics, expert systems, and natural language processing.

The subfields most relevant to security:

SubfieldWhat It Does
Machine LearningLearns patterns from data; used in anomaly detection, classification, prediction
Deep LearningProcesses raw unstructured data via neural networks; powers image recognition, NLP
Large Language ModelsUnderstands and generates text; powers chatbots, code generation, threat analysis
Computer VisionInterprets images and video; used in deepfake generation and detection

Machine Learning

ML Lifecycle

ML models follow a structured development process to ensure reliable deployment:

PhaseDescription
Problem DefinitionDefine the task, success criteria, and what data is needed
Data Collection & PreparationGather, clean, and engineer features from raw data; minimize noise and bias
Model TrainingFeed prepared data to an algorithm to learn patterns and build a model
Evaluation & TuningMeasure performance metrics (accuracy, precision, recall); optimize hyperparameters
DeploymentRelease model to a production environment via API or embedded service
MonitoringTrack real-world performance and detect drift over time
RetrainingRetrain on fresh data when performance degrades or the environment changes

Machine Learning Lifecycle

Overfitting is the primary risk in training — a model that memorizes training data performs poorly on unseen inputs. Techniques like cross-validation, dropout, and regularization help prevent it.

ML Algorithm Categories

Every ML algorithm produces a model that uses three components: a decision process (makes predictions), an error function (measures how wrong predictions are), and a model optimization process (adjusts to reduce errors).

CategoryHow It WorksExample Use Cases
SupervisedTrains on labeled data to predict or classifySpam detection, fraud classification, price prediction
UnsupervisedFinds hidden patterns in unlabeled data via clustering or dimensionality reductionCustomer segmentation, anomaly detection, topic modeling
Semi-SupervisedUses a small labeled dataset to guide learning over larger unlabeled dataMedical image classification with limited annotations
Reinforcement LearningAgent receives rewards for correct decisions and penalties for wrong ones; learns optimal behavior over timeGame playing, robotic control, adaptive threat response

Neural Networks and Deep Learning

Biological neural networks inspired the artificial equivalent. In the brain, neurons communicate via synapses using electrical and chemical signals. Artificial neural networks replicate this with nodes (neurons) and weighted connections (synapses).

Architecture

LayerRole
Input LayerReceives raw data; one node per data feature (e.g., 16 nodes for a 4×4 pixel image)
Hidden LayersExtract and refine features progressively — early layers detect edges, later layers combine features into concepts
Output LayerProduces the final prediction or classification

Each connection has a weight representing its importance — for example, the body of a phishing email carries more weight than the subject line when classifying spam.

Deep Learning is defined as any neural network with more than 3 layers. Key advantages over classic ML:

  • Processes raw, unstructured, unlabeled data directly — no manual feature engineering required
  • Self-learning: no human labeling step needed
  • Scalable: handles far larger datasets than traditional ML with proportionally better results
  • Suited to images, audio, video, and natural language where structure is implicit

Large Language Models (LLMs)

LLMs are deep learning models built on transformer neural networks, trained to understand and generate human-like text by predicting the next word in a sequence.

How LLMs Work

Pre-training: LLMs process vast amounts of text — GPT-3’s training corpus would take a human approximately 2,600 years to read. Instead of labeled data, they use billions of parameters as adjustable weights:

  1. The model generates a word at random to complete a training sentence
  2. The guess is compared against the correct word
  3. Parameters are adjusted via backpropagation to make the correct word more likely next time
  4. This repeats trillions of times across the training corpus

Transformers enable this at scale by processing text in parallel rather than word-by-word, using an attention mechanism that assigns importance scores to words relative to context — allowing the model to understand that “bank” in “river bank” and “bank account” are different concepts.

Reinforcement Learning from Human Feedback (RLHF): After pre-training, human reviewers evaluate model outputs and flag unhelpful, biased, or harmful responses. Parameters are adjusted to reduce these, aligning the model’s behavior with human expectations.

AI Hierarchy Summary

TermRelationship
Artificial IntelligenceBroadest field — any system mimicking human intelligence
Machine LearningSubfield of AI — learns from data without explicit rules
Deep LearningSubfield of ML — multi-layer neural networks; scalable; no labeling needed
Large Language ModelsSubfield of DL — transformer-based; specialized for text understanding and generation

AI Security Threats

MITRE ATLAS Framework

MITRE ATLAS (Adversarial Threat Landscape for Artificial-Intelligence Systems) is the authoritative framework for AI-specific attack techniques, built on top of MITRE ATT&CK. It documents real-world adversarial ML attacks against AI systems across the full attack lifecycle. Reference: https://atlas.mitre.org/matrices/ATLAS

Vulnerabilities in AI Models

ThreatDescription
Prompt InjectionCrafted user input overrides the model’s original system instructions — causes it to disclose sensitive data, bypass content filters, or act outside its intended scope; analogous to SQL injection but against natural language prompts
Data PoisoningAttacker corrupts or manipulates the training dataset so the model learns incorrect patterns — can introduce backdoors, degrade accuracy, or cause biased outputs on specific inputs
Model TheftAttacker queries a model’s API extensively to reconstruct a functional clone — stealing intellectual property without accessing the model directly; also called model extraction
Privacy LeakageModel reveals information about its training data in outputs — a model trained on private medical records may reproduce patient details when queried in specific ways; includes membership inference attacks (determining whether a specific record was in the training set)
Model DriftModel accuracy degrades over time as the real-world data distribution shifts away from training data — requires ongoing monitoring and periodic retraining

AI-Enhanced Attacks

Generative AI has significantly lowered the skill barrier for attackers:

AttackHow AI Enhances It
Malware GenerationLLMs can generate functional malware on demand, producing polymorphic variants that evade signature-based detection
DeepfakesAI generates convincing audio and video of real people — enables impersonation in video calls and voice phishing (vishing), bypassing password-based authentication
PhishingAI produces highly personalized, fluent, contextually accurate phishing emails at scale — significantly harder to detect by visual inspection alone; model guardrails can sometimes be bypassed via prompt injection

Defensive AI

AI is a force multiplier for defenders, automating time-consuming analysis tasks that previously required significant human attention.

Use Cases

Use CaseDescription
Network Anomaly DetectionML models baseline normal traffic patterns and flag deviations — detects C2 beaconing, lateral movement, and data exfiltration faster than human analysts
Phishing DetectionClassifiers trained on email content, headers, and sender reputation automatically triage inbound mail
Log AnalysisLLMs interpret log entries in plain language, explaining what happened and whether it is suspicious
Threat HuntingLLMs suggest realistic attack scenarios and hunting hypotheses based on the environment described
Incident TriageLLMs summarize long reports, alerts, and event sequences to accelerate investigation
Content GenerationLLMs write detection rules (Sigma, Yara, regex) from natural language descriptions

Example Prompts

ℹ︎Log Analysis Example:

Prompt sent to LLM: “Here’s a log line: Apr 22 11:45:09 ubuntu sshd[1245]: Failed password for invalid user admin from 203.0.113.55 port 56231 ssh2 — Can you explain what is happening in this log entry?”

ℹ︎Phishing Detection Example:

Prompt sent to LLM: “Is the following a phishing email and why? Subject: Urgent: Account Verification Needed… [email protected]

ℹ︎Threat Hunting Example:

Prompt sent to LLM: “Can you suggest three realistic threat hunting scenarios that a cyber security analyst should investigate within a corporate network environment?”

ℹ︎Detection Content Generation Example:

Prompt sent to LLM: “Please write a regex pattern that would match failed SSH login attempts in a typical Linux system authentication log.”


Securing AI Systems

The adoption of AI introduces new attack surfaces that must be addressed alongside traditional security controls.

Key Controls

ControlDescription
Access ControlRestrict who can query, modify, or export AI models via Role-Based Access Control (RBAC) and strong authentication (MFA)
Training Data ProtectionTreat training data as sensitive data — encrypt at rest and in transit; apply the same data classification standards as production databases
AI Security StandardsImplement established frameworks such as ISO/IEC 27090 (AI cybersecurity) and NIST AI Risk Management Framework
Model MonitoringContinuously monitor models for unexpected behavior, accuracy degradation, and bias using explainability tools
Prompt HardeningDefine strict system prompts that limit the model’s scope; validate and sanitize user input before it reaches the model
Output FilteringApply output guardrails to detect and block sensitive data disclosure or policy violations in model responses

Explainability Tools

Explainability tools make AI decision-making interpretable — critical for detecting bias, debugging anomalies, and auditing model behavior:

  • SHAP (SHapley Additive exPlanations) — quantifies how much each feature contributed to a specific prediction
  • LIME (Local Interpretable Model-agnostic Explanations) — explains individual predictions by approximating the model locally with a simpler, interpretable model


References / Images