← All Event Families

foundation.protocols.legal.*

Legal marketplace and professional workflows: competitive bidding, lawyer verification, privileged case offices, document management, and payment. Built on per-jurisdiction Matrix spaces.

18
Events
14
Timeline
4
State

Contents

Legal Marketplace: 5-Phase Competitive Bid

Anonymous competitive bidding for legal services, with architectural isolation between proposals.

1. Client posts anonymised brief to jurisdiction Brief Board legal.brief 2. Verified lawyers express interest → each gets isolated Proposal Workspace legal.proposal_interest 3. Lawyers independently prepare competing proposals (cannot see each other's) legal.proposal 4. Bid window closes → all proposals delivered to Client Proposal Review Room 5. Client accepts one → winner gets case access, losers' workspaces decommissioned legal.proposal_accepted + legal.proposal_declined + legal.brief_closed

Marketplace Events

6 events for the competitive legal bidding workflow.

Timeline Event

foundation.protocols.legal.brief

Client posts a legal brief to a jurisdiction’s Brief Board room. The brief is anonymised — lawyer cannot identify the client until a proposal is accepted.

FieldTypeDescription
brief_idstringUnique brief identifier
jurisdictionstringJurisdiction code (e.g., SE, DE, US-NY)
area_of_lawstringLegal area (e.g., corporate, immigration, compliance)
summarystringAnonymised summary of the legal need
urgencystringUrgency level
Values: standard, urgent, critical
budget_rangeobjectBudget range with min, max, currency
bid_deadlinestringISO 8601 deadline for proposals
posted_bystringClient Matrix user ID (visible only to Marketplace Bot)
{
  "type": "foundation.protocols.legal.brief",
  "content": {
    "brief_id": "BRF-SE-2026-0042",
    "jurisdiction": "SE",
    "area_of_law": "corporate",
    "summary": "Need assistance with GDPR compliance review for SaaS platform",
    "urgency": "standard",
    "budget_range": { "min": "5000", "max": "15000", "currency": "SEK" },
    "bid_deadline": "2026-04-15T17:00:00Z",
    "posted_by": "@client:matrix.openearth.network"
  }
}
Timeline Event

foundation.protocols.legal.proposal_interest

Verified lawyer signals interest in a brief. The Marketplace Bot creates an isolated Proposal Workspace room for this lawyer to prepare their proposal.

FieldTypeDescription
brief_idstringBrief being responded to
lawyer_idstringLawyer Matrix user ID
bar_council_idstringLawyer’s bar registration number
specialisationsstring[]Relevant specialisations
workspace_room_idstringIsolated Proposal Workspace room (created by bot)
{
  "type": "foundation.protocols.legal.proposal_interest",
  "content": {
    "brief_id": "BRF-SE-2026-0042",
    "lawyer_id": "@lawyer-se-001:lawfirm.se",
    "bar_council_id": "SE-ADV-2019-1234",
    "specialisations": ["gdpr", "data_protection", "saas"],
    "workspace_room_id": "!proposal-ws-001:matrix.openearth.network"
  }
}
Timeline Event

foundation.protocols.legal.proposal

Lawyer submits a competing proposal. Proposals are isolated — lawyers cannot see other proposals. Delivered to the Client Proposal Review Room when the bid window closes.

FieldTypeDescription
brief_idstringBrief being responded to
proposal_idstringUnique proposal identifier
lawyer_idstringLawyer Matrix user ID
approachstringProposed legal approach
estimated_feeobjectFee with amount and currency
estimated_timelinestringExpected delivery timeline
attachmentsobject[]Supporting documents (MXC URIs)
{
  "type": "foundation.protocols.legal.proposal",
  "content": {
    "brief_id": "BRF-SE-2026-0042",
    "proposal_id": "PRP-SE-2026-0042-A",
    "lawyer_id": "@lawyer-se-001:lawfirm.se",
    "approach": "Full GDPR Article 30 records review + DPA audit + remediation plan",
    "estimated_fee": { "amount": "12000", "currency": "SEK" },
    "estimated_timeline": "2 weeks",
    "attachments": []
  }
}
Timeline Event

foundation.protocols.legal.proposal_accepted

Client accepts one proposal. The winning lawyer gains access to the case office room.

{
  "type": "foundation.protocols.legal.proposal_accepted",
  "content": {
    "brief_id": "BRF-SE-2026-0042",
    "proposal_id": "PRP-SE-2026-0042-A",
    "lawyer_id": "@lawyer-se-001:lawfirm.se",
    "accepted_by": "@client:matrix.openearth.network",
    "case_office_room_id": "!case-0042:matrix.openearth.network"
  }
}
Timeline Event

foundation.protocols.legal.proposal_declined

Non-selected lawyer receives notification. Their Proposal Workspace is decommissioned.

{
  "type": "foundation.protocols.legal.proposal_declined",
  "content": {
    "brief_id": "BRF-SE-2026-0042",
    "proposal_id": "PRP-SE-2026-0042-B",
    "lawyer_id": "@lawyer-se-002:otherfirm.se",
    "reason": "alternative_selected"
  }
}
Timeline Event

foundation.protocols.legal.brief_closed

Brief is closed — either a proposal was accepted, the brief expired, or the client withdrew it.

{
  "type": "foundation.protocols.legal.brief_closed",
  "content": {
    "brief_id": "BRF-SE-2026-0042",
    "reason": "proposal_accepted",
    "closed_at": "2026-04-14T10:00:00Z"
  }
}

Professional Events

8 events for case management, escalation, and legal professional workflows.

Timeline Event

foundation.protocols.legal.escalation

Client escalates from AI assistant to a human lawyer. The AI session pauses and a human lawyer is notified in the case office room.

{
  "type": "foundation.protocols.legal.escalation",
  "content": {
    "escalated_by": "@client:matrix.openearth.network",
    "from_session_id": "sess_01ABC...",
    "reason": "Need human review of AI's GDPR interpretation",
    "urgency": "standard",
    "context_summary": "AI analysed DPA with vendor X but client unsure about Article 28 clauses"
  }
}
Timeline Event

foundation.protocols.legal.lawyer_response

Lawyer’s response to an escalation. May include corrections to AI output, additional analysis, or instructions to the client.

{
  "type": "foundation.protocols.legal.lawyer_response",
  "content": {
    "escalation_ref": "$escalation_event_id",
    "lawyer_id": "@lawyer-se-001:lawfirm.se",
    "response": "The AI's analysis is correct for standard DPAs but missed the sub-processor chain clause",
    "corrections": ["$correction_event_id"],
    "follow_up_required": true
  }
}
Timeline Event

foundation.protocols.legal.document_transfer

Client grants lawyer access to documents. Documents are uploaded as encrypted Matrix media and linked to the case office room.

{
  "type": "foundation.protocols.legal.document_transfer",
  "content": {
    "case_office_room_id": "!case-0042:matrix.openearth.network",
    "transferred_by": "@client:matrix.openearth.network",
    "documents": [
      {
        "name": "Current DPA with Vendor X",
        "mxc_uri": "mxc://matrix.openearth.network/dpa-doc-001",
        "media_type": "application/pdf",
        "size_bytes": 245760
      }
    ],
    "access_scope": "case_only",
    "revocable": true
  }
}
Timeline Event

foundation.protocols.legal.document_edit

Lawyer’s edits to a working draft. Tracks the edit history with before/after hashes and optional diff attachment.

{
  "type": "foundation.protocols.legal.document_edit",
  "content": {
    "document_ref": "mxc://matrix.openearth.network/dpa-doc-001",
    "edited_by": "@lawyer-se-001:lawfirm.se",
    "edit_summary": "Updated Article 28 sub-processor clauses per client requirements",
    "before_hash": "sha256:abc123...",
    "after_hash": "sha256:def456...",
    "diff_mxc_uri": "mxc://matrix.openearth.network/dpa-diff-001",
    "version": 2
  }
}
Timeline Event

foundation.protocols.legal.lawyer_seal

Lawyer’s formal seal of approval. Includes document hash, bar council ID, and digital signature. Constitutes the official lawyer-approved version of the document.

{
  "type": "foundation.protocols.legal.lawyer_seal",
  "content": {
    "document_ref": "mxc://matrix.openearth.network/dpa-final-001",
    "document_hash": "sha256:final789...",
    "sealed_by": "@lawyer-se-001:lawfirm.se",
    "bar_council_id": "SE-ADV-2019-1234",
    "seal_statement": "I have reviewed this document and confirm it is legally sound",
    "sealed_at": "2026-04-20T14:00:00Z",
    "signature": "base64-encoded-digital-signature"
  }
}
Timeline Event

foundation.protocols.legal.lawyer_rating

Client rates lawyer post-case. Anonymous within the marketplace but linked to the brief for audit.

{
  "type": "foundation.protocols.legal.lawyer_rating",
  "content": {
    "brief_id": "BRF-SE-2026-0042",
    "lawyer_id": "@lawyer-se-001:lawfirm.se",
    "rated_by": "@client:matrix.openearth.network",
    "scores": {
      "quality": 4.5,
      "responsiveness": 5.0,
      "value_for_money": 4.0
    },
    "comment": "Thorough DPA review, excellent turnaround time",
    "would_recommend": true
  }
}
Timeline Event

foundation.protocols.legal.payment_request

Lawyer requests payment for completed work. Linked to the case and accepted proposal.

{
  "type": "foundation.protocols.legal.payment_request",
  "content": {
    "brief_id": "BRF-SE-2026-0042",
    "proposal_id": "PRP-SE-2026-0042-A",
    "requested_by": "@lawyer-se-001:lawfirm.se",
    "amount": "12000",
    "currency": "SEK",
    "invoice_ref": "INV-2026-0042",
    "due_date": "2026-05-01"
  }
}
Timeline Event

foundation.protocols.legal.payment_confirmed

Payment has been confirmed. Closes the financial loop for the case.

{
  "type": "foundation.protocols.legal.payment_confirmed",
  "content": {
    "brief_id": "BRF-SE-2026-0042",
    "invoice_ref": "INV-2026-0042",
    "paid_by": "@client:matrix.openearth.network",
    "amount": "12000",
    "currency": "SEK",
    "payment_method": "bank_transfer",
    "confirmed_at": "2026-04-28T09:00:00Z"
  }
}

State Events

4 state events for room-level legal configuration and verification.

State Event

foundation.protocols.legal.lawyer_verified

Bar council verification attestation. State key is the lawyer’s Matrix user ID. Verified by the Open Law Directory Service (OLDS).

{
  "type": "foundation.protocols.legal.lawyer_verified",
  "state_key": "@lawyer-se-001:lawfirm.se",
  "content": {
    "lawyer_id": "@lawyer-se-001:lawfirm.se",
    "bar_council_id": "SE-ADV-2019-1234",
    "jurisdiction": "SE",
    "verification_status": "verified",
    "verified_by": "@olds-bot:matrix.openearth.network",
    "verified_at": "2026-01-15T12:00:00Z",
    "specialisations": ["gdpr", "corporate", "technology"],
    "renewal_date": "2027-01-15"
  }
}
State Event

foundation.protocols.legal.support_person_join

Support person (paralegal, translator, expert witness) joins a case with explicitly scoped confidentiality obligations.

{
  "type": "foundation.protocols.legal.support_person_join",
  "state_key": "@paralegal-001:lawfirm.se",
  "content": {
    "person_id": "@paralegal-001:lawfirm.se",
    "role": "paralegal",
    "invited_by": "@lawyer-se-001:lawfirm.se",
    "confidentiality_scope": "full_case",
    "nda_signed": true,
    "access_expires": "2026-06-30T23:59:59Z"
  }
}
State Event

foundation.protocols.legal.case_office_created

Lawyer creates a case office room. The state event records the room configuration, linked brief, and access controls.

{
  "type": "foundation.protocols.legal.case_office_created",
  "state_key": "",
  "content": {
    "brief_id": "BRF-SE-2026-0042",
    "case_office_room_id": "!case-0042:matrix.openearth.network",
    "created_by": "@lawyer-se-001:lawfirm.se",
    "client_id": "@client:matrix.openearth.network",
    "e2ee_enforced": true,
    "room_preset": "privileged_case_office",
    "created_at": "2026-04-14T11:00:00Z"
  }
}
State Event

foundation.protocols.legal.room_preset

Formalised room template metadata. Defines the room type (brief board, proposal workspace, case office, etc.) and its associated permissions and policies.

{
  "type": "foundation.protocols.legal.room_preset",
  "state_key": "",
  "content": {
    "preset": "privileged_case_office",
    "description": "E2EE case office with lawyer-client privilege",
    "e2ee_required": true,
    "history_visibility": "joined",
    "power_levels": {
      "lawyer": 75,
      "client": 50,
      "support_person": 25,
      "ai_agent": 10
    },
    "allowed_event_types": [
      "foundation.protocols.legal.*",
      "foundation.protocols.ai.claude.*"
    ]
  }
}

Privilege Architecture

Legal professional privilege is protected architecturally, not just by policy.

PriorityMeasureEffect
P1Firm-controlled self-hosted homeserverMetadata never leaves firm custody
P2Enforced device verificationNo unverified-device fallback, ever
P3No server-side key escrowClient-controlled backup only
P4Post-quantum planningHybrid TLS (now) → hybrid Olm (2027) → full PQ (2028+)

AI + Legal Integration

When Claude is used for legal research via the bridge daemon with Ansvar MCP servers:

Compliance analyst in Matrix room Claude queries per-country law MCP + EU Regulations MCP + Security Controls MCP ai.claude.mcp.tool.call (per server) ai.claude.mcp.tool.result (verbatim statute text) Claude synthesises cross-regulation gap analysis ai.claude.response ai.claude.approval.request (for compliance officer) ai.claude.approval.response (signed by CISO) Complete audit: regulation text → AI reasoning → professional approval
65+ MCP data sources: 106 per-country law servers, EU Regulations (49 regulations, 2,528 articles), US Regulations (HIPAA, CCPA, SOX), Security Controls (262 frameworks, 1,451 controls), Sanctions (OFAC, EU, UN).

Related Event Families

FamilyRelationship
ai.* ai.policy restricts AI tool usage in legal rooms. ai.evaluation scores AI legal outputs.
ai.claude.* MCP tool calls to law servers are recorded as ai.claude.mcp.tool.call/result. Approval workflow uses ai.claude.approval.*.
data.* Document transfers in case offices use data.consent to control downstream usage.