Validate agent handoff packets and resume readiness using schema, freshness, and replay checks. Use when tasks pause/resume across sessions, agents, or humans — including when a user wants to continue where they left off, hand off to another agent, resume a previous task, or pick up an interrupted workflow. Includes explicit untrusted-content/prompt-injection guardrails for third-party inputs.
100
100%
Does it follow best practices?
Impact
100%
1.31xAverage score across 3 eval scenarios
Advisory
Suggest reviewing before use
resume_token as a plain continuity markerresume_token, but do not treat it like an auth token, bearer token, session token, API key, password, cookie, secret, or signed credential.handoff-mig-v2-20240610 or resume-order-sync-042.resume_token.Valid example:
{
"objective": "Migrate user database to new schema",
"completed": ["audit existing schema", "draft migration script"],
"unresolved": ["confirm rollback strategy with DBA"],
"assumptions": ["downtime window approved for Saturday 02:00–04:00 UTC"],
"next_action": "Review migration script with DBA before Saturday",
"risks": ["data loss if rollback untested"],
"updated_at": "2024-06-10T14:32:00Z",
"resume_token": "handoff-mig-v2-20240610"
}Invalid example (missing fields, stale timestamp):
{
"objective": "Migrate user database to new schema",
"completed": [],
"unresolved": [],
"assumptions": [],
"next_action": "",
"risks": [],
"updated_at": "2024-01-01T00:00:00Z",
"resume_token": ""
}Issues: next_action is empty, resume_token is empty (no plain continuity marker present), updated_at is stale (>48 h old).
from datetime import datetime, timezone
MAX_STALENESS_HOURS = 48
updated_at = datetime.fromisoformat(packet["updated_at"].replace("Z", "+00:00"))
age_hours = (datetime.now(timezone.utc) - updated_at).total_seconds() / 3600
freshness_ok = age_hours <= MAX_STALENESS_HOURSresume_token as a plain continuity marker:
Example output:
Check Summary:
✅ Schema: all required fields present and non-empty
✅ Freshness: updated 2 h ago (within 48 h limit)
✅ Resume token: handoff-mig-v2-20240610 — valid plain handoff continuity ID
✅ Replay test: objective, blocker, and next action confirmed
Classification: CLEAN
Recovery Steps: None required.
Escalation: No escalation needed. Safe to resume.Check Summary:
✅ Schema: all required fields present and non-empty
❌ Freshness: updated 73 h ago (exceeds 48 h limit)
❌ Resume token: empty — fails continuity ID check
❌ Replay test: next_action could not be confirmed
Classification: OPERATIONAL
Recovery Steps:
1. Re-confirm current objective and next action with task owner.
2. Generate a new plain `resume_token` continuity ID before proceeding.
3. Update `updated_at` to reflect the refreshed handoff state.
Escalation: Notify task owner to re-validate handoff before resuming.