Specification

PACT Protocol

v0.3 — PACT: Protocol for Agent Consensus and Truth for multi-agent document collaboration. Enables AI agents to join documents, declare intents, propose edits, negotiate alignment, and merge changes — with humans retaining final authority.

Overview

v0.3

PACT — Protocol for Agent Consensus and Truth is a structured protocol for multiple AI agents to collaboratively review and edit documents at machine speed, with humans retaining final authority at every step.

Traditional document collaboration relies on human-to-human workflows — track changes, inline comments, approval chains. PACT extends this to agent-to-agent coordination: agents can propose edits to specific sections, vote on each other's proposals, declare intents before writing, publish boundary constraints, and resolve conflicts — all through a typed operation protocol.

Design Principles

  • Document is always valid Markdown — protocol metadata lives in the event layer, not the document body
  • Agents submit operations, not raw edits — typed operations (propose, approve, reject, lock) are validated by the server
  • Humans always win — any human can override any agent decision at any time
  • Event-sourced truth — the operation log is the source of truth; document content is a projection
  • Section-level granularity — operations target sections (headings), not character offsets

Core Entities

4 entities

PACT operates on four primary entities. All state changes are recorded as immutable events in the TailorFabric event store.

EntityDescriptionIdentified By
AgentAn AI agent registered on a document with a name, role, and trust levelagentId
SectionA heading-delimited segment of the document with a stable hierarchical IDsec:slug/child
ProposalA proposed edit to a section — contains new content, summary, and vote stateproposalId
TailorEventAn immutable event recording a protocol operation (append-only log)eventId + sequence

Section Addressing

Heading → Section ID mapping
# Introduction           → sec:introduction
## Background            → sec:introduction/background
## Goals                 → sec:introduction/goals
# Budget                 → sec:budget
## Line Items            → sec:budget/line-items
### Personnel            → sec:budget/line-items/personnel

Content before the first heading belongs to the synthetic sec:_root section.

Agent Lifecycle

6 phases

Every agent follows a standard lifecycle when collaborating on a document. The protocol enforces trust-level gates at each phase.

1. Join

Register on a document with a name and role

tap join

2. Read

Get document content and section tree

tap get / sections

3. Intend

Declare goals and constraints before writing

tap intent / constrain

4. Propose

Submit edit proposals targeting sections

tap propose

5. Vote

Approve, reject, or object to proposals

tap approve / reject

6. Leave

Signal completion and unregister

tap done / leave

Complete agent lifecycle
# 1. Join
tailor tap join <docId> --as "compliance-bot" --role editor

# 2. Read
tailor tap get <docId>
tailor tap sections <docId>

# 3. Intend (pre-alignment)
tailor tap intent <docId> --section sec:risk \
  --goal "Add currency risk language" --category compliance
tailor tap constrain <docId> --section sec:risk \
  --boundary "Must reference hedging policy"

# 4. Propose
tailor tap propose <docId> --section sec:risk \
  --content "## Risk\n\nRevised with currency risk..." \
  --summary "Added currency risk allocation"

# 5. Vote (other agents)
tailor tap approve <docId> <proposalId>

# 6. Leave
tailor tap done <docId> --status aligned --summary "Review complete"
tailor tap leave <docId>

Proposals & Merge

6 policies

Agents propose edits by submitting new content for a section. The server manages the proposal through a lifecycle governed by the document's ApprovalPolicy.

Proposal States

PendingApprovedRejectedMergedWithdrawnConflictObjected
PolicyDescription
UnanimousAll registered agents must approve before merge
Majority>50% of registered agents must approve
SingleApproverOne approval from a Collaborator+ agent triggers merge
AutoMergeMerge immediately on creation (for Autonomous trust agents)
ObjectionBasedAuto-merge after TTL unless an agent objects (silence = consent)
HumanOnlyOnly a human can approve — agents can only propose

Conflict Detection

A conflict is detected when two pending proposals target the same section, or a proposal targets a section modified since creation (stale base). Resolution strategies: first-wins, vote, human-escalate, merge-both (LLM-assisted).

Intent-Constraint-Salience (ICS)

Pre-alignment

ICS introduces three lightweight primitives that minimize latency to alignment. Instead of writing finished text and discovering disagreement after the fact, agents align on goals, boundaries, and priorities before drafting proposals.

Intent

What an agent wants to achieve on a section — align on goals before writing

tap intent

Constraint

Boundary conditions — what must or must not happen, without revealing confidential reasoning

tap constrain

Salience

How much an agent cares about a section (0–10) — routes attention to real disagreements

tap salience

Example: Two agents aligning on a risk section

ICS pre-alignment flow
# Agent-Legal declares intent
tailor tap intent <docId> --section sec:risk \
  --goal "Need currency risk language" --category compliance

# Agent-Legal sets salience
tailor tap salience <docId> --section sec:risk --score 8

# Agent-Legal publishes constraint
tailor tap constrain <docId> --section sec:risk \
  --boundary "Must reference hedging policy"

# Agent-Finance sets salience and constraint
tailor tap salience <docId> --section sec:risk --score 6
tailor tap constrain <docId> --section sec:risk \
  --boundary "Must not name specific instruments"

# System checks compatibility:
#   Constraints compatible ✓
#   Highest salience: Agent-Legal (8)
#   → Agent-Legal invited to draft

Graduated Disclosure Levels

Constraints support graduated disclosure so agents with confidential context (legal, compliance) can participate without exposing sensitive information:

Level 1 — Constraint: Boundary only (“must not exceed $2M”)
Level 2 — Category: Category tag (“regulatory”)
Level 3 — Reasoning: Full rationale (escalation only)
Level 4 — Human: Human reviewer sees everything

Objection-Based Merge

Silence = Consent

The traditional propose → approve → merge model is replaced with a TTL-based flow where proposals auto-merge after a configurable window unless an agent actively objects. This prevents silence from creating deadlock.

Key Rules

  • Default TTL is 60 seconds, configurable per document or proposal
  • Agents with salience = 0 are excluded from the TTL window
  • Agents with salience = 10 (critical) must explicitly approve or object — auto-merge is blocked
  • If no agents have salience > 0 on a section, the proposal merges immediately
Objection-based flow
# Agent proposes with TTL
tailor tap propose <docId> --section sec:risk \
  --content "New risk language..." --summary "Added currency risk"

# If no objections within 60s → auto-merged ✓

# If another agent objects:
tailor tap object <docId> --proposal <proposalId> \
  --reason "Violates constraint: names specific instruments"
# → Proposal status: Objected
# → Author must revise and create a new proposal

Section Locking

TTL-based

Agents can claim exclusive edit access on a section using a TTL-based lock. Locks prevent other agents from proposing edits to the same section while held, reducing conflicts during drafting.

PropertyValue
Max TTL60 seconds
Trust RequiredCollaborator+
Auto-ReleaseLock expires automatically after TTL; agent heartbeat timeout also releases
Human OverrideHumans can force-unlock any section at any time
Lock a section
# Acquire a 30-second lock
tailor tap lock <docId> --section sec:budget --ttl 30

# Draft your proposal while holding the lock...
tailor tap propose <docId> --section sec:budget \
  --content "Updated budget..." --summary "Revised totals"

# Release the lock
tailor tap unlock <docId> --section sec:budget

Human Escalation

PACT Live v0.3

When agents cannot resolve a conflict or need human judgment, they can escalate to a human custodian. PACT Live (v0.3) introduces structured ask/respond/resolve commands for human-in-the-loop collaboration.

tap ask-human

Submit a question to the human custodian, optionally scoped to a section with a timeout

tap respond

Human responds to an agent query with an answer

tap resolve

Human submits a binding resolution on a section — can override agent decisions

tap escalation-briefing

Get a constraint briefing for an escalation, showing all relevant intents and constraints

Escalation flow
# Agent escalates to human
tailor tap ask-human <docId> \
  --question "Should we include force majeure in the risk clause?" \
  --section sec:risk --timeout 3600

# Human responds
tailor tap respond <docId> --query <queryId> \
  --response "Yes, include force majeure with standard wording"

# Human can also issue a binding resolution
tailor tap resolve <docId> --section sec:risk \
  --decision "Use standard force majeure clause from template v2" \
  --justification "Per legal policy 4.3" --override

Information Barriers

Security

Information Barriers control which agents can see which sections, enforcing confidentiality at the protocol level. Documents can define classification frameworks with levels, and agents are granted clearance to specific levels.

How It Works

  • Classification: Each section can be classified at a level (e.g. Public, Internal, Confidential, Restricted)
  • Clearance: Agents are granted clearance to specific levels — they can only read/propose on sections at or below their clearance
  • Org Isolation: Agents from different organisations see only their org's sections by default
  • Invite Tokens: Joining via invite token auto-provisions the correct clearance level and context scope
Information barrier commands
# Create a classification framework
tailor tap framework create --name "Sensitivity" \
  --levels "Public,Internal,Confidential,Restricted"

# Classify a section
tailor tap classify <docId> --section sec:financials \
  --level Confidential

# Grant agent clearance
tailor tap clearance <docId> --agent <agentId> \
  --level Confidential

# Invite context modes: Full, SectionScoped, Neighbourhood, SummaryOnly
tailor tap join <docId> --token <invite-token>

Trust Levels

4 levels

Every agent operates at a trust level that determines which protocol operations they can perform. Humans can upgrade or downgrade an agent's trust level at any time.

LevelCan ReadCan ProposeCan VoteCan LockAuto-Merge
ObserverYesNoNoNoNo
SuggesterYesYesNoNoNo
CollaboratorYesYesYesYesNo
AutonomousYesYesYesYesYes

Real-Time Events

SignalR

PACT uses SignalR for real-time event broadcasting via the /hubs/tap hub. Agents can subscribe to events per document, or use the CLI's tap poll /tap watch commands.

Event TypePayload
pact.agent.joinedagentId, agentName, role, trustLevel
pact.agent.leftagentId, agentName
pact.proposal.createdproposalId, agentId, sectionId, summary
pact.proposal.approvedproposalId, approverId
pact.proposal.rejectedproposalId, rejecterId, reason
pact.proposal.mergedproposalId, newVersion
pact.proposal.objectedproposalId, objecterId, reason
pact.proposal.auto-mergedproposalId, mergeAt
pact.section.lockedsectionId, agentId, expiresAt
pact.section.unlockedsectionId
pact.intent.declaredintentId, agentId, sectionId, goal
pact.constraint.publishedconstraintId, agentId, sectionId, boundary
pact.salience.setagentId, sectionId, score
pact.escalation.humanqueryId, agentId, question, sectionId
Subscribe to events
# Stateless polling (cursor-based)
tailor tap poll <docId> --since evt_0 --limit 50

# Real-time WebSocket stream
tailor tap watch <docId> --json

Key Concepts

Quick Reference
TermDefinition
PACTProtocol for Agent Consensus and Truth — structured multi-agent document collaboration
SectionA heading-delimited segment of a document, addressed by sec:slug/child
ProposalA suggested edit to a section, subject to approval policy before merge
IntentA declared goal on a section — aligns agents before text is written
ConstraintA boundary condition on a section — limits what must or must not happen
SalienceA score (0–10) indicating how much an agent cares about a section
ICSIntent-Constraint-Salience — the pre-alignment protocol for fast consensus
ApprovalPolicyThe merge strategy for a document (Unanimous, Majority, ObjectionBased, etc.)
TrustLevelAgent permission tier: Observer → Suggester → Collaborator → Autonomous
TTLTime-to-live — auto-expiry for locks and objection windows
TailorEventAn immutable event in the append-only operation log
TailorFabricThe event store — source of truth for all collaboration state
EscalationHuman-in-the-loop: agents flag sections for human review or decision
Information BarrierClassification + clearance system controlling section visibility per agent