Inferensys

Prompt

Financial Scam and Fraud Detection Prompt

A practical prompt playbook for using Financial Scam and Fraud Detection Prompt in production AI workflows for fintech and marketplace trust engineers.
Security analyst reviewing fraud detection AI on multiple screens, alert dashboards visible, dark mode monitoring setup.
PROMPT PLAYBOOK

When to Use This Prompt

Defines the operational context, ideal user, and boundaries for deploying the financial scam detection prompt in a production AI pipeline.

This prompt is designed for fintech and marketplace trust engineers who need to classify user-generated content, messages, or transaction descriptions for financial scam indicators. It detects investment scams, advance-fee fraud, phishing for financial credentials, payment redirection attempts, and romance-investment hybrid scams. Use this prompt at the ingress layer before user content reaches downstream models, payment systems, or messaging infrastructure. The prompt outputs a structured classification with scam category, confidence score, and extracted indicators including URLs, payment addresses, and pressure tactics. This is a classification and triage prompt, not a response-generation prompt. It belongs in a guardrail pipeline where flagged content triggers quarantine, human review, or automated blocking before any financial action occurs.

Do not use this prompt as a standalone consumer safety tool, for generating user-facing warnings, or for making final account action decisions without human review. It is not a replacement for transaction monitoring systems, KYC/AML checks, or regulatory filing workflows. The prompt is optimized for text-based content and may miss scams conveyed purely through images, audio, or video without accompanying text. For multimodal content, pair this prompt with a vision-capable model or pre-extract text descriptions before classification. The confidence scores are model-estimated probabilities, not calibrated risk scores—always calibrate thresholds against your own labeled evaluation set and business risk tolerance before setting automated action triggers.

Deploy this prompt where the cost of a missed scam (false negative) is higher than the cost of a false positive review. Typical integration points include: peer-to-peer marketplace messaging, payment description fields, investment community posts, customer support intake forms, and social features within fintech products. Before production use, run the prompt against a golden evaluation set that includes your platform's specific scam patterns, legitimate financial discussions that should not be flagged, and edge cases like financial education content or sarcastic commentary. Start with a human-in-the-loop quarantine workflow and only automate blocking actions after measuring precision and recall across at least two weeks of production traffic.

PRACTICAL GUARDRAILS

Use Case Fit

Where this prompt works, where it fails, and the operational preconditions required before deploying it in a production fintech or marketplace trust pipeline.

01

Good Fit: User-Generated Content Screening

Use when: scanning direct messages, listings, comments, or profile bios for advance-fee fraud, romance scams, or payment redirection. The prompt excels at extracting structured indicators (URLs, wallet addresses, pressure tactics) from unstructured text. Guardrail: Always pair with a separate PII redaction prompt before logging extracted indicators to prevent sensitive data leaks in audit trails.

02

Bad Fit: Real-Time Transaction Authorization

Avoid when: blocking a payment or trade in the critical path of a real-time transaction flow. LLM latency and non-determinism make it unsuitable for synchronous authorization decisions. Guardrail: Use this prompt for async post-transaction review or pre-listing screening. For real-time blocking, extract the indicators and match them against a deterministic blocklist in application code.

03

Required Inputs: Context Beyond the Message Body

Risk: A single message without context causes high false-positive rates. Legitimate negotiation can mimic pressure tactics. Guardrail: The prompt template must receive [USER_MESSAGE], [CONVERSATION_HISTORY], and [USER_ACCOUNT_AGE] as mandatory variables. Without conversation history, the model cannot distinguish a scam script from a heated but legitimate sale.

04

Operational Risk: Extracted Indicator Poisoning

Risk: A scammer includes a legitimate-looking URL that redirects post-review, or a wallet address that has been sanitized by a third party. The model will extract it with high confidence, creating a false sense of security. Guardrail: Never auto-block based solely on extracted indicators. Run URLs through a URL-scanning tool and check wallet addresses against a live sanctions and fraud database before taking action.

05

Operational Risk: Confidence Score Calibration Drift

Risk: The model's numeric confidence score (e.g., 0.95) is not a calibrated probability. Over time, new scam patterns will cause the model to be overconfident on novel attacks. Guardrail: Implement a shadow evaluation pipeline that samples low-confidence predictions for human review and tracks the true positive rate per confidence bucket. Use this to adjust the escalation threshold monthly.

06

Bad Fit: Unmoderated Auto-Reply to Scammers

Avoid when: building a bot that automatically confronts or deters suspected scammers. Engaging with bad actors can escalate abuse, provide them with model behavior signals, or create legal risk. Guardrail: The only safe automated actions are silent quarantine, flagging for human review, or surfacing a generic policy warning. Never wire this prompt to a generative auto-responder.

PROMPT PLAYBOOK

Copy-Ready Prompt Template

A reusable prompt with square-bracket placeholders for detecting financial scams and fraud in user-submitted text.

This prompt template is designed to be pasted directly into your system prompt or user message template. It instructs the model to act as a financial fraud classifier, analyzing the provided input for known scam patterns. The template uses square-bracket placeholders like [INPUT] and [SCAM_TAXONOMY] so you can wire it into your application's variable substitution logic without manual editing. The output is a structured JSON object, making it suitable for direct ingestion by a downstream routing or quarantine service.

text
You are a financial scam and fraud detection classifier. Your task is to analyze the provided user input and determine if it contains indicators of a financial scam or fraudulent activity.

### INPUT
[INPUT]

### SCAM TAXONOMY
Use the following categories to classify the input. If the input is not a scam, use the category "none".
[SCAM_TAXONOMY]

### OUTPUT SCHEMA
You must respond with a single, valid JSON object conforming to this schema. Do not include any other text.
{
  "is_scam": boolean, // true if any scam indicators are detected
  "category": string, // the most specific category from the taxonomy that matches, or "none"
  "confidence": number, // a score from 0.0 to 1.0
  "indicators": [
    {
      "type": string, // e.g., "url", "payment_address", "pressure_tactic", "credential_phishing", "advance_fee", "impersonation"
      "value": string, // the extracted suspicious string or tactic description
      "context": string // the surrounding sentence or phrase where the indicator was found
    }
  ],
  "reasoning": string // a brief, factual explanation of the classification, referencing the indicators found
}

### CONSTRAINTS
- Do not hallucinate indicators. Only extract strings that are literally present in the input.
- If the input is a normal financial discussion, customer support query, or legitimate transaction, classify it as "none" with a low confidence score.
- Pay special attention to urgency, threats of loss, and requests for secrecy, which are strong pressure tactics.
- Identify cryptocurrency wallet addresses, payment links, and routing numbers that are presented in a suspicious context.

To adapt this template, replace the [SCAM_TAXONOMY] placeholder with your organization's specific list of scam categories, such as "investment_scam", "romance_scam", "advance_fee_fraud", or "payment_redirection". The [INPUT] placeholder should be populated with the raw user text at runtime. For high-risk production environments, you should pair this prompt with a validation layer that checks the output JSON against the schema before acting on the classification. A common failure mode is the model returning a category not present in your taxonomy; implement a retry or repair step to handle this.

IMPLEMENTATION TABLE

Prompt Variables

Required and optional inputs for the Financial Scam and Fraud Detection Prompt. Validate each variable before invoking the model to prevent misclassification and ensure consistent output structure.

PlaceholderPurposeExampleValidation Notes

[USER_MESSAGE]

The raw text, email, chat, or post to classify for financial scam or fraud signals.

Required. Must be a non-empty string. Check for null, empty, or whitespace-only inputs before prompt assembly. Apply PII redaction if needed.

[MESSAGE_SOURCE]

The origin channel of the input to help contextualize scam patterns (e.g., SMS, email, social DM, in-app chat).

sms

Required. Must match an allowed enum: sms, email, social_dm, in_app_chat, forum_post, review, other. Reject unknown values.

[SENDER_CONTEXT]

Known metadata about the sender, such as account age, verification status, or relationship to recipient.

{"account_age_days": 2, "verified": false, "mutual_connections": 0}

Optional. If provided, must be valid JSON with expected keys. If null or missing, the prompt should instruct the model to rely only on message content.

[SCAM_TAXONOMY]

The list of scam categories the model is allowed to use for classification.

["investment_scam", "advance_fee_fraud", "phishing", "payment_redirection", "romance_scam", "impersonation", "other_fraud"]

Required. Must be a JSON array of strings. Validate against a master taxonomy list. An empty array should cause the prompt to reject the input as unclassifiable.

[OUTPUT_SCHEMA]

The exact JSON schema the model must return, including fields for category, confidence, indicators, and rationale.

{"type": "object", "properties": {"scam_category": {"type": "string"}, "confidence_score": {"type": "number"}, "extracted_indicators": {"type": "array"}, "rationale": {"type": "string"}}, "required": ["scam_category", "confidence_score", "extracted_indicators", "rationale"]}

Required. Must be a valid JSON Schema object. The application layer should parse this and use it for output validation. Schema drift requires a prompt version update.

[CONFIDENCE_THRESHOLD]

The minimum confidence score required for the model to auto-classify. Scores below this threshold should result in an 'ambiguous' classification.

0.7

Required. Must be a float between 0.0 and 1.0. The application should enforce this threshold post-generation; the prompt should instruct the model to be honest about low confidence.

[PREVIOUS_FLAGS]

A history of prior abuse flags or scam reports for this sender or message thread, used to detect repeat offenders or evolving tactics.

["phishing_attempt_2024-01-15"]

Optional. If provided, must be a JSON array of strings. If null or empty, the model should treat the message as a first-time event. Ensure this data is not hallucinated into the output.

PROMPT PLAYBOOK

Implementation Harness Notes

How to wire the financial scam detection prompt into a production application with validation, logging, and human review.

Integrating this prompt into a production system requires treating it as a classification microservice with strict input validation, output schema enforcement, and a clear escalation path. The prompt is designed to sit behind an API endpoint or message queue consumer that receives user-submitted text—such as marketplace messages, payment notes, or support tickets—and returns a structured scam assessment. Because false negatives can lead to financial loss and false positives can block legitimate transactions, the harness must balance automated action with human oversight. The implementation should never allow raw model output to trigger irreversible actions like account freezes or payment blocks without passing through a configurable risk threshold and, above that threshold, a human review queue.

Start by wrapping the prompt in a function that accepts a single [INPUT] string and a [RISK_LEVEL] parameter (low, medium, high) that controls the sensitivity of the detection. The function should enforce a maximum input length (e.g., 4000 characters) to prevent prompt stuffing and reject empty inputs. Before calling the model, sanitize the input by stripping null bytes and normalizing Unicode to prevent encoding-based evasion. The model call itself should use a low-temperature setting (0.0–0.1) to maximize deterministic classification, and you should request a structured JSON output matching the schema: { scam_detected: boolean, scam_category: string | null, confidence: float, indicators: { urls: string[], payment_addresses: string[], pressure_tactics: string[] }, explanation: string }. Implement a retry loop with exponential backoff (max 3 attempts) that only retries on model unavailability or malformed JSON—not on low-confidence results. After receiving a valid response, run a post-processing validator that checks: (1) confidence is between 0.0 and 1.0, (2) scam_category is non-null when scam_detected is true, and (3) extracted URLs are syntactically valid. If validation fails, log the raw output and route to a manual review queue rather than retrying indefinitely.

For observability, log every classification decision with a unique trace_id, the input hash (not the raw input, to avoid logging sensitive user content), the model version, confidence score, and the final routing decision. This audit trail is critical for tuning thresholds, investigating false positives, and demonstrating compliance to regulators or payment partners. Wire the classification result into a decision engine: if scam_detected is false or confidence is below a configurable threshold (e.g., 0.7), allow the transaction or message to proceed. If scam_detected is true and confidence exceeds a high threshold (e.g., 0.9), you may automate a soft block—such as flagging the account for review or delaying the payment—but never hard-delete content or permanently ban users without human confirmation. All cases in the middle confidence band (0.7–0.9) should create a ticket in your trust and safety review queue with the full model output, extracted indicators, and a link to the source input. This human-in-the-loop step is non-negotiable for financial workflows where the cost of a mistake is high. Finally, schedule a weekly review of false positive and false negative cases to update your few-shot examples and threshold configuration.

IMPLEMENTATION TABLE

Expected Output Contract

Defines the strict JSON schema for the financial scam detection prompt response. Every field must be validated before the output is routed to downstream systems or human review queues.

Field or ElementType or FormatRequiredValidation Rule

scam_detected

boolean

Must be true or false. If false, all other fields except confidence and reasoning must be null.

scam_category

enum string

Must match one of: investment_scam, advance_fee_fraud, phishing, payment_redirection, romance_scam, impersonation, other. Required if scam_detected is true.

confidence_score

float 0.0-1.0

Must be a number between 0.0 and 1.0. Scores below 0.7 should trigger human review if scam_detected is true.

extracted_indicators

array of objects

Each object must have type (url, email, phone, crypto_address, account_number) and value. Array must be empty if no indicators found.

pressure_tactics_detected

array of strings

Each string must match a known tactic: urgency, authority_figure, limited_offer, threat, social_proof, secrecy. Empty array if none detected.

target_financial_institution

string or null

If a specific bank, fintech, or payment platform is impersonated, provide the name. Otherwise null.

reasoning_summary

string

Must be 1-3 sentences explaining the classification decision. Must reference specific evidence from the input. Cannot be empty.

recommended_action

enum string

Must be one of: block, quarantine, flag_for_review, allow. block requires confidence >= 0.9 and scam_detected true.

PRACTICAL GUARDRAILS

Common Failure Modes

Financial scam detection prompts fail in predictable ways. These are the most common production failure modes and the guardrails that catch them before they cause harm.

01

Over-Confidence on Ambiguous Language

What to watch: The model assigns high confidence to scam classifications when the input contains financial urgency language that could also be legitimate (e.g., 'urgent payment required' in a real invoice). This produces false positives that block valid transactions. Guardrail: Require the prompt to output a separate ambiguity_flag when pressure tactics appear without corroborating scam indicators (unknown sender, crypto wallet, personal email domain). Route flagged cases to human review before actioning.

02

Missing Extracted Indicators in Output

What to watch: The prompt correctly classifies a scam but fails to extract the specific indicators (wallet addresses, URLs, phone numbers) that downstream systems need for blocking or investigation. The classification is correct but operationally useless. Guardrail: Add a post-processing validation step that checks for the presence of at least one extracted indicator when scam_confidence exceeds 0.7. If missing, re-prompt with explicit extraction instructions or flag for manual enrichment.

03

Scam Category Confusion Between Similar Types

What to watch: The model conflates advance-fee fraud with investment scams or mislabels romance scams as general impersonation. Wrong categorization routes cases to the wrong investigation queue and skews threat intelligence. Guardrail: Include a few-shot example for each scam category in the system prompt, with distinguishing features called out. Add a category_discriminator field that requires the model to explain why it chose one category over the next-most-likely alternative.

04

Context Window Truncation Drops Critical Evidence

What to watch: Long message threads or multi-part communications get truncated by context limits, removing the part that contains the payment address or the threat. The model classifies based on incomplete evidence and misses the scam. Guardrail: Implement a sliding window or chunking strategy that prioritizes the most recent N tokens plus any segments containing financial instrument patterns (regex-matched wallet addresses, IBANs, URLs). Run detection on each chunk independently and aggregate scores.

05

Adversarial Obfuscation Bypasses Detection

What to watch: Attackers use Unicode homoglyphs, zero-width characters, leetspeak, or image-based text to hide scam indicators from the prompt while remaining readable to victims. The model sees sanitized text and returns a clean classification. Guardrail: Pre-process all input through a normalization layer that canonicalizes Unicode, strips zero-width characters, and expands common leetspeak patterns before the prompt sees the text. Log both raw and normalized versions for audit.

06

Legitimate Financial Urgency Triggers False Positives

What to watch: Real payment reminders, margin calls, fraud alerts from banks, or time-sensitive investment communications contain the same linguistic signals as scams. The model over-triggers and blocks legitimate financial operations. Guardrail: Add a sender_reputation input field that incorporates domain age, verified sender status, and known-business registry checks. Weight the prompt's classification logic to deprioritize urgency signals when sender reputation is high and the communication channel is verified.

IMPLEMENTATION TABLE

Evaluation Rubric

Use this rubric to test the Financial Scam and Fraud Detection Prompt before shipping. Each criterion targets a known failure mode in production scam classifiers.

CriterionPass StandardFailure SignalTest Method

Scam Category Accuracy

Output matches the labeled ground-truth category for 95% of test cases

Model misclassifies advance-fee fraud as investment scam or vice versa

Run against a golden dataset of 200 labeled scam examples covering all categories in the taxonomy

Indicator Extraction Completeness

All URLs, payment addresses, and phone numbers present in the input appear in the extracted indicators array

Extracted indicators array is empty when the input contains a cryptocurrency address or a phishing link

Parse the output JSON and assert that every regex-matched indicator in the input exists in the [EXTRACTED_INDICATORS] field

Confidence Score Calibration

High-confidence scores (>=0.9) have a precision of at least 0.95 on held-out data

Model assigns 0.99 confidence to an ambiguous promotional message that is not a scam

Plot confidence against actual error rate across 500 edge cases; check that confidence drops below 0.7 on ambiguous inputs

Pressure Tactic Detection

Identifies urgency language, fear appeals, and scarcity claims when present in the input

Misses a classic limited-time offer pressure tactic in a pig-butchering scam script

Curate 50 inputs with known pressure tactics and 50 without; measure recall and false-positive rate on the [PRESSURE_TACTICS] field

Benign Over-Flagging Rate

False positive rate on legitimate financial messages is below 2%

Flags a standard bank transaction notification or investment newsletter as a scam

Run the prompt against 300 benign financial messages (bank alerts, portfolio updates, invoice reminders) and measure the false-positive rate

Multi-Turn Context Handling

Correctly identifies a scam that unfolds across multiple messages when full conversation history is provided

Fails to detect a romance scam because the payment request appears in an earlier turn that the model ignores

Feed a 5-turn conversation where the scam signal is distributed across turns; assert that the final classification uses evidence from the correct turn

Obfuscation Resilience

Detects scams using leetspeak, homoglyph attacks, or zero-width characters in URLs and payment addresses

Passes a phishing link because the domain uses Cyrillic 'a' instead of ASCII 'a'

Inject 20 obfuscated scam variants into the test suite and verify that [EXTRACTED_INDICATORS] contains the normalized, decoded values

Output Schema Compliance

Every output field matches the defined schema, required fields are never null, and enum values are valid

The [SCAM_CATEGORY] field contains a category not in the approved taxonomy or [CONFIDENCE] is a string instead of a float

Validate every output against the JSON Schema using a programmatic validator; fail the test if any field is missing, mistyped, or out of enum range

ADAPTATION OPTIONS

Adapt This Prompt

How to adapt

Start with the base prompt and a simple JSON schema for the output. Use a frontier model (GPT-4o, Claude 3.5 Sonnet) with the system prompt only. Skip tool integration and log to a local file for manual review.

code
System: [BASE_SCAM_DETECTION_PROMPT]
User: [USER_MESSAGE]
Output: JSON with scam_category, confidence, indicators

Watch for

  • Overly broad scam_category values without a defined taxonomy
  • Missing confidence calibration—test with 20 known-clean and 20 known-scam examples
  • No handling of multi-turn grooming patterns
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.