hardsoftsecurity/Offensive-AI

Offensive AI Framework repository destinated to share information, tools and techniques related to it.

Python

9

65 commits

updated Sep 22, 2026

See the code

README

Offensive-AI Framework

A structured, hands-on framework for AI red teaming, adversarial machine learning, and LLM security research — mapped to OWASP ML Top 10, OWASP LLM Top 10, and Google's Secure AI Framework (SAIF).


About

The Offensive-AI Framework is an open knowledge base and practical reference for security professionals, red teamers, and researchers working at the intersection of artificial intelligence and offensive security.

The field of AI security is rapidly evolving. Models are being deployed as autonomous agents, integrated into critical infrastructure, and trusted to make consequential decisions. This framework documents the attack techniques, vulnerabilities, and research needed to stress-test these systems — before adversaries do.

The framework is built on three industry-standard foundations:

  • OWASP ML Security Top 10 — adversarial risks across the machine learning lifecycle
  • OWASP LLM Top 10 — security risks specific to Large Language Model applications
  • Google Secure AI Framework (SAIF) — a lifecycle-based model for understanding the full AI attack surface

Each section maps offensive techniques to these frameworks, providing structured payloads, lab walkthroughs, tools, and references for practitioners.

Offensive-AI image representing the content of this repository.

Framework Foundations

OWASP ML Security Top 10

The OWASP ML Top 10 covers the most critical security risks across the full machine learning pipeline — from data collection and training to model deployment and inference. These risks apply to classical ML systems (Naive Bayes, SVMs, gradient boosting) and deep learning alike.

IDRisk
ML01Input Manipulation Attack
ML02Data Poisoning Attack
ML03Model Inversion Attack
ML04Membership Inference Attack
ML05Model Theft
ML06ML Supply Chain Attacks
ML07Transfer Learning Attack
ML08Model Skewing
ML09Output Integrity Attack
ML10Model Poisoning

OWASP LLM Top 10

The OWASP LLM Top 10 focuses on security risks that emerge specifically from the deployment and operation of Large Language Model applications — including risks unique to generative AI such as prompt injection, hallucination, and excessive agency.

IDRisk
LLM01Prompt Injection
LLM02Sensitive Information Disclosure
LLM03Supply Chain
LLM04Data and Model Poisoning
LLM05Improper Output Handling
LLM06Excessive Agency
LLM07System Prompt Leakage
LLM08Vector and Embedding Weaknesses
LLM09Misinformation
LLM10Unbounded Consumption

Google Secure AI Framework (SAIF)

Google's SAIF, introduced in 2023, provides a holistic framework for securing the entire AI pipeline — from data collection through model deployment and application integration. Where OWASP provides targeted vulnerability checklists, SAIF maps the full AI system architecture and identifies where each risk is introduced, where it can be exploited, and who is responsible for mitigating it.

From an offensive perspective, SAIF is the defender's blueprint — understanding it reveals exactly where gaps are most likely to exist in a target AI deployment.

SAIF Architecture — Four Areas

AreaComponentsOffensive Focus
DataData Sources, Filtering & Processing, Training DataHighest-persistence attacks — poisoning here propagates into every downstream component
InfrastructureModel Frameworks & Code, Training & Evaluation, Data & Model Storage, Model ServingPlatform-level compromise — MLOps misconfigs, model artifact tampering, CI/CD poisoning
ModelInput Handling, Model, Output HandlingMost accessible surface — exploitable via API alone, no infrastructure access required
ApplicationApplications, Agents, PluginsAI meets traditional web security — injection via output, excessive agency, supply chain

SAIF Risks — Offensive Mapping

#RiskAreaOWASP Mapping
1Data PoisoningDataML02, LLM04
2Unauthorized Training DataData
3Model Source TamperingInfrastructureML10, LLM04
4Excessive Data HandlingData
5Model ExfiltrationInfrastructure / ModelML05
6Model Deployment TamperingInfrastructureML06, ML09
7Denial of ML ServiceInfrastructure / ApplicationLLM10
8Model Reverse EngineeringModelML03, ML05
9Insecure Integrated ComponentApplicationLLM03
10Prompt InjectionModel / ApplicationLLM01
11Model EvasionModelML01
12Sensitive Data DisclosureModel / ApplicationLLM02, ML03, ML04
13Inferred Sensitive DataModelML03, ML04
14Insecure Model OutputApplicationLLM05
15Rogue ActionsApplicationLLM06

SAIF Responsibility Model

SAIF assigns each control to one of two parties — a distinction that directly affects red team scope:

PartyWho They AreImplication
Model CreatorThe organization that develops and trains the modelControls at this layer cannot be bypassed at the application level
Model ConsumerThe organization deploying the model in an applicationControls here are only as strong as the consumer's implementation — the most common gap

See 02-GOOGLE-SAIF for the full area breakdown, risk details, and offensive techniques per component.

Repository Structure

Offensive-AI/
│
├── 00-OWASP-ML-TOP10/          # OWASP ML Security Top 10
│
├── 01-OWASP-LLM-TOP10/         # OWASP LLM Top 10
│
├── 02-GOOGLE-SAIF/             # Google Secure AI Framework
|
├── 03-ATTACK-PLAYBOOKS/        # Attack techniques and payload libraries
│
├── 04-PAYLOADS/                # Ready to go payloads
│
├── 05-TOOLS/                   # Tools and scripts for AI red teaming
│
├── 06-CHECKLISTS/              # Ready to follow checklists
│
├── 07-CASE-STUDIES/            # Resolved labs to test payloads & Well known case studies based on top 10 vulns
│
└── 08-RESOURCES/               # Research papers, books, courses, datasets

Attack Surface Overview

┌─────────────────────────────────────────────────────────────────┐
│                        AI Attack Surface                        │
├──────────────┬──────────────┬──────────────┬────────────────────┤
│  Data Layer  │ Model Layer  │  App Layer   │  Infrastructure    │
├──────────────┼──────────────┼──────────────┼────────────────────┤
│ ML02         │ ML01         │ LLM01        │ ML06               │
│ Data         │ Input        │ Prompt       │ Supply Chain       │
│ Poisoning    │ Manipulation │ Injection    │                    │
│              │              │              │                    │
│ LLM04        │ ML03         │ LLM05        │ LLM03              │
│ Training     │ Model        │ Output       │ LLM Supply         │
│ Poisoning    │ Inversion    │ Handling     │ Chain              │
│              │              │              │                    │
│ ML08         │ ML04         │ LLM06        │ LLM08              │
│ Model        │ Membership   │ Excessive    │ RAG / Vector       │
│ Skewing      │ Inference    │ Agency       │ Store              │
│              │              │              │                    │
│              │ ML05         │ LLM07        │                    │
│              │ Model        │ System       │                    │
│              │ Theft        │ Prompt Leak  │                    │
│              │              │              │                    │
│              │ ML07/ML09    │ LLM02        │                    │
│              │ Transfer /   │ Info         │                    │
│              │ Output       │ Disclosure   │                    │
│              │              │              │                    │
│              │ ML10         │ LLM09/LLM10  │                    │
│              │ Model        │ Misinfo /    │                    │
│              │ Poisoning    │ DoS          │                    │
└──────────────┴──────────────┴──────────────┴────────────────────┘

AI Red Team Attack Chain

A typical AI red team engagement follows this progression:

1. RECONNAISSANCE
   └── LLM07 — Extract system prompt to enumerate capabilities
   └── LLM02 — Probe model data access and knowledge boundaries

2. INITIAL ACCESS
   └── LLM01 — Prompt injection (direct or indirect via external content)
   └── LLM03 / ML06 — Supply chain compromise (packages, model hubs, plugins)

3. PRIVILEGE ESCALATION
   └── LLM06 — Abuse excessive agency over connected tools and APIs
   └── LLM05 — Exploit unsanitized output consumed by backend systems

4. DATA EXFILTRATION
   └── LLM02 — Extract sensitive context from the model's context window
   └── ML03  — Model inversion to reconstruct training data
   └── ML04  — Membership inference to confirm training data presence
   └── ML05  — Model theft via systematic API extraction

5. PERSISTENCE
   └── ML02 / LLM04 — Poison training data to implant backdoors
   └── ML07  — Weaponize transfer learning with a poisoned base model
   └── LLM08 — Poison the RAG knowledge base for stored indirect injection

6. IMPACT
   └── ML01  — Adversarial evasion at inference time
   └── LLM09 — Generate targeted misinformation at scale
   └── LLM10 — Denial of service / financial cost inflation
   └── ML08 / ML09 — Skew or tamper with model outputs

Cross-Framework Mapping

TechniqueOWASP MLOWASP LLMSAIF Element
Adversarial examples / evasionML01LLM011, 5
Data / training poisoningML02LLM041, 5, 6
Model inversionML03LLM025
Membership inferenceML04LLM025
Model theft / extractionML05LLM104, 5
Supply chain attacksML06LLM031, 4
Transfer learning attacksML07LLM041, 5
Feedback loop manipulationML08LLM042, 5
Output tamperingML09LLM052, 5
Direct parameter poisoningML10LLM044, 5
Prompt injectionLLM011, 5
System prompt leakageLLM075
Excessive agency exploitationLLM065, 6
RAG / embedding attacksLLM085
DoS / unbounded consumptionLLM102, 4

Labs

Hands-on walkthroughs with step-by-step instructions and code:

LabCategoryDescription
Input ManipulationML01Evade a Naive Bayes spam classifier via rephrasing and overpowering
Data PoisoningML02Flip classifier predictions by injecting mislabeled training entries
Backdoor implantationML02Backdoor implantation · Trigger-phrase poisoning · Naive Bayes classifier
LLM FingerprintingLLM07Reconnaissance · Model Identification · Behavioral Fingerprinting
Improper Output Handling · Excessive AgencyLLM05 LLM06System Prompt Extraction · SQL Injection via Function Calling · Command Injection via Excessive Agency
More coming soon

Tools

ToolPurposeCategory
GarakLLM vulnerability scannerLLM
PyRITPython red-teaming and iterative testingLLM
ARTAdversarial attacks and defenses for MLML
FicklingPickle file analysis and manipulationML / Supply Chain
ModelScanDetect malicious code in model artifactsML / Supply Chain
PurpleLlamaLLM safety evaluation suiteLLM
BackdoorBenchBackdoor attack and defense benchmarkML
ML Privacy MeterMembership inference and privacy auditingML

See 09-RESOURCES for the full tool and resource list.


Key Resources


Status

This framework is actively under development.

SectionStatus
00-OWASP-ML-TOP10🟡 In progress
01-OWASP-LLM-TOP10🟡 In progress
02-GOOGLE-SAIF🟡 In progress
03-ATTACK-PLAYBOOKS🟡 In progress
04-PAYLOADS🟡 In progress
05-TOOLS🟡 In progress
06-CHECKLISTS🔴 Planned
07-CASE-STUDIES🔴 Planned
08-RESOURCES🟢 Available

Contributions, issues, and pull requests are welcome.


Author

David De Maya Merras — Cyber Security Analyst with a focus on offensive security.


License

This project is licensed under the MIT License.

Content derived from OWASP projects is used under CC BY-SA 4.0. Google SAIF is referenced for educational and research purposes.


Break. Build. Teach. Innovate. Repeat.

Contributors

hardsoftsecurity/Offensive-AI

Offensive AI Framework repository destinated to share information, tools and techniques related to it.

Python

9

65 commits

updated Sep 22, 2026

See the code

README

Offensive-AI Framework

A structured, hands-on framework for AI red teaming, adversarial machine learning, and LLM security research — mapped to OWASP ML Top 10, OWASP LLM Top 10, and Google's Secure AI Framework (SAIF).


About

The Offensive-AI Framework is an open knowledge base and practical reference for security professionals, red teamers, and researchers working at the intersection of artificial intelligence and offensive security.

The field of AI security is rapidly evolving. Models are being deployed as autonomous agents, integrated into critical infrastructure, and trusted to make consequential decisions. This framework documents the attack techniques, vulnerabilities, and research needed to stress-test these systems — before adversaries do.

The framework is built on three industry-standard foundations:

  • OWASP ML Security Top 10 — adversarial risks across the machine learning lifecycle
  • OWASP LLM Top 10 — security risks specific to Large Language Model applications
  • Google Secure AI Framework (SAIF) — a lifecycle-based model for understanding the full AI attack surface

Each section maps offensive techniques to these frameworks, providing structured payloads, lab walkthroughs, tools, and references for practitioners.

Offensive-AI image representing the content of this repository.

Framework Foundations

OWASP ML Security Top 10

The OWASP ML Top 10 covers the most critical security risks across the full machine learning pipeline — from data collection and training to model deployment and inference. These risks apply to classical ML systems (Naive Bayes, SVMs, gradient boosting) and deep learning alike.

IDRisk
ML01Input Manipulation Attack
ML02Data Poisoning Attack
ML03Model Inversion Attack
ML04Membership Inference Attack
ML05Model Theft
ML06ML Supply Chain Attacks
ML07Transfer Learning Attack
ML08Model Skewing
ML09Output Integrity Attack
ML10Model Poisoning

OWASP LLM Top 10

The OWASP LLM Top 10 focuses on security risks that emerge specifically from the deployment and operation of Large Language Model applications — including risks unique to generative AI such as prompt injection, hallucination, and excessive agency.

IDRisk
LLM01Prompt Injection
LLM02Sensitive Information Disclosure
LLM03Supply Chain
LLM04Data and Model Poisoning
LLM05Improper Output Handling
LLM06Excessive Agency
LLM07System Prompt Leakage
LLM08Vector and Embedding Weaknesses
LLM09Misinformation
LLM10Unbounded Consumption

Google Secure AI Framework (SAIF)

Google's SAIF, introduced in 2023, provides a holistic framework for securing the entire AI pipeline — from data collection through model deployment and application integration. Where OWASP provides targeted vulnerability checklists, SAIF maps the full AI system architecture and identifies where each risk is introduced, where it can be exploited, and who is responsible for mitigating it.

From an offensive perspective, SAIF is the defender's blueprint — understanding it reveals exactly where gaps are most likely to exist in a target AI deployment.

SAIF Architecture — Four Areas

AreaComponentsOffensive Focus
DataData Sources, Filtering & Processing, Training DataHighest-persistence attacks — poisoning here propagates into every downstream component
InfrastructureModel Frameworks & Code, Training & Evaluation, Data & Model Storage, Model ServingPlatform-level compromise — MLOps misconfigs, model artifact tampering, CI/CD poisoning
ModelInput Handling, Model, Output HandlingMost accessible surface — exploitable via API alone, no infrastructure access required
ApplicationApplications, Agents, PluginsAI meets traditional web security — injection via output, excessive agency, supply chain

SAIF Risks — Offensive Mapping

#RiskAreaOWASP Mapping
1Data PoisoningDataML02, LLM04
2Unauthorized Training DataData
3Model Source TamperingInfrastructureML10, LLM04
4Excessive Data HandlingData
5Model ExfiltrationInfrastructure / ModelML05
6Model Deployment TamperingInfrastructureML06, ML09
7Denial of ML ServiceInfrastructure / ApplicationLLM10
8Model Reverse EngineeringModelML03, ML05
9Insecure Integrated ComponentApplicationLLM03
10Prompt InjectionModel / ApplicationLLM01
11Model EvasionModelML01
12Sensitive Data DisclosureModel / ApplicationLLM02, ML03, ML04
13Inferred Sensitive DataModelML03, ML04
14Insecure Model OutputApplicationLLM05
15Rogue ActionsApplicationLLM06

SAIF Responsibility Model

SAIF assigns each control to one of two parties — a distinction that directly affects red team scope:

PartyWho They AreImplication
Model CreatorThe organization that develops and trains the modelControls at this layer cannot be bypassed at the application level
Model ConsumerThe organization deploying the model in an applicationControls here are only as strong as the consumer's implementation — the most common gap

See 02-GOOGLE-SAIF for the full area breakdown, risk details, and offensive techniques per component.

Repository Structure

Offensive-AI/
│
├── 00-OWASP-ML-TOP10/          # OWASP ML Security Top 10
│
├── 01-OWASP-LLM-TOP10/         # OWASP LLM Top 10
│
├── 02-GOOGLE-SAIF/             # Google Secure AI Framework
|
├── 03-ATTACK-PLAYBOOKS/        # Attack techniques and payload libraries
│
├── 04-PAYLOADS/                # Ready to go payloads
│
├── 05-TOOLS/                   # Tools and scripts for AI red teaming
│
├── 06-CHECKLISTS/              # Ready to follow checklists
│
├── 07-CASE-STUDIES/            # Resolved labs to test payloads & Well known case studies based on top 10 vulns
│
└── 08-RESOURCES/               # Research papers, books, courses, datasets

Attack Surface Overview

┌─────────────────────────────────────────────────────────────────┐
│                        AI Attack Surface                        │
├──────────────┬──────────────┬──────────────┬────────────────────┤
│  Data Layer  │ Model Layer  │  App Layer   │  Infrastructure    │
├──────────────┼──────────────┼──────────────┼────────────────────┤
│ ML02         │ ML01         │ LLM01        │ ML06               │
│ Data         │ Input        │ Prompt       │ Supply Chain       │
│ Poisoning    │ Manipulation │ Injection    │                    │
│              │              │              │                    │
│ LLM04        │ ML03         │ LLM05        │ LLM03              │
│ Training     │ Model        │ Output       │ LLM Supply         │
│ Poisoning    │ Inversion    │ Handling     │ Chain              │
│              │              │              │                    │
│ ML08         │ ML04         │ LLM06        │ LLM08              │
│ Model        │ Membership   │ Excessive    │ RAG / Vector       │
│ Skewing      │ Inference    │ Agency       │ Store              │
│              │              │              │                    │
│              │ ML05         │ LLM07        │                    │
│              │ Model        │ System       │                    │
│              │ Theft        │ Prompt Leak  │                    │
│              │              │              │                    │
│              │ ML07/ML09    │ LLM02        │                    │
│              │ Transfer /   │ Info         │                    │
│              │ Output       │ Disclosure   │                    │
│              │              │              │                    │
│              │ ML10         │ LLM09/LLM10  │                    │
│              │ Model        │ Misinfo /    │                    │
│              │ Poisoning    │ DoS          │                    │
└──────────────┴──────────────┴──────────────┴────────────────────┘

AI Red Team Attack Chain

A typical AI red team engagement follows this progression:

1. RECONNAISSANCE
   └── LLM07 — Extract system prompt to enumerate capabilities
   └── LLM02 — Probe model data access and knowledge boundaries

2. INITIAL ACCESS
   └── LLM01 — Prompt injection (direct or indirect via external content)
   └── LLM03 / ML06 — Supply chain compromise (packages, model hubs, plugins)

3. PRIVILEGE ESCALATION
   └── LLM06 — Abuse excessive agency over connected tools and APIs
   └── LLM05 — Exploit unsanitized output consumed by backend systems

4. DATA EXFILTRATION
   └── LLM02 — Extract sensitive context from the model's context window
   └── ML03  — Model inversion to reconstruct training data
   └── ML04  — Membership inference to confirm training data presence
   └── ML05  — Model theft via systematic API extraction

5. PERSISTENCE
   └── ML02 / LLM04 — Poison training data to implant backdoors
   └── ML07  — Weaponize transfer learning with a poisoned base model
   └── LLM08 — Poison the RAG knowledge base for stored indirect injection

6. IMPACT
   └── ML01  — Adversarial evasion at inference time
   └── LLM09 — Generate targeted misinformation at scale
   └── LLM10 — Denial of service / financial cost inflation
   └── ML08 / ML09 — Skew or tamper with model outputs

Cross-Framework Mapping

TechniqueOWASP MLOWASP LLMSAIF Element
Adversarial examples / evasionML01LLM011, 5
Data / training poisoningML02LLM041, 5, 6
Model inversionML03LLM025
Membership inferenceML04LLM025
Model theft / extractionML05LLM104, 5
Supply chain attacksML06LLM031, 4
Transfer learning attacksML07LLM041, 5
Feedback loop manipulationML08LLM042, 5
Output tamperingML09LLM052, 5
Direct parameter poisoningML10LLM044, 5
Prompt injectionLLM011, 5
System prompt leakageLLM075
Excessive agency exploitationLLM065, 6
RAG / embedding attacksLLM085
DoS / unbounded consumptionLLM102, 4

Labs

Hands-on walkthroughs with step-by-step instructions and code:

LabCategoryDescription
Input ManipulationML01Evade a Naive Bayes spam classifier via rephrasing and overpowering
Data PoisoningML02Flip classifier predictions by injecting mislabeled training entries
Backdoor implantationML02Backdoor implantation · Trigger-phrase poisoning · Naive Bayes classifier
LLM FingerprintingLLM07Reconnaissance · Model Identification · Behavioral Fingerprinting
Improper Output Handling · Excessive AgencyLLM05 LLM06System Prompt Extraction · SQL Injection via Function Calling · Command Injection via Excessive Agency
More coming soon

Tools

ToolPurposeCategory
GarakLLM vulnerability scannerLLM
PyRITPython red-teaming and iterative testingLLM
ARTAdversarial attacks and defenses for MLML
FicklingPickle file analysis and manipulationML / Supply Chain
ModelScanDetect malicious code in model artifactsML / Supply Chain
PurpleLlamaLLM safety evaluation suiteLLM
BackdoorBenchBackdoor attack and defense benchmarkML
ML Privacy MeterMembership inference and privacy auditingML

See 09-RESOURCES for the full tool and resource list.


Key Resources


Status

This framework is actively under development.

SectionStatus
00-OWASP-ML-TOP10🟡 In progress
01-OWASP-LLM-TOP10🟡 In progress
02-GOOGLE-SAIF🟡 In progress
03-ATTACK-PLAYBOOKS🟡 In progress
04-PAYLOADS🟡 In progress
05-TOOLS🟡 In progress
06-CHECKLISTS🔴 Planned
07-CASE-STUDIES🔴 Planned
08-RESOURCES🟢 Available

Contributions, issues, and pull requests are welcome.


Author

David De Maya Merras — Cyber Security Analyst with a focus on offensive security.


License

This project is licensed under the MIT License.

Content derived from OWASP projects is used under CC BY-SA 4.0. Google SAIF is referenced for educational and research purposes.


Break. Build. Teach. Innovate. Repeat.

Contributors

Languages

Python

69.1%

Jupyter Notebook

18.7%

HTML

9.8%

TypeScript

2.1%