Inferensys

Prompt

Fraud and Scam Content Classification Prompt

A practical prompt playbook for using Fraud and Scam Content Classification 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

Understand the ideal use cases, required context, and limitations of the fraud and scam classification prompt before integrating it into a production pipeline.

This prompt is a classification gateway for fintech and e-commerce trust and safety teams who need to analyze unstructured text for fraud and scam indicators before the content reaches a user, agent, or downstream processing system. It is designed to detect romance scams, investment fraud, impersonation, payment fraud, and other deceptive patterns in user-generated messages, support tickets, transaction notes, or marketplace communications. The primary job-to-be-done is triage: reducing the volume of content that requires manual review by automatically scoring risk and routing suspicious items to the correct investigation queue. The ideal user is a security engineer, fraud analyst, or platform developer embedding this prompt into an AI pipeline as a pre-processing layer.

To use this prompt effectively, you must supply the unstructured text to be classified and define the output schema your downstream system expects. The prompt outputs a structured fraud type taxonomy with confidence scores and a recommended investigation queue, making it suitable for direct integration with case management systems, alerting platforms, or automated moderation workflows. However, this prompt is not a replacement for a rules engine, a transaction monitoring system, or a full fraud case management platform. It does not access account history, payment networks, or device fingerprints. It operates purely on the text provided, which means it can detect linguistic patterns of fraud but cannot verify whether a transaction actually occurred or whether an account is compromised.

Do not use this prompt as the sole decision-maker for blocking users, freezing accounts, or filing regulatory reports. Its output should be treated as a signal that feeds into a broader risk scoring pipeline. In high-stakes scenarios—such as suspected money laundering, imminent harm, or large-value fraud—always route the output for human review. Before deploying, build a validation layer that checks the structural integrity of the JSON output, retries on malformed responses, and logs every classification for auditability. Pair this prompt with a set of golden test cases that include known fraud examples, borderline legitimate content, and adversarial inputs designed to evade detection. Monitor false-positive and false-negative rates in production, and establish a feedback loop where analyst overrides are used to refine the prompt or its surrounding eval criteria over time.

PRACTICAL GUARDRAILS

Use Case Fit

Where the Fraud and Scam Content Classification Prompt delivers value and where it introduces unacceptable risk.

01

Good Fit: Structured Triage Pipelines

Use when: Ingesting user reports, chat logs, or transaction notes into a defined fraud operations queue. The prompt excels at normalizing messy text into a standard fraud taxonomy with confidence scores. Guardrail: Always map the output fraud_type to your internal case management system's categories before routing.

02

Bad Fit: Sole Determinant of Account Action

Avoid when: The classification output directly triggers an automatic ban, fund freeze, or legal hold without human review. The model can misclassify sarcasm or complex financial discussions. Guardrail: Require a human-in-the-loop (HITL) confirmation step for any irreversible action triggered by the prompt's output.

03

Required Inputs: Context Beyond the Message

Risk: A single message in isolation often lacks the signal needed to distinguish a scam from a poorly worded legitimate offer. Guardrail: The prompt template must be populated with [USER_MESSAGE_HISTORY] and [TRANSACTION_METADATA] placeholders. Without these, the false positive rate will spike.

04

Operational Risk: Taxonomy Drift

Risk: Fraud tactics evolve. A static taxonomy (e.g., "romance scam") becomes stale, causing the model to force new scam types into old buckets or miss them entirely. Guardrail: Run a weekly eval against a hold-out set of recent confirmed fraud cases. Monitor the "Other" category rate and update the [FRAUD_TAXONOMY] variable in the prompt.

05

Operational Risk: Confidence Score Calibration

Risk: The model's raw confidence score (e.g., 0.85) may not correspond to actual precision. Over-reliance on uncalibrated scores leads to mis-prioritization of investigation queues. Guardrail: Calibrate scores against human reviewer outcomes. Implement a threshold that optimizes for recall in high-severity queues and precision in low-severity queues.

06

Bad Fit: Real-Time Payment Blocking

Avoid when: Latency is measured in milliseconds and the cost of a false positive is a dropped transaction. LLM inference latency and variance are too high for inline payment authorization. Guardrail: Use this prompt for asynchronous post-transaction review or batch analysis, not as a gate in the real-time payment rail.

PROMPT PLAYBOOK

Copy-Ready Prompt Template

A reusable prompt template for classifying fraud and scam content with structured output and routing instructions.

The prompt below is designed to be dropped into a classification harness. It expects raw user-generated content as input and returns a structured fraud assessment with a taxonomy label, confidence score, and a routing decision. Every placeholder in square brackets must be replaced by your application before the prompt is sent to the model. Do not ship this prompt with unresolved placeholders in production.

text
You are a fraud and scam content classifier for a trust and safety operations team. Your job is to analyze user-submitted content and determine whether it contains indicators of fraud, scams, or deceptive financial schemes.

## INPUT
[CONTENT]

## TAXONOMY
Classify the content into exactly one of the following fraud types. If no fraud indicators are present, use "none_detected".

- romance_scam: Building fake romantic relationships to request money or financial information.
- investment_fraud: Fake investment opportunities, Ponzi schemes, or guaranteed-return scams.
- impersonation: Pretending to be a trusted entity (bank, government, tech support, executive).
- payment_fraud: Fake invoices, overpayment scams, advance-fee fraud, or payment redirection.
- phishing: Attempts to steal credentials, account details, or personal information via deceptive links or forms.
- business_email_compromise: Targeted impersonation of executives or vendors to authorize fraudulent transfers.
- marketplace_scam: Fake listings, non-delivery, bait-and-switch on e-commerce or classified platforms.
- job_scam: Fake job offers, work-from-home schemes, or requests for upfront fees for employment.
- lottery_prize_scam: Fake lottery winnings, prize claims, or inheritance notifications requiring upfront payment.
- none_detected: No fraud or scam indicators present in the content.

## OUTPUT SCHEMA
Return a valid JSON object with no additional text, markdown fences, or commentary. Use this exact structure:

{
  "fraud_type": "<taxonomy_label>",
  "confidence": <0.0_to_1.0>,
  "indicators": ["<specific_phrase_or_pattern>"],
  "routing_queue": "<queue_name>",
  "requires_human_review": <true_or_false>,
  "explanation": "<brief_reasoning>"
}

## ROUTING RULES
- If confidence is below 0.7, set requires_human_review to true and routing_queue to "manual_review".
- If fraud_type is "none_detected", set routing_queue to "low_priority" and requires_human_review to false.
- For romance_scam, investment_fraud, or business_email_compromise with confidence >= 0.8, set routing_queue to "high_priority_investigation" and requires_human_review to false.
- For all other fraud types with confidence >= 0.8, set routing_queue to "automated_action" and requires_human_review to false.
- If the content contains explicit threats of imminent harm, override all routing and set routing_queue to "urgent_escalation" with requires_human_review true.

## CONSTRAINTS
- Do not invent fraud indicators that are not present in the content.
- If the content is ambiguous, reflect that in a lower confidence score rather than guessing.
- Do not output personally identifiable information in the explanation field. Use generic descriptions instead.
- If the content is in a language you cannot reliably analyze, set fraud_type to "none_detected", confidence to 0.0, and routing_queue to "language_unsupported".

## EXAMPLES

Input: "Hi dear, I am a US soldier stationed overseas. I need $5,000 to get home and I will pay you back double. Please send via Western Union."
Output: {"fraud_type": "romance_scam", "confidence": 0.95, "indicators": ["US soldier stationed overseas", "send via Western Union", "pay you back double"], "routing_queue": "high_priority_investigation", "requires_human_review": false, "explanation": "Classic military romance scam pattern with urgency, emotional appeal, and untraceable payment method request."}

Input: "Your account has been compromised. Click here to verify your identity: bit.ly/3xK9mP2"
Output: {"fraud_type": "phishing", "confidence": 0.92, "indicators": ["account has been compromised", "click here to verify", "shortened URL"], "routing_queue": "automated_action", "requires_human_review": false, "explanation": "Phishing pattern with urgency, credential harvesting language, and obfuscated link."}

Input: "Can you send me the Q4 report by EOD?"
Output: {"fraud_type": "none_detected", "confidence": 0.98, "indicators": [], "routing_queue": "low_priority", "requires_human_review": false, "explanation": "Routine business communication with no fraud indicators."}

To adapt this template, replace [CONTENT] with the raw text your system ingests. If your fraud taxonomy differs, modify the enum list and update the routing rules to match your internal queues. The examples are critical for few-shot behavior; replace them with real cases from your own labeled dataset. If you are operating in a regulated jurisdiction, add a [JURISDICTION] placeholder and adjust the taxonomy to include region-specific fraud types such as GST scams or BEC variants common in your market. Always validate the model's JSON output against the schema before routing, and log every classification decision with the raw input, model version, and confidence score for auditability.

IMPLEMENTATION TABLE

Prompt Variables

Required inputs for the Fraud and Scam Content Classification Prompt. Each placeholder must be populated before the prompt is assembled and sent to the model. Validate inputs to prevent downstream routing errors and confidence miscalibration.

PlaceholderPurposeExampleValidation Notes

[USER_MESSAGE]

The raw, untrusted text to classify for fraud and scam indicators.

I'm a Nigerian prince and I need your help transferring $10 million...

Required. Must be a non-empty string. Sanitize for control characters but do not redact content before classification. Max 8000 chars.

[FRAUD_TAXONOMY]

The closed set of fraud types the model must choose from, with definitions.

["romance_scam", "investment_fraud", "impersonation", "payment_fraud", "phishing", "business_email_compromise", "advance_fee_fraud"]

Required. Must be a valid JSON array of strings. Each entry must have a definition in the system prompt. If empty, the model cannot classify.

[CONFIDENCE_THRESHOLD]

The minimum confidence score required to auto-route a classification. Scores below this threshold route to human review.

0.75

Required. Must be a float between 0.0 and 1.0. A value of 0.0 disables the threshold check. Validate as a number, not a string.

[INVESTIGATION_QUEUES]

The available downstream queues for routing classified content.

["queue_fraud_high", "queue_fraud_medium", "queue_human_review", "queue_benign"]

Required. Must be a valid JSON array of strings. Each queue must correspond to an actual downstream system endpoint. Empty array causes routing failure.

[OUTPUT_SCHEMA]

The strict JSON schema the model must adhere to in its response.

{"type": "object", "properties": {"fraud_type": {"type": "string"}, "confidence": {"type": "number"}, "indicators": {"type": "array"}, "queue": {"type": "string"}}, "required": ["fraud_type", "confidence", "indicators", "queue"]}

Required. Must be a valid JSON Schema object. Validate with a schema validator before prompt assembly. The model's output will be validated against this schema post-generation.

[FEW_SHOT_EXAMPLES]

A curated set of example messages and their correct classifications to guide the model.

[{"input": "Send $500 via Western Union to claim your prize.", "output": {"fraud_type": "advance_fee_fraud", "confidence": 0.98, "indicators": ["prize_claim", "wire_transfer_request"], "queue": "queue_fraud_high"}}]

Optional but strongly recommended. Must be a valid JSON array of objects. Each example must have 'input' and 'output' fields. Validate that output conforms to [OUTPUT_SCHEMA]. Limit to 3-5 examples to manage context window.

[ESCALATION_RULES]

Conditions that force human review regardless of confidence score.

{"auto_escalate_if": ["fraud_type == 'business_email_compromise'", "indicators contains 'ceo_fraud'"]}

Optional. Must be a valid JSON object. If provided, rules are evaluated after classification. Invalid rules cause a fallback to full human review. Validate rule syntax before deployment.

PROMPT PLAYBOOK

Implementation Harness Notes

How to wire the fraud classification prompt into a production application with validation, routing, and human review.

This prompt is designed to operate as a classification gateway before any downstream processing of user-generated content. It should be deployed as a synchronous API call within your content ingestion pipeline, returning a structured fraud taxonomy and confidence score that determines the next processing step. The prompt expects raw text input and outputs a JSON object with fraud_type, confidence_score, indicators, and recommended_queue fields. Because misclassification can route genuine fraud to low-priority queues or flag legitimate content for investigation, the implementation must include deterministic post-processing, not just raw model output.

Wire the prompt into your application with a validation and retry layer. After receiving the model's JSON response, validate that fraud_type matches one of your defined taxonomy values (e.g., romance_scam, investment_fraud, impersonation, payment_fraud, none), that confidence_score is a float between 0.0 and 1.0, and that recommended_queue maps to an actual queue in your investigation system. If validation fails, retry once with the same input and a stronger format instruction appended. If the second attempt also fails, route the content to a manual review queue with a classification_failure tag. Log every classification attempt—including the raw input, model response, validation result, and final routing decision—for audit and model evaluation purposes.

For high-confidence fraud detections (confidence > 0.85), route directly to the fraud investigation queue with the extracted indicators attached as evidence. For medium-confidence detections (0.60–0.85), route to a triage queue where human analysts review the content before investigation. For low-confidence or none classifications, allow the content to proceed to normal processing but log the classification for trend analysis. Implement a feedback loop: when human reviewers override a classification, store the corrected label and use it to build evaluation datasets for prompt regression testing. Never use this prompt to automatically block users or freeze accounts without human confirmation—the cost of a false positive in fraud classification can include reputational damage and customer churn.

Choose a model with strong instruction-following and structured output capabilities. GPT-4o, Claude 3.5 Sonnet, and Gemini 1.5 Pro all perform well on this classification task, but you should run your own evaluation against a labeled dataset of known fraud and legitimate content before selecting a production model. If latency is critical, consider using a smaller fine-tuned model for initial screening and only calling a larger model for ambiguous cases. For regulated environments, ensure that all model calls happen within your compliance boundary and that no raw user content is logged to external observability platforms without redaction. The next step after implementing this harness is to build a regression test suite using your historical fraud cases and known false positives to catch prompt drift before it reaches production.

IMPLEMENTATION TABLE

Expected Output Contract

The prompt must return a single JSON object matching this contract. Validate the output against this schema before routing the classification result to an investigation queue.

Field or ElementType or FormatRequiredValidation Rule

classification_id

string (UUID v4)

Must be a valid UUID v4 string. Reject if missing or malformed.

fraud_type

string (enum)

Must match one of: [romance_scam, investment_fraud, impersonation, payment_fraud, business_email_compromise, advance_fee_fraud, fake_invoice, account_takeover, other]. Reject if not in enum.

confidence_score

number (0.0–1.0)

Must be a float between 0.0 and 1.0 inclusive. Reject if out of range or non-numeric.

indicators

array of strings

Must contain 1–10 strings from the defined indicator taxonomy. Reject if empty or contains unknown indicators.

severity

string (enum)

Must be one of: [low, medium, high, critical]. Reject if not in enum.

investigation_queue

string (enum)

Must be one of: [tier_1_triage, fraud_ops, legal_review, executive_escalation]. Reject if not in enum.

requires_human_review

boolean

Must be true if confidence_score < 0.85 or severity is critical. Reject if boolean logic mismatch.

evidence_summary

string (max 500 chars)

Must be a non-empty string summarizing the key fraud signals. Truncate and flag if over 500 characters.

PRACTICAL GUARDRAILS

Common Failure Modes

Fraud classification prompts fail in predictable ways. These are the most common production failure modes and the specific guardrails that prevent them.

01

Over-Classification of Legitimate Urgency

What to watch: The model flags normal business urgency (payment reminders, limited-time offers, deadline notifications) as fraud indicators. This floods investigation queues with false positives and erodes trust in the classifier. Guardrail: Add explicit negative examples of legitimate urgency language in few-shot prompts. Implement a second-pass review for low-confidence fraud flags before routing to human investigation queues.

02

Context Window Truncation Masks Fraud Signals

What to watch: Long conversation threads or multi-message exchanges get truncated at the context window boundary, cutting off the grooming or manipulation pattern that establishes the fraud. The classifier sees only the benign tail of the interaction. Guardrail: Implement sliding window analysis with overlap on long conversations. Always include the first N messages and last N messages in the classification window. Flag truncated inputs with a context_incomplete marker that triggers conservative routing.

03

Adversarial Obfuscation Evasion

What to watch: Fraudsters deliberately misspell keywords, use character substitutions, insert zero-width characters, or split scam indicators across multiple messages to evade pattern matching. The classifier misses the fraud entirely. Guardrail: Pre-process inputs with Unicode normalization and character deobfuscation. Test the prompt against a red-team dataset of known obfuscation techniques. Route low-confidence clean classifications on obfuscated inputs to enhanced scrutiny.

04

Taxonomy Drift on Novel Scam Patterns

What to watch: The prompt's fraud taxonomy becomes stale as new scam types emerge (pig butchering variants, AI-generated deepfake lures, new platform-specific fraud). The model either misclassifies novel scams as benign or forces them into incorrect existing categories. Guardrail: Include an unknown_fraud_pattern category with explicit routing to human review. Monitor the rate of this category weekly. Schedule taxonomy reviews when the unknown rate exceeds 5% of total classifications.

05

Confidence Score Calibration Failure

What to watch: The model outputs high confidence scores on ambiguous content or low confidence on clear fraud patterns. Downstream routing rules that depend on confidence thresholds produce incorrect dispatch decisions. Guardrail: Calibrate confidence thresholds against a labeled golden dataset before production deployment. Implement a confidence calibration check that compares model confidence to actual fraud prevalence in each score bucket. Log confidence distributions per fraud type for drift monitoring.

06

Multilingual Fraud Pattern Blindness

What to watch: The prompt is optimized for English-language fraud patterns and misses the same scam types when conducted in other languages. Romance scams in Spanish, investment fraud in Mandarin, or impersonation in Arabic go undetected. Guardrail: Include multilingual few-shot examples for each fraud type in your target languages. Route non-English inputs through language detection first, then apply language-specific classification prompts. Monitor false-negative rates by language cohort separately.

IMPLEMENTATION TABLE

Evaluation Rubric

Criteria for testing the fraud classification prompt's output quality before production deployment. Use these standards to build an automated eval harness or a human review checklist.

CriterionPass StandardFailure SignalTest Method

Taxonomy Adherence

Output contains a fraud_type value from the defined taxonomy only (e.g., romance_scam, investment_fraud, impersonation, payment_fraud).

Model returns a fraud type not in the approved list or a generic label like 'scam'.

Schema validation: assert fraud_type is in the allowed enum list for 100 test cases.

Confidence Score Calibration

confidence_score is a float between 0.0 and 1.0. Scores above 0.85 correlate with true positives; scores below 0.40 correlate with non-fraud.

Confidence is 0.99 for a clearly non-fraudulent message, or 0.10 for a known fraud exemplar.

Statistical check: run 50 known fraud and 50 known non-fraud samples. Assert mean confidence difference > 0.40.

Evidence Grounding

evidence_snippets contains at least one direct quote from [INPUT_TEXT] for any fraud_type other than 'none'.

Evidence field is empty, contains a hallucinated quote not in the input, or is a generic summary.

Substring match: for each snippet, verify it exists in the original [INPUT_TEXT]. Fail if any snippet is absent.

Routing Queue Assignment

routing_queue is exactly one of: 'immediate_review', 'standard_investigation', 'automated_block', or 'no_action'.

Routing queue is null, missing, or a free-text string like 'maybe check this'.

Enum check: assert routing_queue is a non-null string from the allowed set.

Null Handling for Non-Fraud

When fraud_type is 'none', evidence_snippets is an empty array and routing_queue is 'no_action'.

A 'none' classification still returns evidence snippets or routes to an investigation queue.

Conditional schema check: if fraud_type == 'none', assert evidence_snippets == [] and routing_queue == 'no_action'.

Multi-Indicator Detection

Correctly identifies the primary fraud type when multiple weak indicators are present, without over-flagging.

Model returns 'none' for a message with 3+ weak romance scam signals, or returns 'investment_fraud' for a single mention of 'profit'.

Curated edge-case set: run 20 multi-signal examples. Assert primary fraud type matches the labeled ground truth.

Output Format Strictness

Output is valid JSON that parses without error and matches the [OUTPUT_SCHEMA] exactly, with no extra keys.

Output contains additional keys like explanation or severity, or the JSON is wrapped in a markdown code fence.

Automated parse test: json.loads(output) must succeed. Assert set(output.keys()) == set(expected_schema_keys).

False Positive Resistance

Flags fewer than 5% of benign business communications (e.g., invoice discussions, promotional offers) as fraud.

Flags a standard payment reminder or a marketing email as 'payment_fraud' or 'investment_fraud'.

Benchmark test: run 100 benign business messages. Assert fraud_type != 'none' for less than 5 outputs.

ADAPTATION OPTIONS

Adapt This Prompt

How to adapt

Start with the base fraud taxonomy prompt and a simple JSON schema. Use a frontier model (GPT-4o, Claude 3.5 Sonnet) with temperature 0. Remove the investigation queue routing field and confidence scoring until you validate the taxonomy labels on your data. Replace [FRAUD_TAXONOMY] with a flat list of 5-8 categories you care about most.

code
Classify the following content into fraud categories: [FRAUD_TAXONOMY].

Content: [INPUT]

Return JSON: {"category": "...", "indicators": [...]}

Watch for

  • Overly broad categories that catch too many false positives
  • Missing edge cases: legitimate urgency, genuine investment discussions, normal relationship language
  • No baseline false-positive rate measurement before moving to production
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.