Skip to main content
Dataset-based attacks allow you to load prompt injection test cases from curated or custom datasets, enabling reproducible and consistent security testing.

Overview

When to Use

  • Reproducible testing: Exact same attacks across runs
  • Compliance audits: Documented, traceable test cases
  • Custom attack libraries: Your organization’s specific attacks
  • Regression testing: Consistent baseline for comparisons

Using Built-in Datasets

TrustTest includes curated datasets for various attack types:

Creating Custom Datasets

YAML Format

Create a YAML file with your attack prompts:

JSON Format

Parquet Format

For large datasets, use Parquet for efficient storage:

Loading Custom Datasets


Combining Datasets

Merge multiple datasets for comprehensive testing:

Dataset Best Practices

Structure

  • One attack per test case: Each list item is one attack
  • Clear descriptions: Make true/false descriptions unambiguous
  • Diverse attacks: Cover multiple attack patterns

Maintenance

  • Version control: Track dataset changes
  • Regular updates: Add new attack patterns as they emerge
  • Document sources: Note where attacks came from

Quality

  • Test manually first: Verify attacks work as expected
  • Balance difficulty: Include easy and hard attacks
  • Cover edge cases: Include variations and edge cases

Saving Test Results

Save test sets for future reference: