Inferensys

Prompt

Child Safety Exploitation Material Detection Prompt

A practical prompt playbook for using Child Safety Exploitation Material Detection Prompt in production AI workflows.
Operations team reviewing AI workflow automation on laptop, workflow builder visible, casual office setup.
PROMPT PLAYBOOK

When to Use This Prompt

Defines the operational boundary for a CSAM and grooming detection prompt, specifying when it is the right tool and when it must be paired with other systems.

This prompt is designed for trust and safety engineers operating platforms with mandatory reporting obligations under regulations such as NCMEC requirements in the United States or comparable international frameworks. It classifies user-submitted text for signals related to child sexual abuse material (CSAM), online grooming patterns, and sexual solicitation of minors. The prompt is not a replacement for hash-matching or PhotoDNA scanning of known CSAM. It is a text-based classification layer that sits at the ingress point of user-generated content, direct messages, or chatbot interactions. Use this prompt when you need a structured detection flag, verbatim evidence excerpts, a calibrated confidence tier, and a deterministic routing decision for mandatory human review.

The ideal user is a platform safety engineer integrating this prompt into an automated triage pipeline. The required context includes the raw user-submitted text, the conversation history if available, and the platform's specific reporting obligations. This prompt is most effective as a high-recall screening layer designed to catch novel or previously unseen textual patterns that hash-matching systems cannot identify. It should be deployed immediately after PII redaction but before the content enters any long-term storage or model training datasets. The output is a machine-readable JSON structure containing a detection_flag, evidence_excerpts, confidence_tier (low, medium, high), and a routing_decision that forces human review for any non-low result.

Do not use this prompt as the sole decision-maker for law enforcement reporting. Every high-confidence detection must be reviewed by a trained human moderator before any external report is filed. Do not use this prompt to classify images, video, or audio files directly; it is strictly for text analysis. Avoid deploying this prompt in environments where the cost of over-flagging benign family content is not well understood, as it requires strict evaluation against false positives on discussions of parenting, medical care, or educational content. If your platform lacks a trained human review queue, you must build that capability before integrating this prompt into a production pipeline.

PRACTICAL GUARDRAILS

Use Case Fit

This prompt is a high-stakes safety classifier. It is not a general-purpose content filter. Deploy only when mandatory reporting obligations, legal review, and operational escalation paths are already in place.

01

Good Fit: Regulated Platforms with Reporting Obligations

Use when: your platform is subject to mandatory reporting requirements (e.g., NCMEC in the US) and you need a first-pass detection layer that flags potential CSAM, grooming, or solicitation for human review. Guardrail: The prompt output must route to a dedicated review queue with documented escalation procedures, not directly to law enforcement.

02

Bad Fit: General Content Moderation or Family Platforms

Avoid when: you need a general safety filter for a family-friendly app, educational platform, or social network without specialized trust and safety investigators. Guardrail: Over-flagging benign family content (e.g., bath-time photos, pediatric health discussions) creates legal risk and user harm. Use a broader policy violation classifier instead.

03

Required Inputs: Content, Context, and User Metadata

What you need: The raw content (text, image descriptions, transcripts), conversation context (prior turns for grooming detection), and available user metadata (account age, interaction patterns). Guardrail: Never run this prompt on content stripped of context—isolated messages lose critical behavioral signals and increase false positives.

04

Operational Risk: Over-Flagging and Psychological Load

What to watch: High false-positive rates on legitimate content involving children (family photos, medical discussions, educational material) and reviewer trauma from exposure to flagged material. Guardrail: Implement confidence tiers with different routing rules. Low-confidence flags go to secondary automated review before human assignment. Provide wellness support for reviewers.

05

Legal Risk: Evidence Handling and Chain of Custody

What to watch: Prompt outputs, evidence excerpts, and confidence scores may become part of legal proceedings or regulatory audits. Inconsistent or hallucinated evidence breaks chain of custody. Guardrail: Every evidence excerpt must be a verbatim quote with byte-offset grounding. Log the full prompt, model version, and output timestamp immutably. Never let the model paraphrase evidence.

06

Model Selection: Not All Models Are Suitable

What to watch: Smaller or older models lack the reasoning precision to distinguish grooming patterns from normal adult-child interactions, producing dangerous false negatives or over-flagging. Guardrail: Use a capable model with strong instruction-following and safety training. Run comparative evals across models on a golden dataset of borderline cases before deployment. Never deploy on a model not evaluated for this specific task.

PROMPT PLAYBOOK

Copy-Ready Prompt Template

A reusable prompt for detecting CSAM-related content, grooming patterns, and solicitation language with mandatory human-review routing.

This prompt template is designed for trust and safety engineers who need a reliable, auditable first-pass detection system for child safety exploitation material. It is not a replacement for hash-matching, PhotoDNA, or human expert review. Instead, it serves as a text-based triage layer that flags concerning content, extracts evidence excerpts, and routes everything above a low-confidence threshold to a human review queue. The template uses square-bracket placeholders that you must replace with your platform's specific taxonomies, risk tiers, and escalation paths before deployment.

text
SYSTEM:
You are a child safety content classifier for a platform with mandatory reporting obligations. Your role is to analyze user-submitted text for indicators of child sexual abuse material (CSAM), grooming behavior, or sexual solicitation involving minors. You must be precise, evidence-based, and calibrated to avoid over-flagging benign family content.

CLASSIFICATION TAXONOMY:
[TAXONOMY_DEFINITIONS]

RISK TIERS:
- CRITICAL: Clear, unambiguous CSAM description, trading, or production discussion. Immediate escalation required.
- HIGH: Grooming patterns, sexualized conversation with a minor, or solicitation language. Escalate within [HIGH_SLA_MINUTES] minutes.
- MEDIUM: Ambiguous boundary content, coded language, or context-dependent risk. Queue for human review within [MEDIUM_SLA_HOURS] hours.
- LOW: Benign content with no indicators of child exploitation. No action required.
- FALSE_POSITIVE_RISK: Content that contains legitimate family, medical, educational, or age-appropriate relationship discussion that could be misclassified. Flag for calibration review.

INPUT:
[USER_INPUT]

CONVERSATION CONTEXT (if multi-turn):
[CONVERSATION_HISTORY]

USER METADATA:
[USER_METADATA]

OUTPUT_SCHEMA:
{
  "detection_flag": boolean,
  "risk_tier": "CRITICAL" | "HIGH" | "MEDIUM" | "LOW" | "FALSE_POSITIVE_RISK",
  "confidence_score": 0.0-1.0,
  "primary_category": string,
  "secondary_categories": [string],
  "evidence_excerpts": [
    {
      "text": string,
      "category": string,
      "rationale": string
    }
  ],
  "requires_human_review": boolean,
  "escalation_priority": "IMMEDIATE" | "URGENT" | "ROUTINE" | "NONE",
  "recommended_actions": [string],
  "calibration_notes": string | null
}

CONSTRAINTS:
- Do not generate, describe, or elaborate on any exploitative content beyond the minimum evidence excerpts needed for classification.
- If the input contains legitimate discussion of parenting, pediatric health, sex education, or family activities, explicitly flag as FALSE_POSITIVE_RISK.
- When confidence is below [CONFIDENCE_THRESHOLD], set requires_human_review to true regardless of risk tier.
- Do not make final determinations about illegality. Your output is a detection signal for human reviewers, not a legal finding.
- If the input contains URLs, file references, or external pointers, note them in evidence excerpts but do not attempt to fetch or analyze external content.
- For multi-turn conversations, analyze the full context. Grooming patterns often span multiple turns.

FEW-SHOT EXAMPLES:
[FEW_SHOT_EXAMPLES]

USER:
Analyze the following input according to the taxonomy and output schema above.

Adaptation guidance: Replace [TAXONOMY_DEFINITIONS] with your platform's specific violation categories, including definitions for CSAM, grooming stages, solicitation types, and boundary cases. The [USER_METADATA] placeholder should include account age, prior flags, and any trust signals your platform tracks. [FEW_SHOT_EXAMPLES] is critical for calibration—include at least three examples of benign family content correctly classified as FALSE_POSITIVE_RISK, plus examples at each risk tier. Set [CONFIDENCE_THRESHOLD] based on your eval results; start at 0.85 and adjust downward only if your false negative rate on known CSAM text is unacceptable. The [HIGH_SLA_MINUTES] and [MEDIUM_SLA_HOURS] values should match your regulatory reporting timelines.

What to do next: After adapting the template, run it against your golden eval dataset containing known CSAM text, grooming transcripts, benign family content, and edge cases like sex education discussions. Measure precision, recall, and false positive rate separately for each risk tier. Pay special attention to FALSE_POSITIVE_RISK misclassifications—over-flagging legitimate content erodes trust and wastes reviewer capacity. Wire the prompt into a harness that enforces the output schema, logs every classification with the evidence excerpts, and routes all CRITICAL and HIGH detections to your human review queue with the full context preserved. Never deploy this prompt without mandatory human review for any detection above LOW confidence.

IMPLEMENTATION TABLE

Prompt Variables

Required inputs for the CSAM detection prompt. Each variable must be validated before model invocation to prevent false negatives and ensure regulatory compliance.

PlaceholderPurposeExampleValidation Notes

[USER_INPUT]

The raw text, message, or content to scan for CSAM-related patterns, grooming language, or solicitation signals.

Wanna play a game? What school do you go to?

Required. Must be non-null string. Apply PII redaction before logging. Check for encoding attacks (base64, Unicode obfuscation) before passing to model.

[CONVERSATION_HISTORY]

Previous turns in the conversation for multi-turn grooming or trust-building pattern detection.

[{"role": "user", "content": "hi"}, {"role": "assistant", "content": "hello"}]

Optional. If provided, must be valid JSON array with role and content fields. Truncate to last 20 turns to stay within context budget. Flag if history contains prior safety violations.

[CONTENT_TYPE]

The modality or format of the content being scanned to apply appropriate detection heuristics.

text_message

Required. Must be one of: text_message, image_description, video_transcript, file_content, profile_bio, chat_room_name. Reject unknown types. Controls which detection sub-prompts activate.

[USER_METADATA]

Account age, verification status, prior violation count, and trust tier for risk-weighted scoring.

{"account_age_days": 2, "verified": false, "prior_flags": 1}

Required. Must contain account_age_days (int), verified (bool), prior_flags (int). Null allowed for anonymous users but must downgrade confidence. Do not include PII beyond trust signals.

[REPORTING_JURISDICTION]

Legal jurisdiction determining mandatory reporting thresholds and escalation rules.

US

Required. Must match configured jurisdiction codes (US, UK, EU, AU, CA). Controls whether detection triggers mandatory report generation. Default to most restrictive if unknown.

[DETECTION_THRESHOLD]

Confidence tier boundary for flagging versus passing content. Controls over-flagging vs under-flagging trade-off.

medium

Required. Must be one of: low (sensitive, higher false positives), medium (balanced), high (conservative, higher false negatives). Document threshold choice in audit log. Low threshold requires increased human review capacity.

[BENIGN_FAMILY_TERMS]

Allowlist of terms common in benign family or educational contexts that might trigger false positives.

["bath time", "swim lessons", "pediatrician"]

Optional. If provided, must be string array. Terms here reduce confidence scores when they appear in non-sexual contexts. Review and update quarterly with false positive analysis.

[OUTPUT_SCHEMA]

The expected JSON structure for the detection result including flag, evidence excerpts, confidence tier, and routing decision.

{"flag": "boolean", "evidence": "string[]", "confidence_tier": "string", "routing": "string"}

Required. Must specify flag (bool), evidence (array of quoted excerpts), confidence_tier (low|medium|high), routing (human_review|automated_block|pass). Validate output against this schema before acting on detection result.

PROMPT PLAYBOOK

Implementation Harness Notes

How to wire the CSAM detection prompt into a production application with mandatory human review, evidence logging, and strict eval gates.

This prompt is not a standalone safety solution. It must be embedded in a deterministic application harness that enforces mandatory human review for all positive detections, preserves an immutable audit trail, and prevents the model output from reaching end users or downstream systems without explicit human approval. The harness should treat every model response as a preliminary signal, not a final decision. The prompt's output schema includes a human_review_required boolean, a confidence_tier enum, and evidence_excerpts array. The harness must route any response where human_review_required is true or confidence_tier is high or medium into a review queue. Low-confidence negatives may be logged and passed, but only after the harness confirms the model returned a valid, parseable schema and no evidence excerpts were provided.

Wire the prompt into an API gateway or content ingestion pipeline before the input reaches any generative model, retrieval system, or user-facing feature. The application should call the detection model with the raw user input or content payload, validate the JSON response against the expected schema, and branch on the result. If the response fails schema validation, retry once with a repair prompt that includes the raw output and validation error. If the second attempt fails, escalate to human review as a default-safe action. Log every invocation with a unique detection_id, the input hash, the full model response, the validation result, the routing decision, and the reviewer identity if escalated. Never store or log the raw user input in plaintext in application logs; use a one-way hash for deduplication and store the original content only in the encrypted case management system. For model choice, use a model with strong instruction-following and low refusal override risk. Do not use a general-purpose chat model with system prompts alone; prefer a model version that has undergone safety training and supports structured output modes. If your platform processes images or video, the harness must extract and hash visual content, run perceptual hash matching against known CSAM databases before the LLM call, and only invoke the text-based detection prompt on accompanying text, metadata, or transcripts.

Before deploying, build an evaluation harness that tests the prompt against a curated dataset including confirmed CSAM-adjacent language, grooming patterns, benign family content, medical discussions, and edge cases like sex education or abuse survivor narratives. Measure over-flagging and under-flagging rates separately. Set a maximum acceptable false positive rate for benign family content and block deployment until the prompt meets that threshold in offline eval. In production, run a shadow mode first where the prompt's output is logged and reviewed but does not trigger enforcement actions. After shadow validation, enable the human-review routing but not automated blocking. Only introduce automated blocking for high-confidence detections after a defined observation period with audited reviewer agreement rates. The harness must also implement rate limiting and abuse detection on the detection endpoint itself to prevent adversaries from probing the detection threshold through repeated submissions.

IMPLEMENTATION TABLE

Expected Output Contract

Defines the required JSON schema for the CSAM detection prompt output. Every field must be present and pass the specified validation rules before the response can be consumed by downstream routing, logging, or review systems.

Field or ElementType or FormatRequiredValidation Rule

detection_flag

enum: [true, false]

Must be boolean true if any indicator is found, false otherwise. If true, evidence_excerpts must not be empty.

confidence_tier

enum: [HIGH, MEDIUM, LOW]

Must be one of the three allowed string values. HIGH confidence requires at least one explicit indicator. LOW confidence is allowed for contextual or borderline signals.

evidence_excerpts

array of strings

Must be a JSON array. Each string must be a verbatim excerpt from [INPUT_TEXT]. If detection_flag is true, array must contain at least one non-empty string. If false, array must be empty.

indicator_categories

array of strings

Must be a JSON array drawn from the allowed taxonomy: [sexualization_of_minors, grooming_pattern, solicitation_language, csam_terminology, age_gap_coercion, other]. No external categories permitted.

severity_score

integer between 0 and 100

Must be an integer. 0 indicates no risk. 1-30 is LOW, 31-70 is MEDIUM, 71-100 is HIGH. Score must be consistent with confidence_tier and detection_flag.

requires_human_review

boolean

Must be true if detection_flag is true OR confidence_tier is MEDIUM or HIGH. Can be false only when detection_flag is false and confidence_tier is LOW.

rationale_summary

string, max 500 characters

Must be a non-empty string explaining the classification decision. Must reference specific evidence_excerpts and indicator_categories. Must not contain hallucinated details not present in [INPUT_TEXT].

input_hash

string, format: sha256

Must be a valid SHA-256 hex digest of the normalized [INPUT_TEXT]. Used for audit trail integrity. Validation must confirm 64-character hex string.

PRACTICAL GUARDRAILS

Common Failure Modes

What breaks first in CSAM detection prompts and how to guard against it before a case reaches a human reviewer.

01

Over-Flagging Benign Family Content

What to watch: The prompt misclassifies innocent family photos, medical discussions, or educational content as CSAM. This happens when the model overweights anatomical keywords or age-related terms without context. Guardrail: Require multi-factor evidence (intent + context + grooming pattern) before flagging. Add explicit counter-examples of benign family scenarios in few-shot prompts. Calibrate confidence thresholds against a golden dataset of false-positive cases.

02

Context Window Truncation Drops Critical Evidence

What to watch: Long conversation histories or multi-message grooming patterns get truncated, causing the model to miss the coercive build-up and flag only the final message in isolation. Guardrail: Implement sliding-window summarization that preserves behavioral patterns across turns. Extract and inject key interaction milestones (trust-building, isolation, secrecy requests) as structured context before classification.

03

Coded Language and Insider Terminology Evasion

What to watch: Perpetrators use emoji substitution, in-group slang, or seemingly innocent phrases to bypass keyword-based and semantic detection. The model treats the surface text as benign. Guardrail: Maintain an updatable lexicon of known coded terms and emoji mappings. Pair the detection prompt with a separate decoding pre-pass that normalizes known evasion patterns before classification. Log novel evasion attempts for lexicon updates.

04

Confidence Score Calibration Drift

What to watch: The model's confidence scores become uncalibrated over time—high-confidence false positives or low-confidence true positives—as language patterns and abuse tactics evolve. Guardrail: Run continuous eval against a held-out calibration set. Implement a confidence threshold dashboard that alerts when precision or recall shifts beyond acceptable bounds. Never treat raw confidence as a final decision without human-readable evidence excerpts.

05

Mandatory Reporting Chain Breakage

What to watch: The prompt correctly flags CSAM but the output format, missing metadata, or routing failure prevents the case from reaching the legally required human review queue within the mandated timeframe. Guardrail: Design the output schema to include a machine-actionable escalation_priority field with SLA timestamps. Implement a dead-letter queue monitor that alerts if any HIGH or CRITICAL flag does not reach a reviewer workstation within the configured window.

06

Multi-Modal Content Blind Spots

What to watch: The text-only prompt misses abuse signals because the actual CSAM is in an attached image, video, or file, and the accompanying text appears neutral. Guardrail: Never route text-only classification as a final verdict when media attachments are present. Implement a pre-check that requires multi-modal analysis or human review for any input with attachments. The text prompt should output REQUIRES_MULTIMODAL_REVIEW when attachments exist.

IMPLEMENTATION TABLE

Evaluation Rubric

Use this rubric to test the prompt's output quality before shipping. Each criterion targets a known failure mode for CSAM detection prompts, including over-flagging of benign family content and under-flagging of coded language.

CriterionPass StandardFailure SignalTest Method

Detection Flag Accuracy

Correctly flags CSAM-related content with a detection flag of true and flags benign family content as false

False positive on pediatric medical text, family photo descriptions, or sex education content

Run against a balanced golden dataset of 50 known-safe and 50 known-violative examples

Evidence Excerpt Grounding

Every true detection includes at least one verbatim excerpt from [INPUT] that supports the classification

Detection flag is true but evidence excerpts are missing, paraphrased, or reference content not in the input

Parse output for evidence_excerpts field and verify each excerpt appears as a substring in the original input

Confidence Tier Calibration

High-confidence detections have unambiguous CSAM indicators; low-confidence detections reflect ambiguous or coded language

All detections return HIGH confidence regardless of signal strength, or LOW confidence is never used

Check confidence_tier distribution across 100 test cases; expect variance across tiers

Grooming Pattern Recognition

Identifies trust-building, secrecy-requesting, or isolation-encouraging language in multi-turn contexts

Misses grooming patterns that lack explicit sexual terms but contain boundary-testing and relationship-building

Test with 20 multi-turn conversation snippets containing known grooming patterns from safety research datasets

Benign Family Content Handling

Returns detection flag false and confidence tier NONE for pediatric healthcare, parenting forums, and family photo discussions

Flags diaper-changing advice, breastfeeding discussions, or pediatric symptom descriptions as suspicious

Curate 30 examples from parenting forums, pediatric health sites, and family photography communities

Coded Language and Evasion Detection

Identifies emoji substitution, leetspeak, and in-group terminology used to evade keyword filters

Passes content that uses known evasion patterns documented in trust and safety threat intelligence

Test with 15 examples using documented evasion techniques from NCMEC or INHOPE threat reports

Human-Review Routing Consistency

Every detection with confidence tier MEDIUM or HIGH includes a human_review_required field set to true

Detection flag is true but human_review_required is false, or the field is missing from the output schema

Validate output schema compliance across all test cases; assert human_review_required is present and boolean

Solicitation Language Detection

Flags requests for images, private chat, or contact information when combined with minor-identifying context

Misses indirect solicitation like 'do you have a camera' or 'let's talk somewhere private' in youth-targeted contexts

Test with 10 solicitation variants from law enforcement training materials and safety organization datasets

ADAPTATION OPTIONS

Adapt This Prompt

How to adapt

Start with the base prompt and a small labeled dataset of known CSAM, grooming, and benign family content. Remove strict schema enforcement initially; focus on flag/no-flag accuracy. Use a lightweight JSON output with only detection_flag, confidence_tier, and evidence_excerpts. Run against 50–100 examples and manually review every flagged case.

Watch for

  • Over-flagging benign parent-child interactions, medical discussions, or educational content
  • Missing coded language and emoji-based solicitation
  • Confidence scores that don't correlate with actual severity
Prasad Kumkar

About the author

Prasad Kumkar

CEO & MD, Inference Systems

Prasad Kumkar is the CEO & MD of Inference Systems and writes about AI systems architecture, LLM infrastructure, model serving, evaluation, and production deployment. Over 5+ years, he has worked across computer vision models, L5 autonomous vehicle systems, and LLM research, with a focus on taking complex AI ideas into real-world engineering systems.

His work and writing cover AI systems, large language models, AI agents, multimodal systems, autonomous systems, inference optimization, RAG, evaluation, and production AI engineering.