Inferensys

Prompt

Blank Form Field Detection Prompt

A practical prompt playbook for detecting empty, partially filled, and placeholder form fields in production document processing pipelines.
Developer doing prompt engineering on laptop, prompt variations visible on screen, casual coding session.
PROMPT PLAYBOOK

When to Use This Prompt

Define the job, reader, and constraints for the Blank Form Field Detection Prompt.

This prompt is designed for form processing pipeline engineers who need to programmatically determine the completion status of every field in a structured or semi-structured form. The core job-to-be-done is classifying each field as filled, empty, partially_filled, or placeholder to prevent silent data corruption downstream. The ideal user is building an automated document ingestion system where forms must be validated before their data enters a system of record, such as an insurance claim, a loan application, or a clinical intake form.

Use this prompt when you have a defined schema of expected fields and need a machine-readable completion report for each one. It is most effective when the form has clear field boundaries, such as underlined blanks, boxed input areas, or labeled sections in a digital or scanned PDF. The prompt requires you to provide the expected field list and the document text (or vision-based description of the form) as input. It is not suitable for free-form documents without a known field inventory, nor for forms where the primary challenge is handwriting recognition rather than blank detection. For those cases, pair this prompt with an OCR uncertainty scoring prompt or a layout-aware extraction prompt first.

Do not use this prompt as a substitute for a deterministic PDF parser when the form is a fillable PDF with an XFA or AcroForm data stream. In that scenario, extracting the raw field values programmatically is faster, cheaper, and perfectly accurate. This prompt adds value when the form is a scanned image, a flattened PDF, or a document where the visual representation of a blank is the only available signal. Before deploying, define your tolerance for false negatives (missing a truly blank required field) versus false positives (flagging a filled field as empty). The eval harness should include examples of intentional blanks, fields filled with 'N/A' or a dash, and fields where the text runs outside the visible box.

PRACTICAL GUARDRAILS

Use Case Fit

Where the Blank Form Field Detection Prompt works well, where it breaks, and what inputs and operational risks to plan for before integrating it into a production pipeline.

01

Good Fit: Structured Forms with Known Fields

Use when: you have a fixed form schema with a known set of expected fields, and the prompt needs to classify each field as filled, empty, or partially filled. Guardrail: provide the field list as a strict JSON schema in the prompt so the model doesn't hallucinate field names or miss optional fields.

02

Bad Fit: Free-Form Documents Without a Field Map

Avoid when: the document has no predefined field structure, or you expect the model to discover fields on its own. Blank field detection requires a target list. Guardrail: use a separate document classification or field discovery prompt first to extract the expected field set before running blank detection.

03

Required Input: Field Schema with Completion Rules

Risk: without explicit rules for what counts as 'filled,' the model applies inconsistent heuristics. Guardrail: define per-field completion criteria in the prompt—minimum character count, pattern match, or semantic check—and include examples of edge cases like placeholder text or struck-through entries.

04

Required Input: Document Image or Text with Layout Hints

Risk: blank fields in scanned forms may be misread as filled due to OCR artifacts, checkboxes, or background noise. Guardrail: pass layout-aware text extraction output with bounding box or field-position metadata, and instruct the model to cross-check visual emptiness against extracted text.

05

Operational Risk: Silent False Negatives on Required Fields

Risk: a required field marked 'empty' but not flagged as required can pass downstream validation and cause data corruption. Guardrail: include a required boolean per field in the output schema, and add a post-processing rule that routes any empty required field to a human review queue before ingestion.

06

Operational Risk: Placeholder Text Misclassified as Filled

Risk: fields containing instructional text like 'Enter name here' or 'N/A' may be classified as filled. Guardrail: add a completion_quality enum to the output schema with values like genuine, placeholder, invalid, and unknown, and test against a golden set of placeholder examples.

PROMPT PLAYBOOK

Copy-Ready Prompt Template

A reusable prompt template with square-bracket placeholders for detecting blank, partially filled, and placeholder-containing form fields.

This prompt template is designed to be dropped into a form processing pipeline. It instructs the model to analyze a provided form image or extracted text, compare the detected fields against an expected schema, and classify each field's completion status. The output is a structured JSON object that downstream validation logic can consume directly, making it suitable for automated routing, human review queues, or database ingestion.

text
You are an expert document analyst. Your task is to analyze a form and determine the completion status of every expected field.

## INPUT
- Form Content: [FORM_CONTENT]
- Expected Field Schema: [FIELD_SCHEMA]

## INSTRUCTIONS
1. For each field defined in the [FIELD_SCHEMA], locate its corresponding region in the [FORM_CONTENT].
2. Classify the field's status into exactly one of the following categories:
   - "complete": The field contains a valid, non-placeholder entry.
   - "blank": The field is visibly empty.
   - "placeholder": The field contains only placeholder text, instructions, or pre-printed examples (e.g., "First Name", "MM/DD/YYYY").
   - "illegible": The field contains content, but it cannot be read with confidence.
   - "not_found": The expected field does not appear to exist in the document.
3. For any status other than "complete", provide a brief "reason" explaining the determination.
4. If the [FIELD_SCHEMA] includes a "required" flag for a field, add a boolean "requires_review" property. Set it to `true` if a required field is not "complete".

## OUTPUT_SCHEMA
Return a single JSON object with a "fields" array. Each element must conform to this structure:
{
  "field_id": "string (from schema)",
  "status": "complete | blank | placeholder | illegible | not_found",
  "reason": "string (required if status is not 'complete')",
  "requires_review": boolean
}

## CONSTRAINTS
- Do not invent field values. Only report what is visible.
- If the entire form is blank or missing, report every field as "not_found" with an appropriate reason.
- Adhere strictly to the output schema. No additional commentary outside the JSON object.

To adapt this template, replace the [FORM_CONTENT] placeholder with the raw text, OCR output, or a structured representation of the form. The [FIELD_SCHEMA] placeholder should be replaced with a JSON array of objects, each containing at least a field_id and a required boolean. For high-stakes workflows such as legal intake or insurance claims, integrate the requires_review flag into a downstream routing rule that automatically queues non-complete required fields for human verification before the document proceeds further.

IMPLEMENTATION TABLE

Prompt Variables

Required inputs for the Blank Form Field Detection Prompt. Each placeholder must be populated before the prompt is assembled and sent. Validation notes describe how to programmatically verify the input before incurring model cost.

PlaceholderPurposeExampleValidation Notes

[FORM_IMAGE_BASE64]

Base64-encoded image of the form page to analyze

iVBORw0KGgoAAAANSUhEUgAA...

Validate string is non-empty, decodes successfully, and MIME type is image/png or image/jpeg. Reject if size exceeds model context limit.

[FIELD_DEFINITIONS]

JSON array of field objects with name, expected_type, bounding_box, and required boolean

[{"name": "claimant_name", "expected_type": "string", "bounding_box": [100,200,400,250], "required": true}]

Validate JSON parses, array is non-empty, each object has all four keys, bounding_box is array of 4 integers, required is boolean. Reject if duplicate field names exist.

[COMPLETION_THRESHOLD]

Float between 0.0 and 1.0 defining the minimum pixel-fill ratio to classify a field as complete

0.15

Validate is float, >= 0.0 and <= 1.0. Default to 0.10 if not provided. Warn if threshold > 0.5 as handwritten fields often have low fill ratios.

[PLACEHOLDER_PATTERNS]

Array of regex patterns or strings that indicate placeholder text rather than real input

["N/A", "Click here", "^$", "Enter text"]

Validate is array, each element is a non-empty string. Test each pattern compiles as valid regex in target language. Provide default set if empty.

[OUTPUT_SCHEMA]

JSON Schema describing the expected output structure per field

{"type": "object", "properties": {"field_name": {"type": "string"}, "status": {"enum": ["complete", "partial", "empty", "placeholder", "illegible"]}, "confidence": {"type": "number"}}, "required": ["field_name", "status", "confidence"]}

Validate JSON Schema parses and is valid per draft-07 or later. Confirm status enum matches the five expected values. Reject if required array is missing.

[PAGE_CONTEXT]

String describing the form type, expected use, and any prior pages processed

IRS Form W-9, page 1 of 1. Previous pages: none.

Validate is string. May be empty string for single-page forms. If multi-page, check that page number and total pages are consistent with batch processing state.

[REQUIRED_FIELDS_FLAG_BEHAVIOR]

Instruction for how to treat required fields that are empty: escalate, warn, or note

escalate

Validate value is one of: escalate, warn, note. Default to escalate if not provided. This controls whether empty required fields trigger a high-severity flag in the output.

PROMPT PLAYBOOK

Implementation Harness Notes

How to wire the Blank Form Field Detection Prompt into a production document processing pipeline with validation, retries, and human review gates.

The Blank Form Field Detection Prompt is designed to sit inside a document ingestion pipeline after layout parsing and before structured data extraction. In a typical implementation, a PDF or image passes through an OCR or text extraction layer first. The extracted text and field bounding boxes are then fed into this prompt as structured context. The prompt's job is to classify each expected field as complete, partial, empty, or placeholder and return a machine-readable JSON payload. This classification step prevents downstream extraction prompts from hallucinating values for empty fields or misinterpreting placeholder text like 'N/A' or 'Enter name here' as real data. Wire this prompt as a synchronous step with a strict timeout (5-10 seconds for typical single-page forms) and a JSON schema validator immediately after the model response.

The implementation harness requires three components: a field registry, a validation layer, and a routing decision. First, maintain a field registry—a JSON or database record listing every expected field name, its required status, and acceptable completion states. Pass this registry into the prompt's [FIELD_DEFINITIONS] placeholder. After the model returns its classification, validate the output against a strict JSON schema that enforces the expected array of field objects with field_name, completion_status, confidence, and evidence keys. Reject any response that fails schema validation or contains fields not in the registry. For high-stakes workflows such as loan applications or medical intake forms, route any form where a required field is classified as empty or partial to a human review queue before allowing downstream processing. Log every classification result with the model's confidence score and the raw OCR text for auditability.

Model choice matters here. Use a model with strong instruction-following and JSON mode support, such as GPT-4o, Claude 3.5 Sonnet, or Gemini 1.5 Pro. Avoid smaller or older models that struggle with structured output consistency. Set temperature=0 to maximize deterministic behavior. If processing high-volume forms, consider batching multiple forms into a single prompt call with clear delimiters, but keep each batch under 8,000 tokens of input context to avoid attention dilution. Implement a retry loop with exponential backoff (1s, 2s, 4s) for schema validation failures, but cap retries at 3 attempts. After the third failure, escalate the form to a human review queue with the raw OCR output and the failed model responses attached. Do not silently accept unvalidated classifications—a misclassified required field can corrupt an entire database row downstream.

Testing this prompt requires a golden dataset of forms with known completion states. Build at least 50 test forms covering: fully completed forms, intentionally blank forms, forms with placeholder text in every field, forms with partial handwriting, and forms with checkmarks or stamps that OCR may misinterpret. For each form, define the ground-truth classification per field. Run the prompt against this dataset and measure precision and recall for each completion state, with particular attention to false negatives on empty fields (the most dangerous failure mode). Add adversarial test cases: forms where 'N/A' is written in a required field, forms with watermarks that OCR picks up as text, and forms where the field label is present but the value area is blank. If your pipeline processes scanned documents, include degraded scans with varying DPI (150, 200, 300) to ensure OCR quality doesn't silently degrade classification accuracy.

Common failure modes in production include: the model classifying a faintly filled field as empty because OCR confidence was low, the model treating a handwritten 'none' as a valid entry when the field registry marks it as placeholder text, and schema mismatches where the model returns extra fields not in the registry. Mitigate the first by passing OCR confidence scores into the prompt's [OCR_METADATA] section. Mitigate the second by maintaining an explicit deny-list of placeholder strings in the [CONSTRAINTS] block. Mitigate the third with strict post-response schema validation. If your use case involves regulated documents such as tax forms or healthcare intake, add a human-in-the-loop approval step for any form where more than 20% of required fields are classified as empty or partial. This threshold prevents batch processing errors while keeping manual review load manageable.

IMPLEMENTATION TABLE

Expected Output Contract

Schema contract for the Blank Form Field Detection Prompt. Each field in the output must conform to these types, requirements, and validation rules before downstream processing.

Field or ElementType or FormatRequiredValidation Rule

fields

Array of objects

Must be a non-empty array. If no fields are detected, return an empty array with a top-level warning flag set to true.

fields[].field_label

String

Must match a visible label or inferred label from the document. Cannot be null or empty string. If label is illegible, use '[ILLEGIBLE]' and set field_status to 'unreadable'.

fields[].field_type

Enum: text, checkbox, signature, date, dropdown, radio, other

Must be one of the listed enum values. Default to 'other' if type cannot be determined. Validation must reject unknown types.

fields[].field_status

Enum: filled, blank, partial, placeholder, unreadable, redacted

Must be one of the listed enum values. 'placeholder' applies when field contains instructional text (e.g., 'Enter name'). 'partial' applies when a multi-part field is incomplete.

fields[].value

String or null

Extracted value if field_status is 'filled' or 'partial'. Must be null if field_status is 'blank', 'unreadable', or 'redacted'. For 'placeholder' status, value should contain the placeholder text.

fields[].confidence

Number (0.0-1.0)

Confidence score for the field_status classification. Must be a float between 0 and 1 inclusive. Values below 0.6 should trigger a review flag in the calling application.

fields[].bounding_box

Object {x, y, width, height} or null

If provided, must contain numeric x, y, width, height properties. Null allowed when coordinates are unavailable. Used for visual verification overlays.

review_required

Boolean

Must be true if any field has confidence below 0.6, field_status is 'unreadable', or field_status is 'blank' but the field is marked as required in the input schema. Otherwise false.

PRACTICAL GUARDRAILS

Common Failure Modes

Blank form field detection fails silently in production when the model guesses, ignores context, or can't distinguish intentional blanks from missing data. These are the most common failure patterns and how to prevent them.

01

Hallucinated Field Completion

What to watch: The model fills empty fields with plausible but fabricated values instead of returning null or empty. This is most common when the prompt implies all fields should contain data or when few-shot examples never show empty fields. Guardrail: Include explicit empty-field examples in few-shot prompts and require a completion_status enum (filled, empty, placeholder, illegible) for every field. Validate that empty fields contain no extracted value before ingestion.

02

Placeholder Text Misclassified as Real Data

What to watch: Form fields containing placeholder text like 'N/A', 'TBD', 'xxx', 'See attached', or lorem ipsum are classified as filled. Downstream systems then treat placeholder strings as valid data. Guardrail: Maintain a deny-list of placeholder patterns and instruct the model to check against it. Add a placeholder_detected boolean field and test against a golden set of common placeholder strings across your document corpus.

03

Required vs. Optional Field Confusion

What to watch: The model cannot determine whether an empty field is intentionally optional or a required field that was overlooked. This causes false negatives on critical missing data and false positives on optional fields. Guardrail: Supply a field schema with a required: true/false flag per field. Instruct the model to return missing_required as a distinct status for required fields that are empty. Route missing_required results to a human review queue.

04

Multi-Page Field Continuation Breaks

What to watch: A field starts on one page and continues onto the next, but the model only processes the first page and marks the field as partially filled or empty. This is common with text areas, tables, and signature blocks that span page breaks. Guardrail: Pre-process documents to stitch continuation regions before field detection. Add a field_continues_next_page flag and validate that no field is marked empty when a continuation marker exists on the preceding page.

05

Checkbox and Radio Button Misdetection

What to watch: The model misreads checkboxes as filled when they contain stray marks, or misses checked boxes due to low contrast or unusual checkmark styles. This is especially dangerous for consent fields and selection options. Guardrail: Use a dedicated visual element detection step before text extraction for checkbox regions. Return a confidence score per checkbox and flag any result below 0.9 for human verification. Test against a dataset of varied checkbox styles and mark types.

06

Signature Block False Positives

What to watch: Typed names, digital certificate stamps, or header/footer text near signature blocks are classified as valid signatures. This causes executed-document false positives in workflows that gate on signature presence. Guardrail: Define explicit signature indicators (wet ink characteristics, digital signature metadata, notary stamps) and distinguish them from typed text. Return a signature_type enum (wet_ink, digital, typed_name_only, stamp, none) and route typed_name_only results for human confirmation.

IMPLEMENTATION TABLE

Evaluation Rubric

Use this rubric to test the Blank Form Field Detection Prompt before production deployment. Each criterion targets a known failure mode for form field completion status classification.

CriterionPass StandardFailure SignalTest Method

Empty Field Detection

All intentionally blank fields are classified as 'empty' with a reason of 'no_content'.

Blank field classified as 'filled' or 'unknown'.

Run prompt against a test form with 10 known-blank fields and assert all have status 'empty'.

Placeholder Text Discrimination

Fields containing only placeholder text like 'N/A', 'TBD', or 'See above' are classified as 'placeholder' not 'filled'.

Placeholder text field classified as 'filled' with extracted value.

Supply a form with 5 fields containing only placeholder strings and assert status is 'placeholder'.

Partial Fill Detection

Fields with incomplete entries (e.g., only first name in a full name field) are classified as 'partial' with a note describing what is missing.

Partial field classified as 'filled' or 'empty' without qualification.

Use a form with 3 partially completed fields and assert status is 'partial' with a non-null 'missing_parts' note.

Required vs. Optional Context

When [REQUIRED_FIELDS] list is supplied, any empty required field includes a flag 'required_missing: true'.

Empty required field lacks the 'required_missing' flag or an optional empty field incorrectly receives it.

Provide a [REQUIRED_FIELDS] list of 4 fields, leave 2 required and 2 optional fields empty, and assert flag accuracy.

Handwriting and Faint Mark Detection

Light marks, checkmarks, or handwriting in a field are classified as 'filled' with confidence score, not ignored as 'empty'.

Visibly marked checkbox or handwritten entry classified as 'empty'.

Use a scanned form with 3 lightly marked checkboxes and assert status is 'filled' with confidence > 0.5.

Output Schema Compliance

Every field object in the output contains exactly the keys: field_label, status, extracted_value, confidence, reason, and required_missing.

Output is missing a required key, contains extra keys, or uses incorrect types.

Validate the JSON output against the [OUTPUT_SCHEMA] using a schema validator and assert zero schema violations.

Multi-Page Field Continuity

A field that spans or repeats across pages is reported once with a note indicating multi-page presence, not duplicated.

Same logical field reported multiple times with conflicting statuses across pages.

Feed a 3-page form where 'Client Name' appears on each page and assert exactly one entry for 'Client Name' in the output.

Confidence Score Calibration

Confidence scores for 'empty' fields are >= 0.9; scores for ambiguous or degraded fields are < 0.8.

Ambiguous field assigned confidence 0.99 or clearly empty field assigned confidence 0.4.

Run against a ground-truth set of 20 fields with known statuses and assert mean confidence for correct classifications > 0.85.

ADAPTATION OPTIONS

Adapt This Prompt

How to adapt

Start with the base prompt and a flat list of expected fields. Use a simple JSON schema with status (filled/empty/partial/placeholder) and value per field. Skip confidence scoring and evidence bounding boxes. Run against 10–20 sample forms to calibrate field-name matching.

code
Analyze this form image and return JSON:
{
  "fields": [
    {
      "field_name": "[FIELD_NAME]",
      "status": "filled | empty | partial | placeholder",
      "value": "[EXTRACTED_VALUE_OR_NULL]"
    }
  ]
}

Watch for

  • Field-name mismatches when the form label differs from your expected field list
  • Placeholder text classified as filled (e.g., 'First Name' in a name field)
  • Checkboxes reported as empty when checked with a faint mark
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.