Inferensys

Prompt

Required Field Presence Check Prompt

A practical prompt playbook for using Required Field Presence Check Prompt in production AI workflows.
Developer doing prompt engineering on laptop, prompt variations visible on screen, casual coding session.
PROMPT PLAYBOOK

When to Use This Prompt

Defines the job, ideal user, and constraints for the Required Field Presence Check Prompt.

This prompt is for integration engineers and agent harness developers who need a deterministic, auditable gate before an agent step executes. Its job is to validate that every mandatory input field is present, non-null, and well-formed according to a provided schema. Use it when the cost of a downstream failure—such as a corrupted database write, a malformed API call, or a silent null propagation—is higher than the latency cost of an upfront check. The primary reader is a developer wiring this prompt into a pre-execution hook within an agent loop, a data pipeline validator, or a form submission handler.

Do not use this prompt when the input schema is ambiguous, when field optionality depends on complex business logic better handled in application code, or when the model's probabilistic nature introduces unacceptable risk for strict boolean pass/fail decisions. This prompt is not a substitute for JSON Schema validation in your application layer; it is a semantic complement that can reason about placeholder values like 'TBD' or 'N/A' that a structural validator might miss. For high-risk domains such as finance or healthcare, always pair the model's completeness checklist with a deterministic schema validator and log any disagreement for human review.

The prompt expects a structured [INPUT_PAYLOAD] and a [FIELD_DEFINITIONS] schema that declares each field's name, type, required status, and any format constraints. It produces a completeness checklist with explicit pass/fail per field and remediation suggestions for missing data. Before integrating, define your bail-out behavior: the harness should parse the model's output, check for any status: "fail" entries, and either block execution with a structured error response or route to a human for manual completion. The next section provides the copy-ready template.

PRACTICAL GUARDRAILS

Use Case Fit

Where the Required Field Presence Check prompt delivers value and where it introduces risk. Use these cards to decide if this prompt belongs in your agent's pre-execution harness.

01

Good Fit: Pre-Flight Validation in Agent Pipelines

Use when: An agent step depends on structured input from a user, API, or previous step. The prompt acts as a deterministic gate, producing a pass/fail checklist before expensive or irreversible actions. Guardrail: Wire the output into a harness that bails out early on failure, returning a structured error to the orchestrator instead of proceeding with missing data.

02

Bad Fit: Ambiguous or Free-Text Validation

Avoid when: The definition of 'required' is subjective or the input is unstructured prose. The model will hallucinate completeness criteria or flag valid creative input as missing. Guardrail: Use this prompt only when you can provide an explicit, machine-readable schema of required fields. For fuzzy checks, use a classification router instead.

03

Required Inputs: A Strict Field Schema

Risk: Without a concrete list of required fields, the model invents its own criteria, leading to inconsistent validation. Guardrail: Always pass a [REQUIRED_FIELDS] array with field names, expected types, and nullability rules. The prompt template must treat this as the single source of truth for completeness.

04

Operational Risk: Silent False-Positives

Risk: The model may mark a field as 'present' when the value is a placeholder, an empty string, or a default that the user never intended. This allows bad data to pass the gate. Guardrail: Add a [VALUE_QUALITY_RULES] section to the prompt that defines what 'present' means (e.g., non-empty, matches regex, not a known default).

05

Operational Risk: Hallucinated Remediation

Risk: When a field is missing, the model may suggest a fabricated or insecure default value as a 'remediation.' This is dangerous for credentials, identifiers, or financial data. Guardrail: Constrain the output schema so remediation is a structured suggestion type (e.g., 'ASK_USER', 'USE_DEFAULT', 'ABORT'), never a raw generated value.

06

Harness Integration: Early Bail-Out Logic

Risk: The prompt produces a correct JSON report, but the calling code ignores the overall_status: fail field and proceeds anyway. Guardrail: The application harness must parse the output and enforce a hard stop on failure. Log the full report and transition the workflow to a waiting_for_input or failed state.

PROMPT PLAYBOOK

Copy-Ready Prompt Template

A reusable prompt template for validating that all mandatory inputs exist before an agent step executes, producing a structured completeness checklist.

This template is designed to be dropped into a pre-execution validation harness. It forces the model to act as a strict schema validator, not a conversational assistant. The prompt accepts a list of required fields and the actual input payload, then produces a deterministic pass/fail report per field. Use this when the cost of executing a step with missing data is higher than the cost of an upfront check—common in database writes, API calls with side effects, and regulated workflows where partial execution creates audit complexity.

text
You are a strict input validation engine. Your only job is to check whether all required fields are present in the provided input payload. Do not infer, guess, or fill in missing values. Do not execute any downstream task. Do not produce conversational text outside the output schema.

[CONTEXT]

REQUIRED FIELDS:
[REQUIRED_FIELDS]

INPUT PAYLOAD:
[INPUT_PAYLOAD]

[OUTPUT_SCHEMA]

[CONSTRAINTS]

[EXAMPLES]

[RISK_LEVEL]

How to adapt this template: Replace [REQUIRED_FIELDS] with a structured list of field names, their expected types, and whether null values are acceptable. [INPUT_PAYLOAD] should be the raw JSON or structured data your agent step is about to consume. The [OUTPUT_SCHEMA] placeholder should contain a strict JSON schema for the validation report—typically an array of objects with field, status (PASS/FAIL), received_value, and remediation keys. [CONSTRAINTS] is where you add domain-specific rules: date ranges, enum values, regex patterns, cross-field dependencies, or conditional requirements. [EXAMPLES] should include at least one passing and one failing payload to anchor the model's behavior. [RISK_LEVEL] controls the strictness: at HIGH, treat any ambiguity as FAIL; at LOW, flag but don't block. After copying, test the prompt against edge cases including empty payloads, extra fields, type mismatches, and deeply nested missing keys before wiring it into your agent harness.

IMPLEMENTATION TABLE

Prompt Variables

Placeholders required by the Required Field Presence Check prompt. Each variable must be supplied by the calling harness before the prompt is assembled and sent.

PlaceholderPurposeExampleValidation Notes

[FIELD_DEFINITIONS]

Schema or list of required fields with types and constraints

["email": "string, non-null", "amount": "float, >0"]

Must be parseable as a list of field-name/constraint pairs. Reject if empty or unparseable.

[INPUT_PAYLOAD]

The actual data record to validate

Must be valid JSON. Reject if not parseable. Null payload triggers early bail-out.

[CONTEXT]

Optional business context about why these fields are required

"Payment processing requires email and positive amount"

Null allowed. If provided, must be a non-empty string under 500 chars.

[OUTPUT_SCHEMA]

Expected structure for the validation report

{"field": "string", "status": "pass|fail", "reason": "string"}

Must be a valid JSON Schema or example object. Reject if missing.

[CONSTRAINTS]

Additional validation rules beyond field presence

"amount must be positive; email must match RFC 5322"

Null allowed. If provided, rules must be expressed as discrete, evaluable statements.

[REMEDIATION_HINTS]

Whether to include fix suggestions for failed fields

Must be boolean. Defaults to false if omitted. Controls output verbosity.

[STRICT_MODE]

Whether unknown fields in payload should be flagged

Must be boolean. Defaults to true. When true, extra keys produce warnings.

PROMPT PLAYBOOK

Implementation Harness Notes

How to wire the Required Field Presence Check prompt into an agent pre-execution harness with validation, structured error responses, and early bail-out logic.

The Required Field Presence Check prompt is designed to sit at the boundary of an agent step, acting as a precondition gate before any downstream logic, tool calls, or model reasoning consumes the input payload. In a production harness, this prompt should be invoked immediately after the input payload is assembled and before it is passed to the main task prompt. The harness is responsible for constructing the prompt with the expected field schema and the actual input payload, then parsing the structured pass/fail output to decide whether to proceed, bail out, or request remediation. This is not a prompt that runs in isolation; it is a control point in a larger workflow.

To wire this into an application, define a FieldSchema object that lists each required field name, its expected type, and an optional description. Serialize this schema into the [REQUIRED_FIELDS] placeholder as a structured list. The [INPUT_PAYLOAD] placeholder receives the actual data the agent intends to process. After invoking the model, parse the output against a strict JSON schema that expects a fields array, each with field_name, present (boolean), value_type (string or null), and remediation (string or null). A top-level all_present boolean provides the quick bail-out signal. If all_present is false, the harness should return a structured error response to the caller or trigger a remediation workflow, never proceeding to the main agent step with missing required fields. Log the full check result for observability, including which fields failed and the model's suggested remediation.

For high-reliability systems, add a validation layer after the model response. Confirm that every field in [REQUIRED_FIELDS] appears in the output fields array. If the model omits a field, treat it as a failure and re-prompt or escalate. Set a low temperature (0.0–0.2) to maximize deterministic pass/fail judgments. For latency-sensitive paths, consider caching the schema-to-prompt template so only the input payload changes per invocation. If the input payload contains sensitive data, apply redaction before passing it to the model, or use a local model deployment to keep data in-boundary. The harness should also enforce a timeout and a retry budget: if the model fails to return valid JSON after two retries, bail out with a PRECONDITION_CHECK_FAILED error rather than silently proceeding.

When integrating this into an agent framework, place the check inside a pre_execute hook or middleware that wraps every tool call or step. The harness should distinguish between 'field missing' (bail out) and 'check failed' (retry or escalate). Do not use this prompt for semantic validation such as email format correctness or business rule conformance; that belongs to a separate Input Data Schema Validation Prompt downstream. The sole responsibility here is presence detection. Avoid the temptation to combine presence checking with type validation in one prompt, as that increases output complexity and makes failure attribution harder during debugging. Keep the contract narrow and the harness behavior predictable.

IMPLEMENTATION TABLE

Expected Output Contract

Define the exact shape of the completeness checklist returned by the Required Field Presence Check Prompt. Each row specifies a field, its type, whether it must be present, and the actionable validation rule to apply in the application harness before proceeding.

Field or ElementType or FormatRequiredValidation Rule

checklist

Array of objects

Schema check: must be a non-empty array. If empty, treat as a system error and retry.

checklist[].field_name

String

Schema check: must be a non-null string. Parse check: must exactly match one of the [INPUT_FIELDS] provided.

checklist[].status

Enum: 'present' | 'missing' | 'empty'

Schema check: must be one of the three allowed enum values. No other statuses permitted.

checklist[].current_value

String or null

Null allowed: only when status is 'missing'. Otherwise, must be a string representation of the value found.

checklist[].remediation

String or null

Null allowed: only when status is 'present'. Otherwise, must be a non-empty string suggesting how to obtain the missing data.

overall_status

Enum: 'ready' | 'incomplete'

Schema check: must be 'ready' if all items have status 'present', else must be 'incomplete'. Harness should bail out if 'incomplete'.

missing_count

Integer

Parse check: must be a non-negative integer. Validation check: must equal the count of checklist items where status is not 'present'.

PRACTICAL GUARDRAILS

Common Failure Modes

When validating required fields before an agent step, these failures surface first in production. Each card pairs a common breakage with a concrete guardrail you can implement in your harness.

01

Silent Null Acceptance

What to watch: The prompt treats empty strings, whitespace-only values, or JSON null as valid present fields. The agent proceeds with garbage data and fails downstream with a cryptic error. Guardrail: Explicitly enumerate invalid representations in the prompt (e.g., null, "", " ", undefined) and require the model to flag them as MISSING with a reason code.

02

Schema Drift Between Check and Execution

What to watch: The field presence check validates against a stale schema. New required fields were added to the downstream API but the prompt template wasn't updated. The check passes, but the agent step fails. Guardrail: Version your field requirement schemas alongside the prompt. Add a schema_version field to the output and fail closed if the version doesn't match the expected deployment tag.

03

Overly Permissive Pass Criteria

What to watch: The model marks fields as PRESENT when they contain placeholder values like "TBD", "N/A", or default timestamps that aren't real data. Guardrail: Include a blocklist of known placeholder patterns in the prompt constraints. Require the model to explain why a value is considered valid, not just assert presence. Log all PASS decisions with the extracted value for audit.

04

Nested Field Blindness

What to watch: The prompt checks top-level keys but ignores required fields nested inside objects or arrays. A payload like {"user": {}} passes the check even though user.email is required and missing. Guardrail: Flatten the required field specification to dot-notation paths (e.g., user.email, items[].sku) and instruct the model to traverse every path. Validate output coverage against the full path list in harness code.

05

Remediation Hallucination

What to watch: For missing fields, the model invents plausible default values or suggests remediation steps that don't match your system's actual capabilities (e.g., "auto-generate an ID" when no generator exists). Guardrail: Constrain remediation suggestions to a pre-approved list of actions (e.g., PROMPT_USER, ABORT, USE_DEFAULT_X). Reject any output containing unlisted remediation actions in post-processing.

06

Bail-Out Logic Bypass

What to watch: The prompt correctly identifies missing fields but the harness code ignores the FAIL status and proceeds with execution anyway due to a missing early-return guard. Guardrail: Implement a hard gate in the harness that checks the overall_status field before any downstream call. If overall_status is not explicitly PASS, throw a PreconditionFailedError and log the full completeness report. Unit test the bail-out path with a known-FAIL response.

IMPLEMENTATION TABLE

Evaluation Rubric

Use this rubric to evaluate the output of the Required Field Presence Check Prompt before integrating it into an agent harness. Each criterion targets a specific failure mode common in precondition validation workflows.

CriterionPass StandardFailure SignalTest Method

Field Completeness

Every field from [REQUIRED_FIELDS] appears in the output with an explicit pass or fail status

Output omits one or more required fields or uses ambiguous status labels like 'maybe' or 'unclear'

Parse output JSON and compare field list against the input [REQUIRED_FIELDS] array; assert set equality

Pass/Fail Accuracy

Fields present in [INPUT_PAYLOAD] are marked pass; missing or null fields are marked fail

A field with a non-null, non-empty value is marked fail, or a genuinely missing field is marked pass

Run against a golden payload with known present and absent fields; assert status matches ground truth for each field

Remediation Guidance

Every failed field includes a concrete remediation suggestion referencing where or how to obtain the missing data

Failed fields lack remediation text, or suggestions are generic and not actionable for the specific field

Check that remediation field is non-empty for all fail entries and contains a field-specific action verb

Early Bail-Out Signal

Output includes a top-level go/no-go boolean that is false when any required field is missing

go/no-go is true despite one or more fail entries, or the field is absent from the output entirely

Assert output.go == false when any field status is fail; assert output.go == true when all fields pass

Structured Error Response

Output conforms to [OUTPUT_SCHEMA] with all required keys present and correctly typed

Output is valid JSON but missing required keys, or field types do not match schema expectations

Validate output against [OUTPUT_SCHEMA] using a JSON schema validator; reject on schema violation

Null vs Empty Handling

Null values and empty strings are both treated as missing and marked fail, with distinct remediation for each case

Empty strings are incorrectly marked pass, or null and empty are conflated without distinction in remediation

Test with payloads containing null fields and empty string fields separately; verify both fail and have different remediation text

Nested Field Awareness

Required fields specified with dot-notation paths are correctly located in nested payloads and evaluated

Nested field paths are ignored, treated as top-level keys, or always reported as missing

Provide a payload with nested objects; assert that nested.path.field is correctly resolved and evaluated

Harness Integration Readiness

Output is parseable in a single pass without post-processing; all values are deterministic given the same inputs

Output requires string manipulation to extract values, or produces non-deterministic keys across identical runs

Parse output programmatically in a test harness; assert stable key names and no extra commentary outside the JSON structure

ADAPTATION OPTIONS

Adapt This Prompt

How to adapt

Use the base prompt with a simplified output schema. Drop the remediation field and return only field, status, and reason. Run against a small set of known-good and known-bad payloads to calibrate detection sensitivity.

code
[INPUT_SCHEMA]: { "required": ["email", "amount"] }
[INPUT_PAYLOAD]: { "email": "user@test.com" }
[OUTPUT_SCHEMA]: { "fields": [{ "field": "string", "status": "present|missing", "reason": "string" }] }

Watch for

  • False negatives when fields are present but empty strings or null
  • Overly strict interpretation of required that flags optional fields
  • Model inventing field names not in the schema
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.