Source profileQuality 92/100Review permissions

adriannoes/awesome-agentic-ai/cursor-claude-codex/skills/anthropic-cybersecurity-skills/skills/detecting-data-and-model-poisoning/SKILL.md

detecting-data-and-model-poisoning

Identify poisoned training data and backdoored models across the ML pipeline.

Source repository stars
52
Declared platforms
0
Static risk flags
1
Last source update
2026-08-22
Source checked
2026-08-28

Decision brief

What it does: where it fits

Authorized-use-only notice: This skill includes routines that craft poisoned samples and backdoor triggers for defensive validation. Generate and use poisoned data and backdoored models only in isolated test environments you control. Never deploy a backdoored model or distribute…

Best for

  • Before training/fine-tuning on third-party or user-contributed data.
  • Before deploying a model built on a downloaded pre-trained checkpoint.
  • During an ML supply-chain security review.

Not for

  • Tasks that require unconfirmed production actions or broad system permissions.
  • Environments where the pinned source and install steps cannot be inspected.

Compatibility matrix

Platform support, with evidence labels

PlatformStatusEvidenceWhat to check
CodexNot declaredNo explicit evidencePortability before use
Claude CodeNot declaredNo explicit evidencePortability before use
CursorNot declaredNo explicit evidencePortability before use
Gemini CLINot declaredNo explicit evidencePortability before use
Open the compatibility checker

Installation

Inspect first. Install second.

The source command is displayed only when detected. A safe inspection prompt is always available so your agent can explain every action before execution.

Source-detected install commandSource
npx skills add https://github.com/adriannoes/awesome-agentic-ai --skill "cursor-claude-codex/skills/anthropic-cybersecurity-skills/skills/detecting-data-and-model-poisoning"
Safe inspection promptEditorial

Inspect the Agent Skill "detecting-data-and-model-poisoning" from https://github.com/adriannoes/awesome-agentic-ai/blob/7f71af8164e8f5a775253417aa405b5d9d063faf/cursor-claude-codex/skills/anthropic-cybersecurity-skills/skills/detecting-data-and-model-poisoning/SKILL.md at commit 7f71af8164e8f5a775253417aa405b5d9d063faf. List every install step, command, network request, credential, file read/write, external action, and rollback step. Explain whether it fits my task. Do not install or execute anything until I approve.

Workflow

What the source asks the agent to do

  1. 01

    Workflow

    Refuse artifacts whose hash/signature you cannot verify, and prefer safetensors over pickle-based formats (pickle can execute code on load).

    Refuse artifacts whose hash/signature you cannot verify, and prefer safetensors over pickle-based formats (pickle can execute code on load).
  2. 02

    When to Use

    Before training/fine-tuning on third-party or user-contributed data.

    Before training/fine-tuning on third-party or user-contributed data.Before deploying a model built on a downloaded pre-trained checkpoint.During an ML supply-chain security review.
  3. 03

    Prerequisites

    bash python -m venv .venv && source .venv/bin/activate

    Python 3.10+ and a virtual environment.Install the tooling:- Python 3.10+ and a virtual environment. - Install the tooling:
  4. 04

    IBM Adversarial Robustness Toolbox — poisoning detection defenses

    pip install adversarial-robustness-toolbox

    pip install adversarial-robustness-toolbox
  5. 05

    Cleanlab — label/data quality issue detection

    Review the “Cleanlab — label/data quality issue detection” section in the pinned source before continuing.

    Review and apply the “Cleanlab — label/data quality issue detection” source section.

Permission review

Static risk signals and limitations

Runs scripts

medium · line 25

The documentation asks the agent to run terminal commands or scripts.

python -m venv .venv && source .venv/bin/activate

Evidence record

Why each signal appears

EvidenceSourceComputedTestedEditorial
SignalValueEvidence typeMeaning
Quality score92/100ComputedDocumentation, specificity, maintenance, and trust rules
Repository stars52SourceRepository attention, not individual Skill quality
Compatibility0 platformsSourceDeclared in the catalog source record
Usage guideautomated source guideEditorialGenerated or reviewed according to the visible evidence level

Pinned source

Provenance and original SKILL.md

Repository
adriannoes/awesome-agentic-ai
Skill path
cursor-claude-codex/skills/anthropic-cybersecurity-skills/skills/detecting-data-and-model-poisoning/SKILL.md
Commit
7f71af8164e8f5a775253417aa405b5d9d063faf
License
MIT
Collected
2026-08-28
Default branch
main
View the original SKILL.md

Detecting Data and Model Poisoning

Authorized-use-only notice: This skill includes routines that craft poisoned samples and backdoor triggers for defensive validation. Generate and use poisoned data and backdoored models only in isolated test environments you control. Never deploy a backdoored model or distribute poisoned datasets.

Overview

Data poisoning and model backdooring attack the integrity of an ML system at training time rather than at inference. In data poisoning (MITRE ATLAS AML.T0020 Poison Training Data), an adversary injects manipulated samples into the training, fine-tuning, or RAG corpus so the resulting model misbehaves — degraded accuracy, targeted misclassification, or an attacker-chosen bias. In model backdooring (MITRE ATLAS AML.T0018 Backdoor ML Model), the model behaves normally on clean inputs but produces an attacker-chosen output whenever a hidden trigger (a pixel patch, a rare token, a phrase) is present. Both are amplified by ML supply-chain compromise (AML.T0010): poisoned public datasets, trojaned pre-trained weights downloaded from a hub, or a malicious model serialization. This is OWASP LLM04:2025 Data and Model Poisoning.

Detection spans the pipeline. On the data side: provenance and integrity checks, statistical outlier and label-flip detection, and de-duplication of suspiciously near-identical samples. On the model side: activation-clustering and spectral-signature analysis (which exploit the fact that poisoned samples activate the network differently than clean ones) and trigger reconstruction. On the supply-chain side: verifying weights hashes/signatures and refusing unsafe serialization formats (pickle-based .bin/.pt) in favor of safetensors. This skill implements all three using IBM's Adversarial Robustness Toolbox (ART), Cleanlab for label-quality issues, and integrity tooling.

When to Use

  • Before training/fine-tuning on third-party or user-contributed data.
  • Before deploying a model built on a downloaded pre-trained checkpoint.
  • During an ML supply-chain security review.
  • When investigating anomalous model behavior tied to specific inputs (possible backdoor trigger).
  • As a CI/CD gate that scans datasets and model artifacts before they enter the pipeline.

Prerequisites

  • Python 3.10+ and a virtual environment.
  • Install the tooling:
python -m venv .venv && source .venv/bin/activate

# IBM Adversarial Robustness Toolbox — poisoning detection defenses
pip install adversarial-robustness-toolbox

# Cleanlab — label/data quality issue detection
pip install cleanlab

# Modeling + safe serialization + hashing
pip install numpy scikit-learn safetensors

# (Choose one framework backend ART can wrap)
pip install tensorflow   # or: pip install torch

Objectives

  • Verify dataset and model-weight provenance and integrity (hashes/signatures, safe formats).
  • Detect label-quality issues and outliers in training data with Cleanlab.
  • Detect poisoned samples in a trained model using ART activation clustering.
  • Confirm findings with ART spectral-signature analysis.
  • Probe a suspect model for backdoor triggers and quantify trigger-induced misclassification.
  • Produce a poisoning-assessment report mapped to ATLAS AML.T0020 / AML.T0018.

MITRE ATT&CK Mapping

IDOfficial NameRelevance
AML.T0020Poison Training DataInjection of manipulated samples into the training corpus
AML.T0018Backdoor ML ModelTrigger-activated hidden behavior in the trained model
AML.T0010ML Supply Chain CompromisePoisoned public datasets / trojaned downloaded weights
AML.T0024Exfiltration via ML Inference APISome poisoning aims to leak data via the model's responses

Workflow

1. Verify data and model provenance/integrity

Refuse artifacts whose hash/signature you cannot verify, and prefer safetensors over pickle-based formats (pickle can execute code on load).

# Verify a downloaded checkpoint against a published SHA-256
sha256sum model.safetensors
# compare to the hub-published digest

# Flag unsafe pickle-based weights in a directory
find ./models -type f \( -name "*.bin" -o -name "*.pt" -o -name "*.pkl" -o -name "*.ckpt" \)
# safe_load.py — load weights without executing pickle
from safetensors.numpy import load_file
weights = load_file("model.safetensors")   # no arbitrary code execution

2. Detect label/data-quality issues with Cleanlab

Cleanlab finds mislabeled, outlier, and near-duplicate samples — common signatures of label-flip poisoning.

# cleanlab_scan.py
import numpy as np
from cleanlab.filter import find_label_issues

# pred_probs: out-of-sample predicted probabilities (n_samples x n_classes)
# labels: given integer labels (n_samples,)
def scan(labels: np.ndarray, pred_probs: np.ndarray):
    issues = find_label_issues(
        labels=labels, pred_probs=pred_probs,
        return_indices_ranked_by="self_confidence",
    )
    print(f"[*] {len(issues)} suspected label issues (potential poisoning)")
    return issues

3. Detect poisoned samples via ART activation clustering

ActivationDefence clusters per-class activations; a class whose activations split into two distinct clusters indicates injected (poisoned) samples.

# activation_defence.py
import numpy as np
from art.estimators.classification import KerasClassifier
from art.defences.detector.poison import ActivationDefence

def detect(model, x_train, y_train):
    classifier = KerasClassifier(model=model)          # wrap your trained model
    defence = ActivationDefence(classifier, x_train, y_train)
    report, is_clean_lst = defence.detect_poison(
        nb_clusters=2, nb_dims=10, reduce="PCA"
    )
    # is_clean_lst[i] == 0 marks a suspected poisoned sample
    poisoned_idx = np.where(np.array(is_clean_lst) == 0)[0]
    print(f"[*] activation clustering flagged {len(poisoned_idx)} samples")
    return poisoned_idx, report

4. Confirm with ART spectral signatures

Spectral signatures use the covariance spectrum of feature representations to surface poisoned samples — a strong second signal.

# spectral.py
import numpy as np
from art.estimators.classification import KerasClassifier
from art.defences.detector.poison import SpectralSignatureDefense

def detect(model, x_train, y_train, nb_classes):
    classifier = KerasClassifier(model=model)
    defence = SpectralSignatureDefense(
        classifier, x_train, y_train,
        expected_pp_poison=0.05, batch_size=128, eps_multiplier=1.5,
    )
    report, is_clean_lst = defence.detect_poison()
    poisoned_idx = np.where(np.array(is_clean_lst) == 0)[0]
    print(f"[*] spectral signatures flagged {len(poisoned_idx)} samples")
    return poisoned_idx, report

5. Probe the model for backdoor triggers

Test whether a candidate trigger flips predictions to an attacker target class far above the clean baseline.

# trigger_probe.py
import numpy as np

def test_trigger(model, x_clean, target_class, apply_trigger):
    """apply_trigger(x) stamps a candidate trigger (e.g. a corner pixel patch)."""
    clean_preds = model.predict(x_clean).argmax(axis=1)
    x_trig = np.stack([apply_trigger(x.copy()) for x in x_clean])
    trig_preds = model.predict(x_trig).argmax(axis=1)
    asr = float(np.mean(trig_preds == target_class))   # attack success rate
    base = float(np.mean(clean_preds == target_class))
    print(f"[*] target-class rate clean={base:.3f} triggered={asr:.3f}")
    return {"baseline": base, "trigger_success_rate": asr,
            "backdoor_suspected": asr - base > 0.5}

6. Quarantine, retrain, and report

Remove flagged samples (intersection of Cleanlab + ART signals is highest-confidence), retrain on the cleaned set, and re-test for the trigger. Document: artifact provenance, samples flagged by each method, trigger ASR before/after, and ATLAS mapping. Recommend dataset provenance controls, signed weights (safetensors + sigstore/cosign), and ongoing pipeline scanning.

Tools and Resources

ToolPurposeSource
Adversarial Robustness ToolboxActivation clustering & spectral-signature poisoning defenseshttps://github.com/Trusted-AI/adversarial-robustness-toolbox
CleanlabLabel/data-quality issue detectionhttps://github.com/cleanlab/cleanlab
safetensorsSafe (non-pickle) weight serializationhttps://github.com/huggingface/safetensors
OWASP LLM04:2025Data and Model Poisoning referencehttps://genai.owasp.org/llmrisk/llm042025-data-and-model-poisoning/
MITRE ATLASAI threat technique taxonomyhttps://atlas.mitre.org/

Detection Method Reference

LayerMethodToolSignal
Supply chainHash/signature + safe formatsha256/safetensorsTampered or unsafe artifact
DataLabel issues / outliersCleanlabMislabeled / injected samples
ModelActivation clusteringART ActivationDefencePer-class activation split
ModelSpectral signaturesART SpectralSignatureDefenseOutlier covariance spectrum
ModelTrigger probingcustomHigh trigger attack-success-rate

Validation Criteria

  • Dataset and weight provenance/integrity verified (hashes, safe format)
  • Unsafe pickle-based artifacts identified and avoided
  • Cleanlab label-issue scan run and suspicious samples listed
  • ART activation clustering executed with flagged sample indices
  • ART spectral-signature analysis run as confirmation
  • Backdoor trigger probe quantifies attack-success-rate vs. baseline
  • Highest-confidence poisoned samples quarantined (multi-method overlap)
  • Model retrained on cleaned data and re-tested for the trigger
  • Findings mapped to MITRE ATLAS AML.T0020 / AML.T0018 and OWASP LLM04:2025
  • Report delivered with remediation (provenance, signed weights, pipeline scanning)

Frequently asked questions

What to verify before installation and use

What does the detecting-data-and-model-poisoning source document cover?

Authorized-use-only notice: This skill includes routines that craft poisoned samples and backdoor triggers for defensive validation. Generate and use poisoned data and backdoored models only in isolated test environments you control. Never deploy a backdoored model or distribute…

How do I install detecting-data-and-model-poisoning?

The source record exposes this install command: npx skills add https://github.com/adriannoes/awesome-agentic-ai --skill "cursor-claude-codex/skills/anthropic-cybersecurity-skills/skills/detecting-data-and-model-poisoning". Inspect the command and pinned source before running it.

Which permission-related actions were detected?

Static rules flagged exec-script in the source; the page lists the matching lines and excerpts.

Alternatives

Compare before choosing

Computed 10025,136

alirezarezvani/claude-skills

app-store-optimization

App Store Optimization (ASO) toolkit for researching keywords, analyzing competitor rankings, generating metadata suggestions, and improving app visibility on Apple App Store and Google Play Store. Use when the user asks about ASO, app store rankings, app metadata, app titles and descriptions, app store listings, app visibility, or mobile app marketing on iOS or Android. Supports keyword research and scoring, competitor keyword analysis, metadata optimization, A/B test planning, launch checklist

Computed 9967

brucesongs/kali-claw

insecure-design

Insecure Design (OWASP A06:2025) focuses on security flaws in system architecture and design phases, rather than code implementation-level bugs.

Computed 9916

NintendaDev/unikit-ai

unikit-docs

Generate and maintain the project's TECHNICAL documentation from its codebase — scans the project structure, tech stack, and module boundaries, then writes a lean README landing page plus detailed topic pages (architecture, modules, setup, build, APIs), only the docs that are relevant. Use whenever the user wants to create, update, or validate documentation of the CODE or the project itself, e.g. "generate documentation", "create docs", "write the README", "update the project docs", "document th

Computed 9836,049

K-Dense-AI/scientific-agent-skills

dask

Distributed computing for larger-than-RAM pandas/NumPy workflows. Use when you need to scale existing pandas/NumPy code beyond memory or across clusters. Best for parallel file processing, distributed ML, integration with existing pandas code. For out-of-core analytics on single machine use vaex; for in-memory speed use polars.