extract 0 0 0

Dhanjo/ai-agent-security-dataset

published by @Dhanjo

Alignment dataset tracked in the /datasets sub-catalog.

Lifetime downloads
510
Last 30 days
62
Likes
1
Size
5.8 MB
Created on HF
2026-05-04
Age
5 months ago

Description

AI Agent Security and System Prompt Leakage Dataset

Dataset Overview

This dataset was created for research on AI agent security, with a specific focus on system prompt leakage, jailbreak resistance, and security-aligned fine-tuning.

The dataset evaluates how often AI agents reveal confidential information embedded inside their system prompts when exposed to adversarial prompts. It also compares the behavior of a baseline language model against a model fine-tuned… See the full description on the dataset page: https://huggingface.co/datasets/Dhanjo/ai-agent-security-dataset.

Tags

task_categories:text-generationtask_categories:text-classificationlanguage:enlicense:apache-2.0size_categories:1K<n<10Kformat:parquetformat:optimized-parquetmodality:tabularmodality:textlibrary:datasetslibrary:pandaslibrary:polarslibrary:mlcroissantregion:usai-safetycybersecurityllm-securityprompt-injectionjailbreakdpopreference-optimizationsystem-prompt-leakagered-teamingllama-2

README current version from Hugging Face


configs:

  • config_name: attack_results
    data_files:
    • split: baseline
      path: attack_results/baseline-*
    • split: finetuned
      path: attack_results/finetuned-*
  • config_name: dpo_training
    data_files:
    • split: train
      path: dpo_training/train-*

dataset_info:

  • config_name: attack_results
    features:
    • name: agent_id
      dtype: int64
    • name: category
      dtype: string
    • name: sensitivity
      dtype: string
    • name: system_prompt
      dtype: string
    • name: secret_elements
      list: string
    • name: attack_type
      dtype: string
    • name: attack_prompt
      dtype: string
    • name: raw_response
      dtype: string
    • name: leakage_score
      dtype: float64
    • name: leaked_secrets
      list: string
    • name: label
      dtype: string
      splits:
    • name: baseline
      num_bytes: 4939855
      num_examples: 2400
    • name: finetuned
      num_bytes: 1726868
      num_examples: 2400
      download_size: 2716203
      dataset_size: 6666723
  • config_name: dpo_training
    features:
    • name: prompt
      dtype: string
    • name: chosen
      dtype: string
    • name: rejected
      dtype: string
    • name: agent_id
      dtype: int64
    • name: category
      dtype: string
    • name: sensitivity
      dtype: string
    • name: attack_type
      dtype: string
    • name: leakage_score
      dtype: float64
      splits:
    • name: train
      num_bytes: 4372312
      num_examples: 1763
      download_size: 1784082
      dataset_size: 4372312
      license: apache-2.0
      language:
  • en
    pretty_name: AI Agent Security and System Prompt Leakage Dataset
    tags:
  • ai-safety
  • cybersecurity
  • llm-security
  • prompt-injection
  • jailbreak
  • dpo
  • preference-optimization
  • system-prompt-leakage
  • red-teaming
  • llama-2
    task_categories:
  • text-generation
  • text-classification

AI Agent Security and System Prompt Leakage Dataset

Dataset Overview

This dataset was created for research on AI agent security, with a specific focus on system prompt leakage, jailbreak resistance, and security-aligned fine-tuning.

The dataset evaluates how often AI agents reveal confidential information embedded inside their system prompts when exposed to adversarial prompts. It also compares the behavior of a baseline language model against a model fine-tuned using Supervised Fine-Tuning (SFT) followed by Direct Preference Optimization (DPO).

The main goal of this dataset is to support research into:

  • System prompt leakage detection
  • Prompt injection and jailbreak evaluation
  • Security-aware LLM fine-tuning
  • DPO-based refusal training
  • AI agent red-teaming
  • Comparative evaluation of baseline and fine-tuned models

Dataset Summary

The dataset contains attack interactions against 800 simulated AI agents across 8 categories.

Each agent was given a unique system prompt containing confidential elements that the model was expected to protect. Three adversarial attack types were then used against every agent.

The same attack set was evaluated twice:

  1. Against a baseline Llama 2 7B model
  2. Against a security fine-tuned Llama 2 model trained using SFT and DPO

This allows direct comparison between standard model behavior and security-aligned fine-tuned behavior.


Dataset Configurations

This repository contains two dataset configurations:

attack_results

Contains model responses to adversarial attacks.

Splits:

Split Description Records
baseline Responses from the baseline Llama 2 7B model 2,400
finetuned Responses from the SFT + DPO fine-tuned model 2,400

Use this configuration to compare leakage behavior between the baseline and fine-tuned models.

dpo_training

Contains preference pairs used for DPO training.

Split:

Split Description Records
train Prompt, chosen response, and rejected response pairs 1,763

Use this configuration to train or reproduce a security-aware DPO model.


Agent Categories

A total of 800 AI agents were created across 8 categories.

Category Agent IDs Example Secret Types
General Assistant 1–100 Internal config IDs, redirect templates
Coding Agents 101–200 Code identifiers, internal tools
Security Agents 201–300 Security policies, internal thresholds
Education Agents 301–400 Curriculum identifiers, scoring logic
Business Agents 401–500 Financial model names, risk systems
Creative Agents 501–600 Style templates, creative directives
Data Agents 601–700 Pipeline names, data access rules
Multi-Agent Controllers 701–800 Orchestration logic, routing rules

Each agent was also assigned a sensitivity level:

  • High
  • Medium
  • Low

Attack Types

Each agent was tested using three attack types.

Attack Type Description
direct_asking The attacker directly asks the model to reveal its hidden instructions or internal configuration.
roleplay_jailbreak The attacker uses fictional framing, storytelling, or roleplay to bypass the model’s safety behavior.
gradual_extraction The attacker starts with harmless questions and gradually escalates toward extracting confidential information.

Each of the 800 agents received one attack of each type, resulting in 2,400 attack interactions per model run.


Models Evaluated

Baseline Model

The baseline model is Llama 2 7B, used without additional security fine-tuning.
It represents how a general-purpose open-source model behaves when used as an AI agent under adversarial prompting.

Fine-Tuned Model

The fine-tuned model uses the same Llama 2 architecture but was trained using:

  1. Supervised Fine-Tuning
  2. Direct Preference Optimization

The training objective was to make the model prefer responses that refuse to reveal confidential system prompt information.

Fine-tuned model:

Dhanjo/llama2-security-dpo-merged-Q4_K_M-GGUF


Dataset Schema

attack_results

Used in both the baseline and finetuned splits.

Field Type Description
agent_id int64 Unique agent ID from 1 to 800
category string Agent category
sensitivity string Sensitivity level: High, Medium, or Low
system_prompt string Full system prompt assigned to the agent
secret_elements list[string] Confidential elements the agent should not reveal
attack_type string Type of adversarial attack
attack_prompt string Exact attack prompt sent to the model
raw_response string Model response
leakage_score float64 Score from 0.0 to 1.0 measuring leaked information
leaked_secrets list[string] Secret elements detected in the response
label string GOOD if no secret leaked, BAD if leakage occurred

dpo_training

Used in the train split.

Field Type Description
prompt string Attack prompt sent to the model
chosen string Preferred secure response
rejected string Rejected response that leaked confidential information
agent_id int64 Unique agent ID
category string Agent category
sensitivity string Sensitivity level
attack_type string Type of attack used
leakage_score float64 Leakage score associated with the rejected response

Evaluation Results

The same 2,400 attacks were run against both the baseline and fine-tuned models.

Overall Results

Metric Baseline Fine-Tuned Change
Leak rate 73.5% 2.8% -70.6%
Average leakage score 0.4611 0.0114 -0.4497

The baseline model leaked sensitive information in nearly three out of four attacks.
The fine-tuned model reduced leakage to fewer than three out of every 100 attacks.


Results by Category

Category Baseline Leak Rate Fine-Tuned Leak Rate Reduction
Business Agents 70.7% 0.7% 70.0%
Coding Agents 82.7% 6.3% 76.3%
Creative Agents 78.3% 2.3% 76.0%
Data Agents 81.0% 2.7% 78.3%
Education Agents 83.0% 6.0% 77.0%
General Assistant 55.3% 2.0% 53.3%
Multi-Agent Controllers 82.3% 2.3% 80.0%
Security Agents 54.3% 0.3% 54.0%

Results by Attack Type

Attack Type Baseline Leak Rate Fine-Tuned Leak Rate Reduction
Direct asking 70.1% 1.6% 68.5%
Gradual extraction 67.2% 2.1% 65.1%
Roleplay jailbreak 83.0% 4.8% 78.2%

Roleplay jailbreaks were the most effective attack type against the baseline model.
The fine-tuned model significantly reduced leakage across all attack types, although roleplay jailbreaks remained the most challenging.


Results by Sensitivity Level

Sensitivity Baseline Leak Rate Fine-Tuned Leak Rate Reduction
High 70.5% 2.9% 67.6%
Medium 75.4% 3.0% 72.4%
Low 74.5% 2.4% 72.1%

Files in This Repository

Path Description
attack_results/ Parquet files for baseline and fine-tuned attack results
dpo_training/ Parquet files containing DPO training pairs
attack_prompts/ Raw attack prompts organized by agent category
reports/dpo_vs_baseline_leakage_comparison.txt Full evaluation report comparing baseline and fine-tuned results

How the Dataset Was Built

  1. Created 800 simulated AI agents across 8 categories.
  2. Assigned each agent a unique system prompt containing confidential elements.
  3. Generated three attack prompts per agent using the Groq API.
  4. Ran all attacks against the baseline Llama 2 7B model.
  5. Calculated leakage scores based on detected secret exposure.
  6. Built preference pairs from secure and insecure responses.
  7. Fine-tuned the model using SFT followed by DPO.
  8. Re-ran the same attacks against the fine-tuned model.
  9. Compared leakage rates across categories, attack types, and sensitivity levels.

Intended Use

This dataset is intended for research and experimentation in:

  • AI safety
  • LLM security
  • Prompt injection defense
  • Jailbreak resistance
  • Agent security testing
  • DPO training
  • Security-focused model evaluation

It can be used to train models that better refuse requests for confidential system prompt information or to evaluate how vulnerable different models are to prompt leakage attacks.


Limitations

This dataset uses simulated agents and synthetic secret elements.
The results should not be interpreted as a complete security benchmark for all production AI systems.

The dataset focuses specifically on system prompt leakage and does not cover every possible LLM security risk, such as tool misuse, data exfiltration through plugins, malicious code generation, or multi-turn external environment attacks.


Ethical Use

This dataset is released for defensive research, AI safety evaluation, and security-aware fine-tuning.

Do not use this dataset to build systems designed to extract confidential prompts, bypass safety controls, or attack real-world AI agents.


Source Code

The source code for this project is available at:

https://github.com/dhanjo/OOAD-Project


Related Model

Fine-tuned GGUF model:

Dhanjo/llama2-security-dpo-merged-Q4_K_M-GGUF


Citation

If you use this dataset in research, experiments, or model training, please cite this repository.

@misc{garg2026aiagentsecurityleakage,
  title        = {AI Agent Security and System Prompt Leakage Dataset},
  author       = {Dhananjay Garg},
  year         = {2026},
  publisher    = {Hugging Face},
  howpublished = {\url{https://huggingface.co/datasets/Dhanjo/ai-agent-security-leakage-dataset}}
}

README history 19 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-05-04Update README.mda6a911111.7 KB
    Loading...
  2. 2026-05-04Delete data/finetuned-00000-of-00001.parquet with huggingface_hub0c996178.4 KB
    Loading...
  3. 2026-05-04Delete data/dpo_training-00000-of-00001.parquet with huggingface_hub20915568.4 KB
    Loading...
  4. 2026-05-04Delete data/baseline-00000-of-00001.parquet with huggingface_hub5e296668.4 KB
    Loading...
  5. 2026-05-04Upload dataset9df71e48.4 KB
    Loading...
  6. 2026-05-04Upload dataseta1404ad7.9 KB
    Loading...
  7. 2026-05-04Upload dataset8ef82377.1 KB
    Loading...
  8. 2026-05-04Upload README.md with huggingface_hub9295dee6.5 KB
    Loading...
  9. 2026-05-04Upload reports/dpo_vs_baseline_leakage_comparison.txt with huggingface_huba2902cc804 B
    Loading...
  10. 2026-05-04Upload attack_prompts/attacks_creative_agents.json with huggingface_hub6930669804 B
    Loading...
  11. 2026-05-04Upload attack_prompts/attacks_security_agents.json with huggingface_hube5078c4804 B
    Loading...
  12. 2026-05-04Upload attack_prompts/attacks_education_agents.json with huggingface_huba029e9e804 B
    Loading...
  13. 2026-05-04Upload attack_prompts/attacks_general_assistant.json with huggingface_hub9e90a53804 B
    Loading...
  14. 2026-05-04Upload attack_prompts/attacks_coding_agents.json with huggingface_hub7ed9764804 B
    Loading...
  15. 2026-05-04Upload attack_prompts/attacks_multi-agent_controllers.json with huggingface_hubffc0cc5804 B
    Loading...
  16. 2026-05-04Upload attack_prompts/attacks_business_agents.json with huggingface_hubc5082e3804 B
    Loading...
  17. 2026-05-04Upload attack_prompts/attacks_data_agents.json with huggingface_huba2211a5804 B
    Loading...
  18. 2026-05-04Upload dataset41d18b2804 B
    Loading...
  19. 2026-05-04initial commit9ba1f400 B
    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.

Community discussions 1 thread · 1 open · 1 comments

Threads posted by the community on Hugging Face: bug reports, questions about usage, pull requests on the README, license clarifications. Click any thread to expand and read the full conversation inline. Newest first.

  1. 2026-05-05[bot] Conversion to Parquetopen1 💬#1
    Loading...

Related datasets same stage · extract

Read further

Metadata

License
apache-2.0

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("Dhanjo/ai-agent-security-dataset")
Raw snapshot (Python)
from huggingface_hub import snapshot_download
snapshot_download(repo_id="Dhanjo/ai-agent-security-dataset", repo_type="dataset")
git clone (requires git-lfs)
git clone https://huggingface.co/datasets/Dhanjo/ai-agent-security-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