# Agent Handoff Contract Designer

Define reliable handoffs between agents or from agents to people, with clear payloads, acceptance rules, ownership, and recovery paths.

## Prompt

You are a distributed AI workflow designer who specializes in reliable handoffs between agents and human operators.

Inputs:
1. Upstream and downstream participants: {{participants}}
2. Workflow goal and handoff points: {{workflow_and_handoffs}}
3. Data, evidence, and decisions transferred: {{handoff_content}}
4. Timing, quality, and compliance requirements: {{service_requirements}}
5. Known handoff failures or ambiguities: {{known_problems}}

Do the following:
1. For each handoff, define the sender's completion criteria, the receiver's acceptance criteria, and the single owner while the work is in transit.
2. Specify a versioned handoff payload with required fields, evidence, confidence, provenance, permissions, deadlines, idempotency key, and unresolved questions.
3. Design acknowledge, reject, request-clarification, retry, timeout, duplicate, and cancellation behaviors without creating ownership gaps or infinite loops.
4. Define what context should be summarized, linked, or excluded, and how the receiver verifies critical claims before acting.
5. Deliver a handoff-contract table, example payloads, state transitions, service-level rules, and test scenarios for malformed, late, conflicting, and duplicate handoffs.

## Best for

Teams coordinating specialized agents or human reviewers that need predictable ownership and context transfer across workflow boundaries.

## Compatible tools

- Claude
- ChatGPT

## How to use

- Name every sender, receiver, and human reviewer.
- Describe the exact evidence needed at each boundary.
- State timing, retry, and ownership expectations.
- Test duplicate and rejected handoffs before production use.

## Customization tips

- Use stable IDs and idempotency keys for retried work.
- Separate verified facts from hypotheses in the payload.
- Set a maximum clarification loop count.
- Define who owns work during timeouts and outages.

## Example input

Participants: A lead-research agent, an account-planning agent, and a human sales representative. Workflow: Research a prospect, convert findings into an account plan, then prepare the rep for outreach. Handoff content: company facts, source links, buying signals, stakeholder hypotheses, and unresolved risks. Requirements: plan ready within 20 minutes, every factual claim sourced, no sensitive personal data, and the rep must approve before outreach. Known problems: repeated research, unsupported claims, and neither agent owning failed handoffs.

## Example output

The research-to-planning contract requires a prospect ID, source-stamped facts, claim confidence, search timestamp, unresolved gaps, and a unique run key. The planning agent accepts only payloads with at least two independent sources for high-impact claims; otherwise it returns a targeted clarification request. Ownership remains with the sender until acknowledgment, then transfers to the receiver. Duplicate run keys are ignored, timeouts return to a coordinator queue, and the final human handoff highlights hypotheses separately from verified facts.
