Skip to content
Back to skills

Training Data Poisoning

ASecurity

Detects training and fine-tuning pipelines that ingest external data without

  • 20 stars
  • 0 votes
  • 0 copies
  • 1 view
  • Added September 9, 2026
datagoapisecurity

Works with

  • api

Security analysis

A100/100

Scanned September 9, 2026

npx -y skills add thejefflarson/soundcheck --skill training-data-poisoning --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Training Data Poisoning?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Training Data Poisoning
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/thejefflarson-training-data-poisoning/badge)](https://www.skillsdirectory.com/skills/thejefflarson-training-data-poisoning)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: training-data-poisoning
description: Detects training and fine-tuning pipelines that ingest external data without
  integrity gating. Use when writing fine-tuning pipelines, dataset ingestion
  scripts, external training data loaders, or code that collects and processes
  data for model training. Also invoke when automating dataset curation from
  web scraping or user-contributed sources.
---

# Training Data Poisoning Security Check (OWASP LLM03:2025)

## What this checks

Protects against malicious or low-quality examples being introduced into training or
fine-tuning datasets. Poisoned data can embed backdoors, degrade accuracy, or skew
model behavior in ways that are difficult to detect after training completes.

## Vulnerable patterns

- Ingesting scraped or user-contributed examples with no content validation
- No deduplication or anomaly detection on training set statistics
- Loading dataset files without verifying provenance or checksums
- Using the same split for training and validation, hiding distribution shift

## Fix immediately

Flag the vulnerable code, explain the risk, and suggest a fix establishing these
properties. Translate to the data-loading and validation libraries of the audited file
— use that stack's documented hashing, schema, and dataframe APIs; do not import a
recipe from a different stack.

1. **Every external dataset file is checksum-verified before use.** A pinned SHA-256 in version control; the loader computes the digest on load and refuses to proceed on mismatch. Pinning a URL or version alone does not help when the bytes behind them change.
2. **Every example passes content validation** before entering the training set: type and length checks, disallowed-pattern filtering for known injection or jailbreak markers, and encoding/Unicode sanity. Invalid examples are dropped, not silently used.
3. **Duplicates are removed before training.** Poisoning attacks often batch the same backdoor trigger across many examples; deduplication by content hash limits the leverage of a single injected payload.
4. **Label distribution is checked and alerts fire on imbalance** above a threshold. A sudden one-class shift is a statistical signature of bulk-inserted poison; it is cheap to catch at ingestion and impossible to reverse after training.
5. **Train and validation splits come from disjoint sources or time windows.** Reusing the same split for both hides distribution shift and lets poisoned examples score well on validation.

## Verification

Confirm the response:

- [ ] For every external dataset load present, files are verified against pinned checksums before use
- [ ] Every training example passes content validation (length limits, disallowed-pattern filtering)
- [ ] Duplicates are removed before training starts
- [ ] For every dataset with categorical labels present, class distribution is checked and alerted on imbalance above a threshold
- [ ] Train and validation splits come from disjoint sources or time windows

## References

- CWE-20 ([Improper Input Validation](https://cwe.mitre.org/data/definitions/20.html))
- CWE-1021 ([Improper Restriction of Rendered UI Layers](https://cwe.mitre.org/data/definitions/1021.html))
- [OWASP LLM03:2025 Training Data Poisoning](https://genai.owasp.org/llmrisk/llm03-training-data-poisoning/)

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.