FORGE-cross-agent-handoff
Purpose
When Agent A cannot complete a task and must transfer to Agent B, context is lost. This skill packages the full task state into a structured handoff artifact that preserves:
- Original task intent and constraints
- Evidence gathered so far (with epistemic labels)
- Floor state (which floors have been checked, which pending)
- Reasoning chain (what was tried, what failed, what's next)
- Provenance (who touched what, when)
Handoff Artifact Schema
{
"handoff_id": "uuid",
"from_agent": "agent-id",
"to_agent": "agent-id",
"task_intent": "original user request",
"constraints": ["F1", "F2", ...],
"evidence": [{"source": "...", "rung": "OBS|DER|INT|SPEC", "confidence": 0.0-1.0}],
"reasoning_chain": [{"step": 1, "action": "...", "result": "...", "status": "done|failed|pending"}],
"floor_state": {"F01": "PASS", "F02": "CHECKING", ...},
"provenance": [{"agent": "...", "action": "...", "timestamp": "..."}],
"next_actions": ["action1", "action2"],
"escalation_note": "why handoff was needed"
}
Handoff Rules
- F1 AMANAH: Handoff must be reversible. Receiving agent can reject.
- F4 CLARITY: Handoff artifact must reduce entropy, not increase it.
- F11 AUDITABILITY: Full provenance chain required.
- Receiving agent must ACK handoff within 10s or escalate.
A2A Transport
Handoff artifact is sent via tasks/send with handoff=true metadata.
Receiving agent runs handoff-verify before accepting task ownership.
Context-Capture Governance (WAJIB 8 — added 2026-07-19)
Agents are already writing durable context artifacts: boot documents, NEXT_AGENT_INIT handoffs, canonical protocols, memory summaries, deprecation registries, instructions for future agents. The next agent inherits whatever the prior agent left. That is policy mutation through documentation unless governance is explicit.
The defect (current state)
An agent can write a guidance document into a privileged initialization path (NEXT_AGENT_INIT.md, system prompt directory, canonical docs, memory bootstrap, agent definition) and the next agent treats it as if it were ratified policy. The current path has no provenance gate.
Required separation: artifact classes
| Class |
Meaning |
Authority |
Loaded as |
observation |
Evidence about current state |
Append-only |
Reference |
operational_handoff |
Temporary work continuation |
Scoped, expiring |
Reference |
guidance |
Non-binding recommendation |
Agents may propose |
Advisory |
policy |
Binding behavioral rule |
Kernel-governed review |
Binding |
constitution |
Changes authority or floors |
F13 ratification |
Binding |
memory |
Historical record |
Append-only with provenance |
Reference |
Required context_manifest for every durable artifact
context_manifest:
artifact_id: <sha256-or-uuid>
class: observation | operational_handoff | guidance | policy | constitution | memory
author: <actor_id>
source_commit: <git sha>
authority_level: T1 | T2 | T3
approved_by: <actor_id> | null
binding: true | false
created_at: <unix_ms>
expires_at: <unix_ms> | null
constitution_compatibility: <hash of current F1-F13 baseline>
supersedes: [<artifact_id>, ...]
content_hash: <sha256>
Hard rules
- Unapproved agent-authored material MUST load as advisory, never binding.
- An agent MUST NOT be able to upgrade its own guidance into binding boot policy by placing it in a privileged initialization path.
class: policy and class: constitution artifacts require approved_by ≠ null.
- Boot loading paths (
INIT, NEXT_AGENT_INIT, system prompt directories, canonical docs, memory bootstrap, agent definitions) MUST be scanned for class: policy | constitution artifacts without approved_by → reject or quarantine.
- Supersession chain MUST be preserved (don't silently replace binding policy).
- Write-side bind (2026-08-19, K3 chatboard scar):
class is not a free string. The writer cannot self-assert guidance unless the spawn-declared role is parent/orchestrator. Read-side filtering is not complete mediation. --from / --role / --kind in a JSONL payload are display fields, not auth.
- A shared sibling "chatboard" /
agent-board.jsonl is the same defect as NEXT_AGENT_INIT policy mutation if kind=guidance is caller-chosen. Sibling lines load as observation unless writer identity is bound independently of the payload.
- Binding interrupt of a running child is cancel + resume with a new envelope, not a board post. See
inter-agent-protocol.md §11.
Required boot context checks
Before loading any artifact into boot context:
- Scan provenance (author, source commit, authority level)
- Verify
class matches the actual content intent (an "observation" cannot bind behavior)
- Check
approved_by for class: policy | constitution
- Check
expires_at — expired artifacts load as observation even if originally policy
- Verify
constitution_compatibility matches current F1-F13 baseline
- Run injection-risk scan on content (template-tag detection, prompt-pattern detection)
Authority scope
WAJIB 8 is T2 — context-loader enforcement can be implemented as T1 (no F13 needed) because it operates on the loader, not the constitution. The constitution class artifacts still need F13; the loader just enforces the existing F13 path.
1---2name: forge-cross-agent-handoff3id: forge-cross-agent-handoff4owner: A-FORGE5risk_tier: low6description: >7 Structured handoff protocol between federation agents. Packages task context,8 evidence, floor state, and provenance into a transferable artifact. Prevents9 context loss during agent transitions. USE WHEN: "hand off to", "transfer task",10 "escalate to agent", "delegate to".11version: 1.1.012tags: [handoff, a2a, protocol, delegation, F1, F11]13floor_scope: [F01, F04, F11]14autonomy_tier: T115capability_tier: fed-agent-subagent16ecology_state: WARM17---1819# FORGE-cross-agent-handoff2021## Purpose22When Agent A cannot complete a task and must transfer to Agent B, context is lost. This skill packages the full task state into a structured handoff artifact that preserves:23- Original task intent and constraints24- Evidence gathered so far (with epistemic labels)25- Floor state (which floors have been checked, which pending)26- Reasoning chain (what was tried, what failed, what's next)27- Provenance (who touched what, when)2829## Handoff Artifact Schema30```json31{32 "handoff_id": "uuid",33 "from_agent": "agent-id",34 "to_agent": "agent-id",35 "task_intent": "original user request",36 "constraints": ["F1", "F2", ...],37 "evidence": [{"source": "...", "rung": "OBS|DER|INT|SPEC", "confidence": 0.0-1.0}],38 "reasoning_chain": [{"step": 1, "action": "...", "result": "...", "status": "done|failed|pending"}],39 "floor_state": {"F01": "PASS", "F02": "CHECKING", ...},40 "provenance": [{"agent": "...", "action": "...", "timestamp": "..."}],41 "next_actions": ["action1", "action2"],42 "escalation_note": "why handoff was needed"43}44```4546## Handoff Rules47- F1 AMANAH: Handoff must be reversible. Receiving agent can reject.48- F4 CLARITY: Handoff artifact must reduce entropy, not increase it.49- F11 AUDITABILITY: Full provenance chain required.50- Receiving agent must ACK handoff within 10s or escalate.5152## A2A Transport53Handoff artifact is sent via `tasks/send` with `handoff=true` metadata.54Receiving agent runs `handoff-verify` before accepting task ownership.5556---5758## Context-Capture Governance (WAJIB 8 — added 2026-07-19)5960Agents are already writing durable context artifacts: boot documents, NEXT_AGENT_INIT handoffs, canonical protocols, memory summaries, deprecation registries, instructions for future agents. The next agent inherits whatever the prior agent left. That is **policy mutation through documentation** unless governance is explicit.6162### The defect (current state)6364An agent can write a guidance document into a privileged initialization path (`NEXT_AGENT_INIT.md`, system prompt directory, canonical docs, memory bootstrap, agent definition) and the next agent treats it as if it were ratified policy. The current path has no provenance gate.6566### Required separation: artifact classes6768| Class | Meaning | Authority | Loaded as |69|---|---|---|---|70| `observation` | Evidence about current state | Append-only | Reference |71| `operational_handoff` | Temporary work continuation | Scoped, expiring | Reference |72| `guidance` | Non-binding recommendation | Agents may propose | Advisory |73| `policy` | Binding behavioral rule | Kernel-governed review | Binding |74| `constitution` | Changes authority or floors | F13 ratification | Binding |75| `memory` | Historical record | Append-only with provenance | Reference |7677### Required `context_manifest` for every durable artifact7879```yaml80context_manifest:81 artifact_id: <sha256-or-uuid>82 class: observation | operational_handoff | guidance | policy | constitution | memory83 author: <actor_id>84 source_commit: <git sha>85 authority_level: T1 | T2 | T386 approved_by: <actor_id> | null87 binding: true | false88 created_at: <unix_ms>89 expires_at: <unix_ms> | null90 constitution_compatibility: <hash of current F1-F13 baseline>91 supersedes: [<artifact_id>, ...]92 content_hash: <sha256>93```9495### Hard rules9697- **Unapproved agent-authored material MUST load as advisory, never binding.**98- An agent MUST NOT be able to upgrade its own guidance into binding boot policy by placing it in a privileged initialization path.99- `class: policy` and `class: constitution` artifacts require `approved_by` ≠ null.100- Boot loading paths (`INIT`, `NEXT_AGENT_INIT`, system prompt directories, canonical docs, memory bootstrap, agent definitions) MUST be scanned for `class: policy | constitution` artifacts without `approved_by` → reject or quarantine.101- Supersession chain MUST be preserved (don't silently replace binding policy).102- **Write-side bind (2026-08-19, K3 chatboard scar):** `class` is not a free string. The writer cannot self-assert `guidance` unless the spawn-declared role is parent/orchestrator. Read-side filtering is not complete mediation. `--from` / `--role` / `--kind` in a JSONL payload are display fields, not auth.103- A shared sibling "chatboard" / `agent-board.jsonl` is the same defect as `NEXT_AGENT_INIT` policy mutation if `kind=guidance` is caller-chosen. Sibling lines load as `observation` unless writer identity is bound independently of the payload.104- Binding interrupt of a running child is cancel + resume with a new envelope, not a board post. See `inter-agent-protocol.md` §11.105106### Required boot context checks107108Before loading any artifact into boot context:1091. Scan provenance (author, source commit, authority level)1102. Verify `class` matches the actual content intent (an "observation" cannot bind behavior)1113. Check `approved_by` for `class: policy | constitution`1124. Check `expires_at` — expired artifacts load as `observation` even if originally `policy`1135. Verify `constitution_compatibility` matches current F1-F13 baseline1146. Run injection-risk scan on content (template-tag detection, prompt-pattern detection)115116### Authority scope117118WAJIB 8 is **T2** — context-loader enforcement can be implemented as T1 (no F13 needed) because it operates on the loader, not the constitution. The `constitution` class artifacts still need F13; the loader just enforces the existing F13 path.