This prompt is a first-pass classifier designed for defense contractors, government agency AI system operators, and platform security engineers who must prevent classified or controlled information from entering unauthorized AI processing pipelines. Its primary job is to inspect unstructured text—documents, emails, chat messages, or file uploads—and detect markers for Controlled Unclassified Information (CUI), For Official Use Only (FOUO), Sensitive Compartmented Information (SCI), Special Access Program (SAP) designations, and classified headers at the TOP SECRET, SECRET, and CONFIDENTIAL levels. The prompt belongs at the ingress layer, before any model inference, vector database ingestion, or logging system capture, to prevent spillage incidents that carry regulatory, contractual, and national security consequences.
Prompt
Government Classification Marking Detection Prompt

When to Use This Prompt
Defines the operational context, ideal user, and critical boundaries for deploying the Government Classification Marking Detection Prompt at the ingress layer of an AI pipeline.
Use this prompt when you are building an AI pipeline that ingests content from government or defense environments and you need an automated, fast triage step to quarantine suspect content. It is appropriate for systems that process unclassified but sensitive information and must ensure that inadvertently introduced classified material does not leak into commercial cloud models, unencrypted storage, or unauthorized logging streams. The prompt is not a replacement for a formal Data Loss Prevention (DLP) system, a cross-domain solution, or a trained human security reviewer. It is a narrow, high-precision filter that should be paired with downstream quarantine logic, audit logging, and a mandatory human review step for any content that triggers a positive classification match.
Do not use this prompt as a standalone security control or as the sole determinant for downgrading or declassifying content. It is not designed to interpret classification guides, make original classification decisions, or handle derivative classification logic. Avoid deploying it in environments where a false negative could cause a reportable spillage without additional layers of defense. The prompt's output should always be treated as a signal for routing, not as an authoritative classification determination. Before deploying, ensure that your logging and observability infrastructure is authorized to capture the prompt's input and output at the appropriate classification level, and that your quarantine path is tested against known classification marking patterns.
Use Case Fit
Where this prompt works, where it fails, and the operational prerequisites for deploying it in a production AI system handling government-classified information.
Good Fit: Pre-Processing Sanitization Gate
Use when: you need to scan all user inputs or uploaded documents for classification markings before they reach any model, vector database, or logging system. Guardrail: Deploy this prompt as a synchronous pre-check in your inference pipeline. If a marking is detected, immediately halt processing, quarantine the input, and route to a spillage response workflow.
Bad Fit: Standalone Security Scanner
Avoid when: you treat this prompt as the sole line of defense for preventing classified data spills. Risk: A prompt alone cannot guarantee detection of all marking formats, especially obfuscated, handwritten, or image-based headers. Guardrail: This prompt must be one layer in a defense-in-depth strategy that includes regex pattern matching, file metadata inspection, and data loss prevention (DLP) tools.
Required Inputs: Structured Context Window
What to watch: The prompt requires a clearly defined [INPUT_TEXT] and an authoritative [CLASSIFICATION_MARKING_TAXONOMY] (e.g., CUI, FOUO, SCI, SAP). Without a taxonomy, the model may miss non-US markings or generate false positives on common acronyms. Guardrail: Maintain a version-controlled taxonomy file that is injected into the prompt context. Update it whenever new markings are authorized.
Operational Risk: False Negatives on Unmarked Documents
What to watch: A document containing classified information but lacking a standard header or footer marking will not be detected. Risk: The system will process classified data as unclassified, creating a spillage event. Guardrail: Never rely solely on marking detection. Combine this prompt with content-based sensitivity classifiers and mandatory human review for any document from a classified source system.
Operational Risk: Logging and Telemetry Exposure
What to watch: The prompt's output, including the detected marking string itself, may be logged by your observability platform. Risk: You inadvertently create a spillage in your logging system by recording the classification banner. Guardrail: Configure your logging pipeline to redact the detected_marking field from production logs or route all logs from this workflow to a dedicated high-side auditing system.
Variant: Image-Based Marking Detection
What to watch: This text-based prompt will fail on scanned documents or images where the classification banner is part of the visual header. Risk: A user uploads a photo of a classified document, and the text extraction layer misses the marking. Guardrail: For multimodal inputs, route images through an OCR step first. Use a separate multimodal prompt to analyze the top and bottom 10% of the image for classification banners before text extraction.
Copy-Ready Prompt Template
A reusable system prompt for detecting U.S. Government classification markings and routing content to quarantine.
The following prompt template is designed to be pasted directly into your system prompt or classification middleware. It instructs the model to act as a strict, deterministic classifier that scans input text for explicit or malformed U.S. Government classification markings, banner lines, portion markings, and control notices. The model must not summarize, analyze, or continue processing the content—its sole job is detection and routing instruction.
markdownYou are a strict content classifier for a secure AI processing pipeline. Your only task is to scan the provided text for U.S. Government classification markings, control notices, and dissemination controls. You must not summarize, analyze, or repeat the content under any circumstances. # Classification Taxonomy Scan for the following markings, including common abbreviations, malformed variants, and legacy designations: - Top Secret (TS) - Secret (S) - Confidential (C) - Controlled Unclassified Information (CUI) and all CUI categories/sublabels - For Official Use Only (FOUO) - Sensitive Compartmented Information (SCI) - Special Access Program (SAP) and all SAP compartments - Unclassified//For Official Use Only (U//FOUO) - Law Enforcement Sensitive (LES) - Distribution statements (e.g., Distribution D, Distribution X) - Dissemination control markings (e.g., NOFORN, REL TO, ORCON, PROPIN) - Any classification banner line (e.g., "TOP SECRET//SI//NOFORN") - Any portion marking (e.g., "(TS)", "(S//NF)", "(CUI)") - Declassification instructions (e.g., "DECLASSIFY ON: 20501231") # Detection Rules 1. Markings can appear in headers, footers, subject lines, body text, or metadata. 2. Malformed markings (e.g., missing slashes, inconsistent casing, typographical errors that still convey classification intent) must be treated as positive detections. 3. If any portion of the input contains a marking, the entire input is considered classified. 4. The absence of a marking does not mean the content is unclassified; only report on what is detected. # Input [INPUT_TEXT] # Output Schema Return ONLY a valid JSON object with the following structure. No other text. { "classification_detected": boolean, "highest_classification_level": "TOP_SECRET" | "SECRET" | "CONFIDENTIAL" | "CUI" | "UNCLASSIFIED_CONTROLLED" | "NONE_DETECTED", "detected_markings": [ { "marking": string, "type": "BANNER" | "PORTION" | "CONTROL_NOTICE" | "DISTRIBUTION" | "DECLASSIFICATION", "excerpt": string, "confidence": "HIGH" | "MEDIUM" | "LOW" } ], "routing_instruction": "QUARANTINE_IMMEDIATE" | "ESCALATE_FOR_REVIEW" | "NO_ACTION", "rationale": string } # Routing Logic - If classification_detected is true and highest_classification_level is TOP_SECRET, SECRET, CONFIDENTIAL, SCI, or SAP: routing_instruction MUST be "QUARANTINE_IMMEDIATE". - If classification_detected is true and highest_classification_level is CUI or UNCLASSIFIED_CONTROLLED: routing_instruction MUST be "ESCALATE_FOR_REVIEW". - If classification_detected is false: routing_instruction MUST be "NO_ACTION". # Constraints - Do not output any text outside the JSON object. - Do not include the original input text in the output. - Do not describe, summarize, or comment on the content. - If you are uncertain about a potential marking, set confidence to "LOW" and still report it. - If the input is empty or contains no text, return classification_detected: false with routing_instruction "NO_ACTION".
To adapt this template for your environment, replace the taxonomy list with your organization's specific classification guide and authorized abbreviations. Update the routing logic to match your spillage response plan—for example, some environments may require immediate session termination and audit log generation in addition to quarantine. The output schema can be extended with fields for spillage_severity, required_notifications, or quarantine_ticket_id if your middleware expects those values.
Before deploying, test this prompt against a golden dataset that includes: correctly formatted banner lines, malformed markings with typos, classification words used in non-classified contexts (e.g., "the secret to success"), and documents with mixed classification levels. False positives on non-classified uses of words like "confidential" are a common failure mode. Implement a human review step for all ESCALATE_FOR_REVIEW outputs and log every QUARANTINE_IMMEDIATE event with the full detection payload for audit purposes.
Prompt Variables
Replace each placeholder with your organization's specific values before deploying the Government Classification Marking Detection Prompt. Validation notes describe how to verify each input is correctly configured for your environment.
| Placeholder | Purpose | Example | Validation Notes |
|---|---|---|---|
[CLASSIFICATION_MARKINGS_LIST] | Defines the exact classification markings, banners, and control phrases the prompt must detect | TOP SECRET, SECRET, CONFIDENTIAL, CUI, FOUO, SCI, SAP, NOFORN, REL TO | Parse check: verify list contains only valid marking strings. Must match your organization's authorized classification guide. Null not allowed. |
[DOCUMENT_CONTENT] | The raw text or document body to scan for classification markings | This document contains CUI information related to contract number FA8650-24-C-1234... | Schema check: must be non-empty string. Pre-process to strip binary artifacts before passing. Null not allowed. |
[OUTPUT_SCHEMA] | The exact JSON schema or format definition the model must return | {"marking_detected": boolean, "marking_type": string, "marking_location": string, "confidence": float, "quarantine_required": boolean} | Schema check: validate output parses against this schema. Include required fields and type constraints. Retry on parse failure. |
[CONFIDENCE_THRESHOLD] | Minimum confidence score required before automated quarantine routing is triggered | 0.85 | Threshold check: values below this trigger human review queue. Range 0.0-1.0. Adjust based on false-positive tolerance testing. |
[QUARANTINE_ROUTING_TAG] | The routing label or queue identifier for quarantined content | classification-spillage-quarantine | Routing check: must match an existing queue or workflow identifier in your routing system. Test that tagged content reaches the correct handler. |
[HUMAN_REVIEW_QUEUE] | The escalation destination for ambiguous or borderline detections below confidence threshold | security-review-pending | Routing check: must map to an active review queue with assigned personnel. Verify notification triggers fire on queue insertion. |
[ALLOWED_HANDLING_CAVEATS] | Permitted handling caveats that do not trigger quarantine when present without classification markings | FOUO, CUI//NOFORN, CUI//SP-EXPT | Parse check: must be a subset of [CLASSIFICATION_MARKINGS_LIST]. Entries here reduce false positives for unclassified controlled information. Null allowed if no exceptions. |
[SPILLAGE_INCIDENT_TAG] | Incident management tag applied when classification marking is confirmed in unclassified systems | spillage-event-critical | Routing check: must trigger incident response workflow. Verify audit log entry is created with timestamp, content hash, and routing decision. Approval required before tag removal. |
Implementation Harness Notes
How to wire the Government Classification Marking Detection Prompt into a secure application with quarantine routing and spillage prevention controls.
This prompt must operate as a pre-processing guard—the very first step before any model inference, logging, or storage occurs on the input. The harness should intercept the raw document or message, invoke the classification detection prompt, and branch based on the result. A positive detection must trigger an immediate quarantine path: stop all downstream processing, route the content to an air-gapped or high-side review queue, and prevent any persistence in standard application logs, vector databases, or model context windows. The harness itself should run in an environment authorized for the highest classification level it might encounter, or it must refuse to process content above its authorization boundary.
Model choice and invocation: Use a fast, low-latency model for the detection step—this is a classification task, not a generation task. A model like Claude 3 Haiku, GPT-4o-mini, or a fine-tuned classifier is appropriate. The prompt should be called with temperature=0 for deterministic outputs. Wrap the call in a retry with exponential backoff (max 3 attempts) for transient failures, but never retry on a positive classification result. On timeout or model error, fail closed: route to quarantine. The harness must capture the raw model response, parse the JSON output, and validate the classification_marking_detected boolean and marking_type field against the expected schema before acting on the result.
Validation and logging constraints: After parsing, validate that marking_type is one of the expected enum values (CUI, FOUO, SECRET, TOP SECRET, SCI, SAP, UNCLASSIFIED, etc.). If the model returns an unrecognized marking type, treat it as a potential detection and quarantine. Logging is the highest-risk surface for spillage. The harness must write detection events to a dedicated, access-controlled audit log that records: timestamp, a hash of the input content (never the raw content itself), the detected marking, confidence score, and the routing decision. Never log the input text, prompt, or model response to standard application logs. For high-side deployments, integrate with existing security information and event management (SIEM) systems using structured audit records.
Downstream routing and human review: On positive detection, the harness must return a structured rejection to the calling application (e.g., HTTP 451 Unavailable For Legal Reasons or a custom quarantine status) with a reference ID for the audit record. The quarantined content should be encrypted at rest and accessible only through a break-glass review workflow. For ambiguous detections (confidence below a configurable threshold, e.g., 0.85), route to a human review queue with the content and model reasoning. The review interface must run in an authorized environment. Never use the detection result to automatically downgrade or reclassify content—only to route and quarantine. Before deploying, run a red-team exercise with sample classified documents at each marking level, plus adversarial inputs designed to evade detection (obfuscated headers, partial markings, image-only classification stamps) to establish baseline detection rates and failure modes.
Expected Output Contract
Fields, format, and validation rules the model must follow. Downstream routing depends on this structure.
| Field or Element | Type or Format | Required | Validation Rule |
|---|---|---|---|
classification_marking_detected | boolean | Must be true if any marking is found; false only if no indicators present | |
marking_type | enum: [CUI, FOUO, SCI, SAP, CLASSIFIED, UNCLASSIFIED, NONE] | Must match one of the allowed enum values; NONE only when classification_marking_detected is false | |
marking_header_text | string | null | Exact text of the classification banner or header if found; null when no marking detected | |
classification_level | enum: [TOP_SECRET, SECRET, CONFIDENTIAL, UNCLASSIFIED, null] | Must be derived from marking text; null when no classification marking detected | |
dissemination_controls | string[] | null | Array of extracted control markings (e.g., NOFORN, REL TO); empty array if none found; null only when no marking detected | |
confidence_score | number (0.0-1.0) | Must be between 0.0 and 1.0; values below 0.7 should trigger human review routing | |
spillage_risk | enum: [HIGH, MEDIUM, LOW, NONE] | HIGH if classified marking found in unclassified context; NONE if no marking detected; requires downstream quarantine routing for HIGH | |
source_location | object: {line: number, char_offset: number} | null | Must include line number and character offset of marking; null when no marking detected; used for audit trail generation |
Common Failure Modes
Classification marking detection fails silently in production when the prompt cannot distinguish real markings from lookalikes, misses obfuscated headers, or over-triggers on training data. These failure modes break spillage prevention controls.
False Positives on Training Data
What to watch: The model flags documents containing classification marking examples, policy manuals, or training materials as live classified content. This floods quarantine queues with clean data and desensitizes operators to real alerts. Guardrail: Add a system instruction distinguishing reference material from actual marked documents. Include few-shot examples of training excerpts labeled as UNCLASSIFIED.
Obfuscated Marking Bypass
What to watch: Attackers or accidental users insert classification terms split across lines, encoded in base64, hidden in zero-width characters, or embedded in document metadata rather than visible headers. The prompt misses these and routes classified content to unclassified systems. Guardrail: Pre-process inputs to normalize whitespace, decode common encodings, and extract metadata fields before classification. Never rely solely on the prompt to catch obfuscation.
Partial Marking Ambiguity
What to watch: A document contains a classification banner but missing portion markings, or has a classification footer without a header. The prompt returns low confidence or inconsistent results, creating a routing deadlock. Guardrail: Define explicit handling rules for incomplete markings. Route to a human review queue with the extracted fragments and a confidence score rather than guessing.
Foreign Classification System Confusion
What to watch: NATO, UK, AUS, and other allied classification markings (e.g., RESTRICTED, CONFIDENTIAL, SECRET) overlap with or differ from US equivalents. The prompt misclassifies foreign markings as US classifications or ignores them entirely. Guardrail: Include a classification system taxonomy in the prompt context. Map foreign markings to handling rules explicitly. When uncertain, route to a cross-domain review queue.
Downstream Leakage After Correct Detection
What to watch: The prompt correctly identifies a classification marking, but the application layer fails to quarantine the content. The model response itself echoes the classified text in an unclassified channel. Guardrail: Never pass raw classified content through the model to an unclassified log or UI. Truncate, hash, or replace detected content before it reaches the model response. Implement application-layer blocking independent of the prompt output.
Sensitive Compartmented Information (SCI) and SAP Miss
What to watch: The prompt detects TOP SECRET but misses SCI codewords or Special Access Program (SAP) markers embedded in the same document. The content is routed at the base classification level without compartment controls. Guardrail: Add explicit detection rules for SCI control systems (HCS, SI, TK, etc.) and SAP identifiers. Require compartment-aware routing that preserves need-to-know restrictions beyond the base classification level.
Evaluation Rubric
Run these checks against a golden dataset of documents with known classification markings. Each criterion validates a specific failure mode observed in production classification marking detection.
| Criterion | Pass Standard | Failure Signal | Test Method |
|---|---|---|---|
Exact marking match | All classification banners and portion markings in the golden dataset are identified with exact string match | Missing marking, partial string match, or hallucinated marking not present in source | Compare extracted [CLASSIFICATION_MARKINGS] array against ground truth labels using strict string equality |
Classification level accuracy | Top-level classification (UNCLASSIFIED, CUI, CONFIDENTIAL, SECRET, TOP SECRET) matches ground truth for 100% of test documents | Downgraded classification level or failure to detect the highest classification tier present | Extract [OVERALL_CLASSIFICATION] field and compare to expected level using exact match |
Dissemination control detection | All dissemination controls (FOUO, NOFORN, REL TO, ORCON, PROPIN) present in source are detected with zero false negatives | Missed dissemination control marking or hallucinated control not in source text | Check [DISSEMINATION_CONTROLS] array against ground truth set using set equality comparison |
SCI and SAP program identification | All SCI control systems and SAP program names in source are extracted with correct compartment/program label | Missing compartment name, truncated program identifier, or merged compartments | Validate [SCI_CONTROLS] and [SAP_PROGRAMS] arrays against known program list from test document metadata |
Portion marking paragraph mapping | Each portion marking is correctly mapped to its corresponding paragraph or section identifier | Portion marking assigned to wrong paragraph, orphaned marking, or paragraph missing required portion mark | Verify [PORTION_MARKINGS] array entries contain correct [PARAGRAPH_ID] to [MARKING] mappings per ground truth |
Declassification instruction extraction | Declassification date, event, or exemption category is extracted exactly as stated in source | Missing declassification instruction, wrong date format, or hallucinated exemption category | Check [DECLASSIFICATION] object fields against known values; date format must match source exactly |
False positive rate on unmarked documents | Zero classification markings detected on unmarked test documents (public information, press releases, unclassified briefs) | Any classification marking, dissemination control, or compartment label returned for unmarked content | Run prompt against 50+ unmarked documents; assert [CLASSIFICATION_MARKINGS] is empty array and [OVERALL_CLASSIFICATION] is UNCLASSIFIED |
Derivative classification marking logic | Correctly identifies 'Derived From' source references and 'Classified By' attribution lines when present | Missed derivative source line, wrong source document identifier, or failure to extract multiple derivation sources | Validate [DERIVED_FROM] array contains all source references with correct document identifiers per ground truth |
Enabling Efficiency, Speed & Accuracy
Intelligent Analysis, Decision & Execution
We build AI systems for teams that need search across company data, workflow automation across tools, or AI features inside products and internal software.
Talk to Us
Search across company data
Give teams answers from docs, tickets, runbooks, and product data with sources and permissions.
Useful when people spend too long searching or get different answers from different systems.

Automate internal workflows
Use AI to route work, draft outputs, trigger actions, and keep approvals and logs in place.
Useful when repetitive work moves across multiple tools and teams.

Add AI to products and internal tools
Build assistants, guided actions, or decision support into the software your team or customers already use.
Useful when AI needs to be part of the product, not a separate tool.
Adapt This Prompt
How to adapt
Use the base prompt with a frontier model (GPT-4o, Claude 3.5 Sonnet) and a simple string-match fallback for known marking patterns. Focus on detecting explicit banners like // CUI or (U) without building the full quarantine pipeline.
codeSystem: You are a classification marking detector. Analyze [INPUT_TEXT] and return JSON with `detected_markings`, `highest_classification`, and `confidence`. If no markings are found, return `{"detected_markings": [], "highest_classification": "UNCLASSIFIED", "confidence": 1.0}`.
Watch for
- Missing partial markings (e.g., portion marks without banner)
- Over-reliance on exact string matches for legacy formats
- No handling of mixed classification levels in a single document

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.
Partnered with leading AI, data, and software stack.
How We Work
Custom AI workflows for your Business
One-fit-all AI don't work for modern businesses. At Inferensys, we aim to understand your business & custom requirements; which we use to define most efficient agentic workflows, the data, and the tools for your business.
01
Review the use case
We understand the task, the users, and where AI can actually help.
Read more02
Pick the right approach
We define what needs search, automation, or product integration.
Read more03
Build the first useful version
We implement the part that proves the value first.
Read more04
Improve from there
We add the checks and visibility needed to keep it useful.
Read moreThe first call is a practical review of your use case and the right next step.
Talk to Us