Skip to main content
Glama

agentflight_verify_cassette

Read-onlyIdempotent

Verify an AgentFlight cassette's SHA-256 hash chain and structural integrity to detect tampering, truncation, or corruption before deterministic replay or compliance audits.

Instructions

Cryptographically verify the SHA-256 hash chain and structural integrity of an AgentFlight cassette.

Purpose

Validates that a recorded agent execution cassette (.flight.json or .flight.jsonl) has not been tampered with, truncated, or corrupted. Verifies that every span links to the previous span digest via canonical JSON SHA-256 hashing.

When to use

  • Auditing compliance and tamper-proof provenance of recorded agent trajectories.

  • Pre-flight verification before running deterministic replays with agentflight.replayer.

When NOT to use

  • Do NOT use to compare two cassettes against each other; use agentflight_diff_cassettes instead.

  • Do NOT use to lint MCP tool definitions; use agentflight_lint_tools instead.

Behavior & Side Effects

  • Read-only: Reads cassette from disk and recalculates the SHA-256 chain in-memory without modifications.

  • Deterministic: Always outputs exact boolean verification status, step count, and cryptographic head hash.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "cassette_path": "<cassette_path>"
    },
    "name": "agentflight_verify_cassette"
  }
}

Input Schema

NameRequiredDescriptionDefault
cassette_pathYesFilesystem path to the .flight.json or .flight.jsonl cassette file to verify.

Output Schema

NameRequiredDescriptionDefault
validYesTrue if the cryptographic SHA-256 hash chain and metadata are completely valid and untampered.
agent_idYesUnique agent identifier recorded in the cassette header.
head_hashYesFinal SHA-256 hexadecimal hash digest of the cassette chain.
step_countYesTotal number of verified spans in the trajectory.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changedv1.1.1
    • changedInput schema / properties / cassette_path / description
      Previous value: -"Path to the cassette file to verify."New value: +"Filesystem path to the .flight.json or .flight.jsonl cassette file to verify."
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "properties": {
      +    "agent_id": {
      +      "description": "Unique agent identifier recorded in the cassette header.",
      +      "type": "string"
      +    },
      +    "head_hash": {
      +      "description": "Final SHA-256 hexadecimal hash digest of the cassette chain.",
      +      "type": "string"
      +    },
      +    "step_count": {
      +      "description": "Total number of verified spans in the trajectory.",
      +      "type": "integer"
      +    },
      +    "valid": {
      +      "description": "True if the cryptographic SHA-256 hash chain and metadata are completely valid and untampered.",
      +      "type": "boolean"
      +    }
      +  },
      +  "required": [
      +    "valid",
      +    "agent_id",
      +    "step_count",
      +    "head_hash"
      +  ],
      +  "type": "object"
      +}
  2. First observedv1.1.0

TDQS

A4.4/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already declare readOnly, idempotent, non-destructive and closed-world, but the description adds substance beyond them: it reads from disk, recalculates the chain in-memory, and is deterministic. It also explains the verification mechanism (each span links to the previous digest via canonical JSON SHA-256), which is real behavioral context rather than a restatement of the annotations.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Sectioned with clear headings and front-loaded with the core claim, so an agent can skim to the decision-relevant parts. It is slightly longer than necessary because 'Read-only' and 'no modifications' repeat what the annotations already state, but nothing is wasteful enough to penalize heavily.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a single-parameter verification tool, everything an agent needs is covered: what is verified, when to call it, what to call instead, and that execution is read-only and deterministic. An output schema exists, so the description is not obligated to detail the returned boolean, step count, or head hash.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100% and there is a single required parameter, so the schema already defines cassette_path fully. The description adds only the accepted file extensions (.flight.json / .flight.jsonl), which is marginal value over the existing schema text — baseline 3 is appropriate.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description opens with a specific verb and resource ('Cryptographically verify the SHA-256 hash chain and structural integrity of an AgentFlight cassette') and then narrows it further in the Purpose section to tamper/truncation/corruption detection. It is immediately distinguishable from diff_cassettes (comparison) and lint_tools (definition linting).

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

It gives explicit 'When to use' triggers (compliance auditing, pre-flight before deterministic replays) and explicit 'When NOT to use' cases that name the correct alternatives, agentflight_diff_cassettes and agentflight_lint_tools. Routing between siblings is fully resolved without inference.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.