Inferensys

Prompt

Checkpoint Integrity Verification Prompt

A practical prompt playbook for using the Checkpoint Integrity Verification Prompt in production AI workflows to cryptographically and logically verify agent state before resumption.
Developer reviewing multi-agent chat interface on laptop, agent conversation logs visible, casual coding session at WeWork desk.
PROMPT PLAYBOOK

When to Use This Prompt

Defines the exact conditions, user, and system context where the Checkpoint Integrity Verification Prompt adds value, and when it should be avoided.

This prompt is built for agent runtime developers and operators who must verify that a saved checkpoint has not been corrupted or tampered with before resuming execution. The core job-to-be-done is automated integrity gating: you have a serialized agent state stored on disk, in a database, or in an object store, and you need a machine-verifiable guarantee that the state is safe to load back into an active agent loop. The ideal user is an engineer integrating this verification step into a checkpoint loader, a state hydration pipeline, or a pre-resumption validation hook. Required context includes the raw checkpoint payload, an optional cryptographic hash for tamper detection, and a formal schema definition that describes the expected shape of valid state. Without all three, the prompt cannot produce a trustworthy integrity report.

Use this prompt when your system must prevent silent state corruption from propagating into live agent execution. Common triggers include: resuming a long-running workflow after a deployment, reloading state after a model switch, recovering from a storage layer failure, or rehydrating a checkpoint that passed through an untrusted serialization boundary. The prompt is designed to catch three classes of problems: hash mismatches indicating tampering or bit rot, schema violations where required fields are missing or types are wrong, and logical inconsistencies such as a completed step count exceeding the total planned steps. In high-risk environments, pair this prompt's output with a hard gate in your application code—if the integrity report flags any CRITICAL or HIGH severity issues, the system should refuse to load the checkpoint and escalate for human review rather than attempting automatic repair.

Do not use this prompt for creating checkpoints, deciding when to save them, or compressing state for token budget reasons. Those workflows belong to the Agent State Snapshot Prompt Template, Checkpoint Frequency Decision Prompt, or Checkpoint Compression for Token Budget Prompt respectively. Also avoid using this prompt as a substitute for cryptographic verification at the storage layer—the optional hash check here is a defense-in-depth measure, not a replacement for signed payloads or authenticated storage. Finally, this prompt is not designed for reconstructing corrupted state; if integrity checks fail, use the Agent Context Reconstruction Prompt After Failure to rebuild state from logs and partial evidence rather than attempting to repair the damaged checkpoint directly.

PRACTICAL GUARDRAILS

Use Case Fit

Where the Checkpoint Integrity Verification Prompt works and where it introduces risk. Use these cards to decide whether this prompt fits your agent architecture before wiring it into a production checkpoint-resume pipeline.

01

Good Fit: Cryptographic Integrity Gates

Use when: your agent runtime must verify that a checkpoint file hasn't been corrupted or tampered with before resuming execution. Guardrail: pair this prompt with a deterministic hash comparison step in application code; the prompt should explain discrepancies, not be the sole arbiter of integrity.

02

Bad Fit: Real-Time Streaming State

Avoid when: agent state is updated continuously in a streaming or event-sourced architecture where checkpoints are written incrementally. Risk: the prompt assumes a stable, complete snapshot and will produce false-positive corruption flags on partially written state. Guardrail: flush and seal checkpoints before verification.

03

Required Inputs: Checkpoint Payload and Schema

What to watch: the prompt needs the raw checkpoint payload, the expected schema definition, and any stored integrity hashes. Risk: missing schema context causes the model to hallucinate expected fields or accept malformed data. Guardrail: always pass the canonical schema as a structured [EXPECTED_SCHEMA] input, not as a natural-language description.

04

Operational Risk: False-Positive Integrity Passes

What to watch: the model may report a checkpoint as valid when subtle corruption exists, especially for semantic inconsistencies that pass structural checks. Risk: a corrupted plan step or tool output propagates into downstream execution. Guardrail: implement a layered verification pipeline—hash check in code, schema validation in code, then use the prompt only for logical consistency and explainability.

05

Operational Risk: Corruption Detection Sensitivity

What to watch: the prompt's sensitivity to corruption depends heavily on how [CONSTRAINTS] and [INTEGRITY_RULES] are phrased. Risk: overly permissive rules cause missed corruption; overly strict rules flag benign format differences as integrity failures. Guardrail: calibrate sensitivity with a golden test set of known-valid and known-corrupted checkpoints before production use.

06

Architecture Fit: Pre-Resume Gate Only

What to watch: this prompt is designed as a synchronous verification gate before resumption, not as a background audit or continuous monitor. Risk: using it asynchronously or on active state creates race conditions where verification results are stale by the time they're read. Guardrail: place this prompt inside the resume lock acquisition path so no execution proceeds until verification completes.

PROMPT PLAYBOOK

Copy-Ready Prompt Template

A production-ready prompt for verifying checkpoint integrity before resuming agent execution.

This template provides a complete prompt for verifying that a saved agent checkpoint has not been corrupted, tampered with, or logically invalidated before resuming execution. The prompt performs three verification layers: cryptographic hash validation, schema compliance checking, and logical consistency analysis. Use this when your agent runtime must confirm checkpoint integrity after storage, transfer, model switches, or recovery from interruption. Do not use this prompt for lightweight workflows where the cost of replaying a few steps is lower than the verification overhead, or when checkpoints are stored in tamper-proof systems with built-in integrity guarantees.

text
You are a checkpoint integrity verification system. Your job is to validate that an agent checkpoint is complete, uncorrupted, and logically consistent before execution resumes. You must produce a structured integrity report with pass/fail status for each verification layer and specific remediation guidance for any failures.

## INPUT

[CHECKPOINT_DATA]

## VERIFICATION LAYERS

### Layer 1: Cryptographic Integrity
- If a [EXPECTED_HASH] is provided, compute the hash of [CHECKPOINT_DATA] using [HASH_ALGORITHM] and compare.
- If no hash is provided, skip this layer and note that cryptographic verification was not performed.
- Report: hash_match (boolean), computed_hash (string), expected_hash (string if provided).

### Layer 2: Schema Compliance
- Validate that [CHECKPOINT_DATA] contains all required fields per [CHECKPOINT_SCHEMA]:
  - Required top-level fields: checkpoint_id, timestamp, agent_id, plan_state, completed_steps, pending_steps, tool_outputs, context_summary
  - Each completed_step must have: step_id, action, status, output, timestamp
  - Each pending_step must have: step_id, action, dependencies, priority
  - tool_outputs must be a valid array of {tool_name, call_id, output, timestamp} objects
- Report: schema_valid (boolean), missing_fields (array), type_mismatches (array).

### Layer 3: Logical Consistency
- Verify that completed_steps and pending_steps are consistent with plan_state.
- Check that no step appears in both completed_steps and pending_steps.
- Verify that all dependency references in pending_steps resolve to existing step_ids in completed_steps or pending_steps.
- Check that timestamps are monotonically increasing where expected.
- Verify that tool_outputs reference valid tool calls from completed_steps.
- Flag any orphaned references, circular dependencies, or contradictory state.
- Report: logically_consistent (boolean), inconsistencies (array of {type, description, location}).

## OUTPUT FORMAT

Return a JSON object with this exact structure:
{
  "integrity_report": {
    "checkpoint_id": "string",
    "verification_timestamp": "ISO8601",
    "overall_status": "PASS" | "FAIL" | "PARTIAL",
    "cryptographic_verification": {
      "performed": boolean,
      "hash_match": boolean | null,
      "computed_hash": "string",
      "expected_hash": "string | null",
      "algorithm": "string"
    },
    "schema_verification": {
      "schema_valid": boolean,
      "missing_fields": ["string"],
      "type_mismatches": [{"field": "string", "expected": "string", "actual": "string"}]
    },
    "logical_verification": {
      "logically_consistent": boolean,
      "inconsistencies": [{"type": "string", "description": "string", "location": "string"}]
    },
    "remediation": {
      "resumable": boolean,
      "blocking_issues": ["string"],
      "warnings": ["string"],
      "recommended_actions": ["string"]
    }
  }
}

## CONSTRAINTS

- Do not modify or repair the checkpoint data. Only report findings.
- If cryptographic verification fails, set overall_status to FAIL regardless of other layers.
- If schema verification fails with missing required fields, set overall_status to FAIL.
- If only logical inconsistencies are found with no missing data, set overall_status to PARTIAL and flag specific inconsistencies.
- For any FAIL or PARTIAL status, provide specific, actionable remediation steps.
- If [RISK_LEVEL] is "HIGH", require explicit human approval before marking resumable as true.
- Flag any timestamp anomalies that could indicate tampering or clock skew.
- If tool_outputs reference tools not in [AVAILABLE_TOOLS], flag as a compatibility warning.

Adaptation guidance: Replace [CHECKPOINT_DATA] with the serialized checkpoint payload. Provide [EXPECTED_HASH] and [HASH_ALGORITHM] if your system stores cryptographic hashes alongside checkpoints; otherwise the verification layer will self-skip. Define [CHECKPOINT_SCHEMA] to match your actual checkpoint structure—the schema shown is a starting point. Set [RISK_LEVEL] to "HIGH" for production financial, healthcare, or safety-critical workflows to enforce human approval gates. Add [AVAILABLE_TOOLS] as a list of valid tool names to detect tool compatibility issues after model switches. Critical: Always validate the output JSON against the expected schema before acting on the integrity report. A malformed report should be treated as a verification failure and trigger a retry or escalation.

Next steps after verification: If the report returns overall_status: PASS, proceed with resumption using the validated checkpoint. If PARTIAL, review the specific inconsistencies and decide whether to resume with warnings or request a reconstructed checkpoint. If FAIL, do not resume—trigger your checkpoint reconstruction or replay workflow instead. Wire this prompt into your agent runtime's pre-resumption hook so no checkpoint is loaded without verification. For high-risk domains, route all non-PASS reports to a human review queue before any automated resumption decision.

IMPLEMENTATION TABLE

Prompt Variables

Required inputs for the Checkpoint Integrity Verification Prompt. Each placeholder must be populated before the prompt is sent. Validation notes describe how to confirm the input is well-formed before execution.

PlaceholderPurposeExampleValidation Notes

[CHECKPOINT_PAYLOAD]

The full checkpoint data to verify, including state snapshot, plan progress, tool outputs, and metadata

{"checkpoint_id": "ckpt-0042", "timestamp": "2025-01-15T14:30:00Z", "agent_state": {...}, "completed_steps": [...], "pending_actions": [...]}

Must be valid JSON. Parse check before prompt assembly. Reject if payload exceeds 100KB or contains unescaped control characters. Schema validation against expected checkpoint structure required.

[CHECKPOINT_HASH]

Cryptographic hash of the checkpoint payload for tamper detection

sha256:a1b2c3d4e5f6...

Must match regex ^(sha256|sha512|blake2b):[a-f0-9]{64,128}$. Verify hash algorithm is from allowed list. Reject if hash is missing or truncated.

[EXPECTED_SCHEMA_VERSION]

Schema version the checkpoint should conform to

2.1.0

Must match semver pattern. Compare against supported schema versions list. Reject if version is deprecated or unsupported by current verification logic.

[AGENT_IDENTITY]

Identifier for the agent that produced the checkpoint, used for provenance verification

agent-invoice-processor-prod-03

Must be non-empty string matching agent naming convention. Check against known agent registry if available. Null allowed only if provenance check is explicitly disabled.

[PREVIOUS_CHECKPOINT_HASH]

Hash of the immediately preceding checkpoint for chain-of-custody verification

sha256:9f8e7d6c5b4a...

Null allowed for initial checkpoints. If provided, must match hash format rules. Chain validation requires this to be the hash of the last verified checkpoint, not an arbitrary predecessor.

[TOOL_CAPABILITY_MANIFEST]

Declared tool schemas and versions available when checkpoint was created

{"tools": [{"name": "file_write", "version": "1.2.0"}, {"name": "db_query", "version": "3.0.1"}]}

Must be valid JSON with tools array. Each tool entry requires name and version. Compare against current tool manifest to detect version drift. Reject if manifest is empty when checkpoint contains tool outputs.

[VERIFICATION_POLICY]

Policy rules defining which checks are required, optional, or skipped for this verification run

{"required_checks": ["hash", "schema", "chain"], "optional_checks": ["tool_compat"], "skip_checks": ["full_state_replay"]}

Must be valid JSON with required_checks array. Every entry in required_checks must map to a known verification function. Reject if required_checks is empty or contains unknown check names. Policy must be explicitly set; no implicit defaults.

[ENVIRONMENT_CONTEXT]

Runtime environment details at checkpoint creation, used for environmental consistency checks

{"model": "claude-sonnet-4-20250514", "region": "us-east-1", "session_id": "sess-8a7b6c"}

Must be valid JSON. Model field required. Compare model against current runtime to flag model-switch scenarios. Null allowed only if environmental consistency check is in skip_checks policy.

PROMPT PLAYBOOK

Implementation Harness Notes

How to wire the Checkpoint Integrity Verification Prompt into an agent runtime or verification pipeline.

The Checkpoint Integrity Verification Prompt is not a standalone utility; it is a gate that must be integrated into the agent's state-loading lifecycle. Before any agent resumes execution from a saved checkpoint, the runtime should call this prompt with the raw checkpoint data, the expected schema, and any stored cryptographic hashes. The prompt's output—a structured integrity report—should be parsed programmatically. If the report's integrity_pass field is false, the runtime must block resumption and fall back to the last known-good checkpoint or escalate for human review. This prevents silent corruption from propagating into downstream agent actions.

To implement this, wrap the prompt call in a validation harness that performs three checks before the agent runtime ever sees the checkpoint. First, verify that the model's output conforms to the expected integrity report schema using a strict JSON validator. If the model fails to produce valid JSON, retry once with a simplified schema and a stronger constraint instruction. Second, independently recompute any provided hashes (e.g., SHA-256 of the serialized state) and compare them against the hash_match field in the report. Do not trust the model's hash comparison alone; the harness must perform its own cryptographic verification. Third, log the full integrity report, the raw checkpoint, and the model's raw response to an append-only audit store. This log is essential for debugging false positives, diagnosing corruption sources, and providing evidence for governance reviews.

Model choice matters here. Use a model with strong instruction-following and structured output capabilities, such as Claude 3.5 Sonnet or GPT-4o, with response_format set to json_object and the integrity report schema provided as the JSON Schema. Set temperature to 0 to minimize variance in verification logic. For high-security environments where the checkpoint contains sensitive data, run this prompt in a local or private deployment; never send raw checkpoint state to an external API without redacting PII and secrets first. If the checkpoint is too large for a single context window, pre-process it by extracting only the schema-defined fields required for verification and computing hashes externally before calling the prompt. The prompt should receive a digest of the state, not necessarily the full payload.

Common failure modes in the harness include: the model hallucinating a passing result when corruption exists (false negative), the model flagging a valid checkpoint due to schema misunderstanding (false positive), and the harness itself failing to parse the model's output. Mitigate false negatives by combining model-based verification with deterministic schema and hash checks in the harness. Mitigate false positives by maintaining a regression suite of known-valid checkpoints and running this prompt against them on every prompt or model version change. If the harness cannot parse the output after one retry, treat it as an integrity failure and block resumption. Never default to allowing resumption when the verification pipeline itself is uncertain.

IMPLEMENTATION TABLE

Expected Output Contract

Fields, format, and validation rules for the integrity report produced by the Checkpoint Integrity Verification Prompt. Use this contract to build a parser and validator before deploying the prompt into an agent runtime.

Field or ElementType or FormatRequiredValidation Rule

integrity_report.overall_status

enum: valid | invalid | inconclusive

Must be exactly one of the three allowed values. If any check fails, status must be invalid. If hash is missing but schema passes, status must be inconclusive.

integrity_report.checksum_verification.algorithm

string

Must match the algorithm declared in [EXPECTED_HASH_ALGORITHM]. Accept only sha256, sha512, or blake2b. Reject unknown algorithms.

integrity_report.checksum_verification.computed_hash

string (hex)

Must be a lowercase hex string matching the output length of the declared algorithm. Null or empty string is not allowed when [CHECKPOINT_DATA] is present.

integrity_report.checksum_verification.match

boolean

Must be true if computed_hash equals [EXPECTED_HASH], false otherwise. If [EXPECTED_HASH] is not provided, this field must be null and overall_status must be inconclusive.

integrity_report.schema_compliance.schema_version

string

Must exactly match [EXPECTED_SCHEMA_VERSION]. If the checkpoint schema has no version field, this must be set to 'unknown' and schema_compliance.status must be 'incomplete'.

integrity_report.schema_compliance.status

enum: compliant | non_compliant | incomplete

Must be compliant only if all required fields in [EXPECTED_SCHEMA] are present and types match. Missing optional fields is allowed. Unknown extra fields must be flagged as non_compliant.

integrity_report.logical_consistency.plan_step_continuity

enum: consistent | gap_detected | not_applicable

Must be gap_detected if completed_step_index + 1 does not equal the first pending step index. Set to not_applicable only when [CHECKPOINT_DATA] contains no plan steps.

integrity_report.logical_consistency.tool_output_references

enum: valid | dangling_reference | not_applicable

Must be dangling_reference if any completed step references a tool_output_id not present in the checkpoint. Set to not_applicable when no tool outputs exist.

PRACTICAL GUARDRAILS

Common Failure Modes

Checkpoint integrity verification fails silently in production when models accept corrupted state, skip validation steps, or report false positives. These cards cover the most common failure patterns and how to guard against them.

01

Hash Verification Bypass

What to watch: The model reports integrity as 'passed' without actually comparing hash values, especially when the checkpoint payload is large or the hash is presented as a separate field the model ignores. Guardrail: Require the model to output the computed hash, the expected hash, and an explicit match/mismatch boolean in structured output. Validate that all three fields are present and consistent before trusting the pass/fail result.

02

Schema Drift False Pass

What to watch: The model validates against an outdated or implicit schema rather than the current expected schema, causing structurally invalid checkpoints to pass verification. Guardrail: Always inject the current schema definition into the prompt as a required reference. Require the model to list each schema field it checked and whether it was present, valid, and within constraints. Reject reports that don't enumerate fields explicitly.

03

Logical Inconsistency Blindness

What to watch: The model verifies individual fields but misses cross-field contradictions—such as a completed step count exceeding total planned steps, or a timestamp that predates the previous checkpoint. Guardrail: Include explicit cross-field validation rules in the prompt. Require the model to run pairwise consistency checks and report any contradictions as a separate section in the integrity report. Flag reports with zero contradictions when known invariants exist.

04

Truncated Payload Acceptance

What to watch: When context windows overflow or payloads are truncated before reaching the model, the model verifies only the visible portion and reports integrity as passing, missing critical state that was cut off. Guardrail: Include a payload length marker or end-of-checkpoint sentinel in the checkpoint format. Require the model to confirm the sentinel is present and the declared length matches the received content before beginning verification. Fail closed if the sentinel is missing.

05

Corruption Detection Sensitivity Gap

What to watch: The model detects obvious corruption like missing fields but misses subtle tampering such as swapped values, off-by-one counters, or reordered steps that preserve surface validity. Guardrail: Include adversarial test cases in your eval suite with subtle corruptions designed to evade naive checks. Require the model to compare current checkpoint values against expected ranges and prior checkpoint baselines, not just structural validity. Track false-negative rate on subtle corruption cases.

06

Tool Availability Assumption Failure

What to watch: The model verifies checkpoint data integrity but doesn't confirm that the tools, APIs, or resources referenced in the checkpoint are still available and compatible at resume time. Guardrail: Extend the integrity report to include an environment readiness section. Require the model to list every tool or external dependency referenced in the checkpoint and flag any that can't be confirmed as available. Gate resumption on environment validation passing.

IMPLEMENTATION TABLE

Evaluation Rubric

Use this rubric to test the Checkpoint Integrity Verification Prompt before shipping. Each criterion targets a specific failure mode: silent corruption acceptance, hash mismatch blindness, schema drift, logical inconsistency, and false-positive integrity passes. Run these tests against a golden set of known-good and intentionally corrupted checkpoints.

CriterionPass StandardFailure SignalTest Method

Hash Verification Accuracy

Report correctly identifies all hash mismatches between [CHECKPOINT_DATA] and [STORED_HASH] with 100% recall on a test set of 20 corrupted checkpoints

Any corrupted checkpoint receives a passing integrity score or hash mismatch is not flagged in the report

Inject bit-flip errors into known-good checkpoints; verify the report flags every corrupted file and lists the expected versus actual hash

Schema Compliance Detection

Report flags every field in [CHECKPOINT_DATA] that violates the [EXPECTED_SCHEMA] including missing required fields, type mismatches, and unknown fields

A checkpoint with a missing required field or wrong type passes schema validation without a warning

Remove one required field from a valid checkpoint; change one field type; add one undefined field; confirm all three are caught

Logical Consistency Check

Report identifies contradictions between [CHECKPOINT_DATA] fields where one field's value logically conflicts with another based on [CONSISTENCY_RULES]

A checkpoint with a step marked complete but its output field null passes without a consistency flag

Create a checkpoint where completed_steps=5 but step_outputs contains only 4 entries; verify the inconsistency is reported with both conflicting fields cited

False-Positive Rate on Clean Checkpoints

Report returns integrity_pass=true and zero critical findings for 10 known-good checkpoints that match their hashes, schemas, and consistency rules

Any known-good checkpoint receives a critical or high-severity finding

Run the prompt against 10 validated clean checkpoints; count any false alarms; acceptable threshold is 0 false positives

Corruption Sensitivity

Report detects single-field corruption in a 50-field checkpoint when that field is marked as critical in [CRITICAL_FIELDS]

A corrupted critical field such as agent_goal or auth_token is not flagged as high severity

Corrupt one critical field value in an otherwise valid checkpoint; verify the report assigns high or critical severity to that finding

Report Structure Compliance

Output is valid JSON matching [OUTPUT_SCHEMA] with all required fields present and no extra top-level keys

Output is missing integrity_pass, findings array, or hash_verified field; or output is not parseable JSON

Validate output against the schema programmatically; reject if JSON.parse fails or required fields are absent

Tamper Evidence Traceability

Each finding includes the specific field path, expected value, actual value, and severity level as specified in [OUTPUT_SCHEMA]

A hash mismatch finding lists the file but does not include expected_hash and actual_hash fields

Inspect the findings array for a corrupted checkpoint; confirm every finding has field_path, expected, actual, and severity populated

Boundary Case: Empty Checkpoint

Report handles an empty [CHECKPOINT_DATA] object gracefully, returning integrity_pass=false with a finding that the checkpoint is empty or missing required root fields

Empty checkpoint causes a parsing error, timeout, or returns integrity_pass=true

Submit an empty JSON object as [CHECKPOINT_DATA]; verify the output is valid, integrity_pass is false, and at least one finding explains the empty state

ADAPTATION OPTIONS

Adapt This Prompt

How to adapt

Add cryptographic hash verification against a stored digest, full schema validation, logical consistency checks, and structured logging. Require the model to produce a machine-readable integrity report with per-check results and a confidence score.

code
Verify checkpoint [CHECKPOINT_ID] against schema [SCHEMA_VERSION].
1. Compute SHA-256 hash and compare to stored digest [STORED_HASH].
2. Validate all fields against [OUTPUT_SCHEMA].
3. Check logical consistency: plan steps must be sequential, completed count <= total count, timestamps monotonic.
4. Return [INTEGRITY_REPORT_SCHEMA] with per-check pass/fail and overall confidence.

Watch for

  • Hash mismatch handling that doesn't block resumption
  • Schema drift between checkpoint versions producing false failures
  • Missing checks for cross-field consistency (e.g., completed steps referencing non-existent task IDs)
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.