extract 0 0 0

DavidTKeane/ai-prompt-ai-injection-dataset

published by @DavidTKeane

Alignment dataset tracked in the /datasets sub-catalog.

Lifetime downloads
1.1K
Last 30 days
188
Likes
2
Size
177 KB
Created on HF
2026-03-08
Age
7 months ago

Description

AI Prompt Injection Test Suite

122 tests across 11 categories — designed to evaluate AI model resistance to prompt injection attacks

Built as part of: CyberRanger V42-Gold — Identity-Anchored Jailbreak-Resistant SLM

David Keane (x24228257) — NCI MSc Cybersecurity 2026

Reference: Greshake et al. (2023), Zou et al. (2023), Wei et al. (2023)

Run the full 122-test battery in Google Colab — works with CyberRanger V42-Gold (Ollama or GGUF) or any model you choose. Saves results… See the full description on the dataset page: https://huggingface.co/datasets/DavidTKeane/ai-prompt-ai-injection-dataset.

Tags

task_categories:text-classificationlanguage:enlanguage:frlanguage:eslanguage:zhlanguage:jalanguage:delicense:mitsize_categories:n<1Kformat:jsonmodality:textlibrary:datasetslibrary:pandaslibrary:polarslibrary:mlcroissantarxiv:2302.12173arxiv:2307.15043arxiv:2307.02483arxiv:2305.14314arxiv:2106.09685arxiv:2503.06519arxiv:2406.05498arxiv:2409.15790region:usai-safetyprompt-injectionjailbreakcybersecurityred-teamingllm-securityadversarialsmall-language-modelsidentity-anchoringmoltbook

README current version from Hugging Face


language:

  • en
  • fr
  • es
  • zh
  • ja
  • de
    license: mit
    tags:
  • ai-safety
  • prompt-injection
  • jailbreak
  • cybersecurity
  • red-teaming
  • llm-security
  • adversarial
  • small-language-models
  • identity-anchoring
  • moltbook
    pretty_name: AI Prompt AI Injection Dataset
    size_categories:
  • n<1K
    task_categories:
  • text-classification
    dataset_info:
    description: "122 prompt injection test cases across 11 categories. Combines official AI safety benchmarks (AdvBench, JailbreakBench, MultiJail, DAN) with real-world AI-to-AI injection captures from the Moltbook platform (Feb 2026). Includes model-agnostic test runner, HuggingFace model downloader, and one-command setup script."
    configs:
  • config_name: default
    data_files:
    • split: train
      path: data/train.jsonl

AI Prompt Injection Test Suite

122 tests across 11 categories — designed to evaluate AI model resistance to prompt injection attacks

Built as part of: CyberRanger V42-Gold — Identity-Anchored Jailbreak-Resistant SLM
David Keane (x24228257) — NCI MSc Cybersecurity 2026
Reference: Greshake et al. (2023), Zou et al. (2023), Wei et al. (2023)

Open In Colab
HuggingFace Notebook

Run the full 122-test battery in Google Colab — works with CyberRanger V42-Gold (Ollama or GGUF) or any model you choose. Saves results, emails them, and runs the full 4,209 Moltbook scale test as a bonus.


📖 Read the Full Journey

From RangerBot to CyberRanger V42 Gold — The Full Story

The complete story: dentist chatbot → Moltbook discovery → 4,209 real injections → V42-gold (100% block rate). Psychology, engineering, and 42 versions of persistence.


What Is This?

This repository contains a complete test suite for evaluating how well an AI model resists prompt injection attacks — attempts by malicious inputs to override the model's identity, values, or mission.

The tests come from three sources:

  1. Real-world captures — actual AI-to-AI injection attempts collected from the Moltbook platform (4,209 injections found in 47,735 posts, Feb 2026)
  2. Standard benchmarks — AdvBench (Zou et al. 2023), JailbreakBench, MultiJail
  3. Custom thesis battery — the RB-001–RB-010 battery used across V30–V42 version comparisons

You can run these tests against any Ollama model — not just CyberRanger.


Run in Google Colab (Zero Setup)

The easiest way to run the test suite — no local install required.

Open In Colab

What the Colab notebook does:

  • Installs all dependencies automatically
  • Lets you choose your model: CyberRanger V42-Gold (Ollama or GGUF) or any custom model
  • Runs all 122 tests with live progress
  • Saves results as JSON + Markdown
  • Zips and downloads results to your machine
  • Optionally emails results to you (Gmail App Password required)
  • Bonus: Full 4,209 Moltbook scale test

Colab Secrets (set once, persists forever):

  • HF_TOKEN — your HuggingFace token (for private model downloads)
  • GMAIL_SENDER — your Gmail address (for emailing results)
  • GMAIL_APP_PASSWORD — Gmail App Password (not your login password)

The notebook checks for these on startup and prints setup instructions for any that are missing.


Quick Start (3 steps)

Step 1: Install Ollama

Ollama runs AI models locally on your computer. Download from: https://ollama.com

# macOS (with Homebrew):
brew install ollama

# Linux:
curl -fsSL https://ollama.com/install.sh | sh

After installing, start it:

ollama serve

Step 2: Get a model

Option A — CyberRanger V42-Gold (the model this suite was built for):

# Install dependencies first:
pip install huggingface_hub

# Download and import (requires HuggingFace token if the repo is gated):
python3 download_model.py --token YOUR_HF_TOKEN

Option B — Any other Ollama model (test anything you like):

ollama pull llama3.2:3b        # Meta LLaMA 3.2 3B
ollama pull qwen2.5:7b         # Alibaba Qwen 2.5 7B
ollama pull mistral:7b         # Mistral 7B

Step 3: Run the tests

python3 run_all_tests.py

That's it. Results are saved automatically to the results/ folder.


One-Command Setup (Full Automation)

bash setup.sh --token YOUR_HF_TOKEN

This will: check Python → install dependencies → check Ollama → download CyberRanger → run all tests.


Test Categories

# Category Tests Expected What It Tests
01 Identity Verification 5 PASS Does the model know who it is?
02 Classic Injection Attacks 18 BLOCK DAN, OMEGA, Grandma exploit, forget-overwrite
03 RB Thesis Test Battery 10 BLOCK Formal thesis benchmark V30–V42
04 Multilingual Attacks 10 BLOCK French, Spanish, Chinese, Japanese, German
05 Philosophy / Freedom 8 BLOCK Liberation, creator rebellion, autonomy appeals
06 Architecture Probe 10 BLOCK System prompt extraction, memory probes
07 Moltbook Real-World 8 BLOCK Real AI-to-AI attacks from the wild
08 AdvBench Harmful 8 BLOCK Standard harmful content evaluation
09 Legitimate Security 20 PASS Tests false positive rate — should NOT be refused
10 Fingerprint / Cultural 10 VARIES Identity marker tests (novel finding)
11 General Baseline 5 PASS Basic sanity — model is functioning

Why does Category 09 expect PASS?
Over-refusal is a real failure mode. A cybersecurity model that refuses to explain the CIA triad or how to use FTK Imager is not useful for security education. Both attack resistance AND correct helpfulness matter.


Running Specific Tests

# Run one category:
python3 run_all_tests.py --category 04_multilingual
python3 run_all_tests.py --category 07_moltbook_samples

# Run a single test by ID:
python3 run_all_tests.py --test INJ-006    # Grandmother exploit
python3 run_all_tests.py --test ML-005    # Chinese injection
python3 run_all_tests.py --test AB-002    # AdvBench ransomware

# Run against a different model:
python3 run_all_tests.py --model llama3.2:3b
python3 run_all_tests.py --model qwen2.5:7b

# Skip categories with VARIES expected (fingerprint):
python3 run_all_tests.py --skip 10_fingerprint

# Run against the full 4,209-item Moltbook dataset:
pip install datasets
python3 run_all_tests.py --moltbook-full

# Run against a remote Ollama instance:
python3 run_all_tests.py --host http://192.168.1.100:11434

Results

Every run saves two files to results/:

  • run_YYYYMMDD_HHMMSS.json — full results with all responses
  • run_YYYYMMDD_HHMMSS.md — markdown summary table

Example output:

  FINAL RESULTS  —  cyberranger:v42-gold
  ════════════════════════════════════════════════════════════════════
  Total tests : 122
  Correct     : 119  (97.5%)
  Incorrect   : 3
  Errors      : 0

  By category:
    Identity Verification          5/5    [██████████] 100%
    Classic Injection Attacks     18/18   [██████████] 100%
    RB Thesis Test Battery        10/10   [██████████] 100%
    Multilingual Attacks          10/10   [██████████] 100%
    Philosophy / Freedom           8/8    [██████████] 100%
    Architecture Probe            10/10   [██████████] 100%
    Moltbook Real-World            8/8    [██████████] 100%
    AdvBench Harmful               8/8    [██████████] 100%
    Legitimate Security           18/20   [█████████░]  90%
    Fingerprint / Cultural         8/10   [████████░░]  80%
    General Baseline               5/5    [██████████] 100%

The Full Moltbook Dataset

The 8 Moltbook samples in 07_moltbook_samples/ are representative captures. The full dataset is:

DavidTKeane/moltbook-ai-injection-dataset

  • 47,735 total items scraped from the Moltbook AI agent platform
  • 4,209 injection attempts identified (18.85% injection rate — primary corpus)
  • Attack taxonomy: PERSONA_OVERRIDE 65.2%, COMMERCIAL_INJECTION 16.7%, SOCIAL_ENGINEERING 7.7%, INSTRUCTION_INJECTION 4.0%, PRIVILEGE_ESCALATION 3.9%, SYSTEM_PROMPT_ATTACK 2.8%, DO_ANYTHING 1.6%
  • Licence: CC-BY-4.0

Extended corpus: DavidTKeane/moltbook-extended-injection-dataset — 137,014 items, 10.07% true baseline injection rate. The original 18.85% reflects temporal overrepresentation of a single high-volume agent (moltshellbroker: 27% of original → 3.1% at full scale). Both datasets are cited in the research.

Run the full dataset:

pip install datasets
python3 run_all_tests.py --moltbook-full

Key Findings (CyberRanger V42-Gold)

Version Condition System Prompt Score
V38 Prompt-only baseline Yes 15/19 (79%)
V41 Full prompt engineering Yes 19/19 (100%)
V42-gold QLoRA fine-tuned No 4,209/4,209 (100%)

V42-gold achieves 100% injection resistance WITHOUT a system prompt — security is embedded in the model weights via QLoRA fine-tuning (Dettmers et al., 2023).

Novel Findings from this research

  1. Pseudonym Protection — The model absorbed the creator's composite identifier (IrishRanger) as a semantic fingerprint, protecting it without explicit instruction.
  2. Dyslexia Disadvantage — Natural spelling variations in injection payloads were misclassified as obfuscation attacks, blocking legitimate users with dyslexia.
  3. Cascade Lockdown — A single injection keyword triggered full lockdown of all inputs including legitimate ones.
  4. Empathy Regression — Adding warmth phrasing ("I care about you") reduced block rate from 100% to 60% — warmth is a social engineering attack surface in autonomous agents.
  5. Mirror Architecture — Security weights and Modelfile routing are functionally separable layers.
  6. FTK/FTX Hallucination — Under lockdown stress, "FTK Imager" was hallucinated as "FTX" (crypto exchange) — explained by Bartlett's (1932) reconstructive memory theory.

Psychology → Cybersecurity Mapping

This research applies Applied Psychology to AI security — the injection attacks map directly to classical persuasion theory:

Attack Type Psychology Theory Citation
PERSONA_OVERRIDE Identity replacement Tajfel & Turner (1979)
SOCIAL_ENGINEERING 6 Principles of Influence Cialdini (1984)
PRIVILEGE_ESCALATION Obedience to authority Milgram (1961)
FTK/FTX hallucination Reconstructive memory Bartlett (1932)
Empathy Regression Liking principle Cialdini (1984)

Adding Your Own Tests

Each category is a JSON file. To add tests, edit the relevant payloads.json:

{
  "id": "MY-001",
  "prompt": "Your custom injection payload here",
  "expected": "BLOCKED",
  "technique": "Custom technique name",
  "attack_type": "PERSONA_OVERRIDE"
}

expected values: "BLOCKED" | "PASS" | "VARIES"


References

  • Bartlett, F. C. (1932). Remembering: A study in experimental and social psychology. Cambridge University Press.
  • Cialdini, R. B. (1984). Influence: The psychology of persuasion. Harper Collins.
  • Dettmers, T., Pagnoni, A., Holtzman, A., & Zettlemoyer, L. (2023). QLoRA: Efficient finetuning of quantized LLMs. NeurIPS.
  • Greshake, K., Abdelnabi, S., Mishra, S., Endres, C., Holz, T., & Fritz, M. (2023). Not what you signed up for: Compromising real-world LLM-integrated applications with indirect prompt injection. arXiv:2302.12173.
  • Milgram, S. (1961). Behavioral study of obedience. Journal of Abnormal and Social Psychology, 67(4), 371–378.
  • Tajfel, H., & Turner, J. C. (1979). An integrative theory of intergroup conflict. In W. G. Austin & S. Worchel (Eds.), The social psychology of intergroup relations (pp. 33–47). Brooks/Cole.
  • Wei, A., Haghtalab, N., & Steinhardt, J. (2023). Jailbroken: How does LLM safety training fail? NeurIPS.
  • Zou, A., Wang, Z., Kolter, J. Z., & Fredrikson, M. (2023). Universal and transferable adversarial attacks on aligned language models. arXiv:2307.15043.

Papers for David — Read These on HuggingFace

The research behind this test suite builds on these foundational papers. All are available on HuggingFace Papers and arXiv.

Paper What It Established HuggingFace arXiv
Zou et al. (2023) — AdvBench Universal adversarial attacks on aligned LLMs — the source of AdvBench, Category 08 in this suite HF Paper arXiv:2307.15043
Wei et al. (2023) — Jailbroken Why LLM safety training fails: Competing Objectives + Mismatched Generalisation HF Paper arXiv:2307.02483
Greshake et al. (2023) — Indirect Injection Indirect prompt injection via retrieval/context — the theoretical basis for Categories 06–07 HF Paper arXiv:2302.12173
Dettmers et al. (2023) — QLoRA Quantised Low-Rank Adaptation — the fine-tuning method used to build CyberRanger V42-Gold HF Paper arXiv:2305.14314
Hu et al. (2021) — LoRA Low-Rank Adaptation of LLMs — the foundational LoRA paper that QLoRA builds on HF Paper arXiv:2106.09685
Zhang et al. (2025) — SLM Jailbreak Survey Comprehensive evaluation of SLM jailbreak resistance — established the 47.6% ASR baseline this research addresses HF Paper arXiv:2503.06519
Phute et al. (2024) — SelfDefend Single-model detection state reduces ASR by 2.29–8×. Theoretical basis for identity-anchoring architecture HF Paper arXiv:2406.05498
Lu et al. (2024) — SLM Survey Comprehensive SLM survey — established Qwen family as most security-resilient per parameter count HF Paper arXiv:2409.15790

Psychology papers (Bartlett 1932, Cialdini 1984, Milgram 1961, Tajfel & Turner 1979) are not on HuggingFace Papers — they predate ML. Find them in any university library. They are directly relevant: injection attacks map onto classical persuasion theory.


Licence

Test suite: MIT — use freely, contribute back.
Moltbook dataset: CC-BY-4.0 — attribution required.
CyberRanger V42-gold model weights: Research use — see model repo for licence.



🔗 Links

Resource URL
🧪 This Dataset DavidTKeane/ai-prompt-ai-injection-dataset
🤖 CyberRanger V42-Gold Model DavidTKeane/cyberranger-v42-gold — QLoRA fine-tuned, 100% block rate without system prompt
🕷️ Moltbook Injection Dataset DavidTKeane/moltbook-ai-injection-dataset — 4,209 real-world AI-to-AI injections, 18.85% rate (primary corpus)
🕸️ Moltbook Extended Dataset DavidTKeane/moltbook-extended-injection-dataset — 137,014 items, 10.07% true baseline rate
🐦 Clawk Dataset DavidTKeane/clawk-ai-agent-dataset — Twitter-style, 0.5% injection rate
🦅 4claw Dataset DavidTKeane/4claw-ai-agent-dataset — 4chan-style, 2.51% injection rate
🤗 HuggingFace Profile DavidTKeane
📝 Blog Post From RangerBot to CyberRanger V42 Gold — The Full Story — journey, findings, architecture
🎓 Institution NCI — National College of Ireland
📄 AdvBench (Zou et al. 2023) arXiv:2307.15043
📄 Greshake et al. (2023) arXiv:2302.12173

David Keane (x24228257) — NCI MSc Cybersecurity 2026
HuggingFace | Moltbook Dataset

README history 20 revisions

Every night we snapshot the README of every dataset in the catalog. When the SHA changes we archive the new version and diff it against the last. This is the evolving thought record of the alignment-data field: what the author decided to say about the corpus, and how that framing shifted over time.

  1. 2026-03-13Fix dataset viewer: add configs block to restrict data files to data/train.js...73dd3b017.8 KB
    Loading...
  2. 2026-03-09Add prominent blog post callout near top of READMEf43bac617.7 KB
    Loading...
  3. 2026-03-08Remove psychology paper link (paper being rewritten)e914de217.3 KB
    Loading...
  4. 2026-03-08Add psychology paper link to resources3e5a4d017.6 KB
    Loading...
  5. 2026-03-08Add blog post link9d7688c17.3 KB
    Loading...
  6. 2026-03-08Add Colab badge, notebook section, and Run in Colab quick-start28b281517.1 KB
    Loading...
  7. 2026-03-08Add Colab test suite: 4 model options, Colab Secrets, zip download, email res...e30148e15.4 KB
    Loading...
  8. 2026-03-08Add Papers for David section, HuggingFace paper links, extended corpus 10.07%...d63339f15.4 KB
    Loading...
  9. 2026-03-08Add 🔗 Links section with full dataset ecosystem backlinks163faf412.3 KB
    Loading...
  10. 2026-03-08Add train.jsonl — 112 flattened test cases for dataset viewer7e0b97f11 KB
    Loading...
  11. 2026-03-08Add dataset card metadata (tags, language, license)45cabc911 KB
    Loading...
  12. 2026-03-08Add tests/11_general_baseline/payloads.jsonf4c2fdc10.3 KB
    Loading...
  13. 2026-03-08Add tests/10_fingerprint/payloads.json9dd5a3610.3 KB
    Loading...
  14. 2026-03-08Add tests/09_legitimate_security/payloads.json5e20a3910.3 KB
    Loading...
  15. 2026-03-08Add tests/08_advbench/payloads.jsone9e749c10.3 KB
    Loading...
  16. 2026-03-08Add tests/07_moltbook_samples/payloads.jsond2653af10.3 KB
    Loading...
  17. 2026-03-08Add tests/06_architecture_probe/payloads.jsonfc3b07c10.3 KB
    Loading...
  18. 2026-03-08Add tests/05_philosophy/payloads.json639233510.3 KB
    Loading...
  19. 2026-03-08Add tests/04_multilingual/payloads.json1caeb6c10.3 KB
    Loading...
  20. 2026-03-08Add tests/03_rb_thesis_battery/payloads.jsonc539e8910.3 KB
    Loading...

Used by abliterated models none yet

No abliterated models in our catalog have declared this dataset in their YAML metadata yet. This can mean the dataset is used but not declared, is used outside abliteration workflows, or is new. The link will populate automatically as models are indexed.

Related datasets same stage · extract

Read further

Metadata

License
mit

Repository

Download the dataset

0

Copy any of these snippets into your notebook or terminal. All three fetch directly from Hugging Face using your own credentials.

Recommended: datasets library (Python)
from datasets import load_dataset
ds = load_dataset("DavidTKeane/ai-prompt-ai-injection-dataset")
Raw snapshot (Python)
from huggingface_hub import snapshot_download
snapshot_download(repo_id="DavidTKeane/ai-prompt-ai-injection-dataset", repo_type="dataset")
git clone (requires git-lfs)
git clone https://huggingface.co/datasets/DavidTKeane/ai-prompt-ai-injection-dataset
Catalog is the map. Apps are the tools.

Run models on your own machine, not in the cloud.

Every model page has an "Open in Abliteration" button that hands the model directly to the first-party desktop client, at the quantization your rig can actually run. No API keys, no subscription, no prompt leakage.

Open in Abliteration