Example project demonstrating Orloj Agent-to-Agent (A2A) interoperability with a LexisNexis-inspired legal research leasing story.
Not affiliated with LexisNexis. LegalVault is a fictional provider standing in for LexisNexis Protégé-style research. No real LexisNexis API calls are made. All case law and Shepard's-style signals are synthetic demo data.
Morgan & Hale LLP, an Am Law 200 firm, is reviewing a SaaS vendor agreement for an M&A client. Their team uses Meridian Contract Intelligence — a third-party due diligence platform with its own LangGraph agent stack (the LangChain consumer in langchain/).
When Meridian's agent encounters an indemnification clause governed by Delaware law, it does not query a case-law database directly. Instead it calls LegalVault's premium research agent (standing in for LexisNexis Protégé) over A2A, passing the clause and jurisdiction. LegalVault returns a structured memo with enforceability assessment, Shepard's-style citation treatment, and recommendations. Meridian synthesizes that into a client-facing due diligence note.
Sample clause: langchain/sample-contract.txt — asymmetric indemnification (uncapped vendor obligation vs. capped customer liability).
sequenceDiagram
participant Firm as MorganAndHale_Lawyers
participant Meridian as Meridian_ContractIntelligence
participant LegalVault as LegalVault_ProtégéMock
participant Corpus as WASM_ShepardsTools
Firm->>Meridian: Upload SaaS agreement for M&A review
Meridian->>Meridian: Own agent parses contract sections
Meridian->>LegalVault: A2A tasks/send indemnification clause + DE law
Note over Meridian,LegalVault: Bearer subscription token scoped to legal-vault only
LegalVault->>Corpus: precedent-search + citation-analysis
Corpus-->>LegalVault: Holdings + Shepard-style signals only
LegalVault-->>Meridian: JSON memo enforceability precedents recs
Meridian-->>Firm: Due diligence memo citing licensed research
| Actor | Real-world analogue | Demo stand-in |
|---|---|---|
| LexisNexis | Data vendor; runs Protégé + proprietary legal corpus | LegalVault (Orloj provider) — fictional, LexisNexis-inspired |
| Meridian Contract Intelligence | Third-party legal tech SaaS (Clio/Kira/Luminance-style) | LangChain consumer in langchain/ |
| Morgan & Hale LLP | Law firm client of Meridian | User persona in demo CLI output |
| Subscription credential | Enterprise OAuth/API key from LexisNexis Developer Portal | LEGALVAULT_SUBSCRIPTION_KEY (scoped a2a token) |
| Demo component | LexisNexis real product | Notes |
|---|---|---|
legal-research-agent |
Protégé Legal AI / Lexis+ clause analysis | Search → validate → synthesize |
precedent-search tool |
Lexis case law search / Primary Law retrieval | Returns holdings, not full opinions |
citation-analysis tool |
Shepard's Citation Service | Treatment history, negative signals |
legal-glossary (free) |
Public legal education / marketing tier | Upsells to premium |
legal-vault (bearer) |
Protégé API premium embed | Subscription required |
| Agent Card discovery | Developer Portal capability docs | Public discover, gated invoke |
LEGALVAULT_SUBSCRIPTION_KEY |
Developer Portal OAuth credential | Per-customer, scoped, revocable |
A2A tasks/send |
Protégé API "Ask" endpoint | Task-oriented, not bulk retrieve |
| WASM corpus isolation | LexisNexis content licensing model | Data never leaves vendor boundary |
| LangChain consumer | Firm intranet / legal tech embed | What Protégé API targets today |
| LexisNexis today | This demo | |
|---|---|---|
| Wire protocol | REST + OAuth via dev.lexisnexis.com | A2A JSON-RPC + Agent Cards (Orloj) |
| Access model | Enterprise sales approval | Scoped a2a subscription tokens |
| Integration target | Embed Protégé into firm tools | Meridian embeds LegalVault via A2A |
| Data boundary | Licensed API responses | WASM tools return synthesized results only |
LexisNexis does not expose A2A/agent cards today. This demo shows the same leasing business model with A2A as the agent interop layer — composable across LangChain and other agent frameworks without a vendor-specific SDK.
- Protect the corpus — LexisNexis licenses content; bulk DB access enables extraction. An agent returns bounded memos (like Protégé "Ask").
- Bundle expertise — Shepard's, jurisdiction routing, and synthesis are the product, not raw case text.
- Commercial model — Meter research tasks; free glossary upsells to premium Protégé-style agent.
- Scoped credentials — Lessee gets invoke-only token, not ops or DB access.
- Agent-native distribution — Law firms and legal tech run agent stacks; A2A lets research vendors be composable tools in Meridian's graph.
LegalVault runs Orloj with two A2A-enabled AgentSystems on the same instance:
| System | Auth | Story |
|---|---|---|
legal-glossary |
spec.a2a.auth: public |
Free tier — anyone can invoke, no subscription |
legal-vault |
spec.a2a.auth: bearer |
Premium tier — proprietary corpus, subscription token required |
| Feature | How |
|---|---|
| Two auth modes on one instance | legal-glossary public + legal-vault bearer |
| Per-system A2A enablement | AgentSystem.spec.a2a.enabled: true |
| Admin + public invoke | ORLOJ_API_TOKEN for ops; glossary invoke still open |
| Paywalled premium invoke | Scoped a2a token minted via POST /v1/tokens |
| Cross-platform interop | Meridian (LangChain) consumer ↔ LegalVault (Orloj) provider |
| Proprietary data in Orloj | WASM corpus tools on premium agent only |
flowchart TB
subgraph meridian [Meridian Contract Intelligence]
Demo[demo.py]
Demo -->|"subscription key"| VaultRPC
end
subgraph orloj [LegalVault Orloj provider]
GlossaryCard["legal-glossary card"]
VaultCard["legal-vault card"]
GlossaryRPC["POST legal-glossary/a2a open"]
VaultRPC["POST legal-vault/a2a bearer"]
Glossary[legal-glossary-agent]
Vault[legal-vault]
Research[legal-research-agent]
WASM[WASM corpus tools]
Vault --> Research --> WASM
GlossaryRPC --> Glossary
VaultRPC --> Vault
end
Anyone["Any caller"] -->|"no token"| GlossaryRPC
Demo -->|"discover"| VaultCard
- Docker and Docker Compose
- Orloj v0.17.0+ — published
orlojdimage (pulled automatically) andorlojctlCLI - Anthropic API key (Orloj agents + LangChain consumer)
- Python 3.11+ (LangChain demos)
Install orlojctl:
# Homebrew
brew tap OrlojHQ/orloj && brew install orlojctl
# Or install script (pin v0.17.0)
curl -sSfL https://raw.githubusercontent.com/OrlojHQ/orloj/main/scripts/install.sh | sh -s -- v0.17.0cp .env.example .env
# ORLOJ_VERSION, ANTHROPIC_API_KEY, secret in orloj/secrets/secret-anthropic.yamlmake up
make applyVerify both systems:
curl -s http://localhost:8080/v1/agent-systems/legal-glossary | python3 -c "import sys,json; print(json.load(sys.stdin)['spec']['a2a'])"
# {'enabled': True, 'auth': 'public'}
curl -s http://localhost:8080/v1/agent-systems/legal-vault | python3 -c "import sys,json; print(json.load(sys.stdin)['spec']['a2a'])"
# {'enabled': True, 'auth': 'bearer'}make demo-discoveryUnauthenticated registry lists only legal-glossary.
make demo-publicWorks with or without ORLOJ_API_TOKEN set.
legal-vault uses spec.a2a.auth: bearer — no admin token required for this check:
make demo-blockedExpect JSON-RPC error "target AgentSystem is not available" (HTTP 200, no task created).
Blocking anonymous callers (step 5) does not require ops setup. Letting subscribers in does — the server must validate minted bearer tokens (ORLOJ_API_TOKEN must be set on orlojd).
make setup-ops-auth # required first — writes ORLOJ_API_TOKEN, restarts orlojd
make setup-paywall # mints + auto-writes LEGALVAULT_SUBSCRIPTION_KEY to .env
make demo-paidIf make demo-paid returns "target AgentSystem is not available" with empty state= while polling, the subscription key was not accepted — usually because setup-ops-auth was skipped or orlojd was restarted without ORLOJ_API_TOKEN in .env.
Verify the lessee subscription key cannot access Orloj ops APIs:
make demo-control-plane-blocked # subscription key gets 403 on /v1/toolsRequires make setup-ops-auth + make setup-paywall from step 6.
| Command | Expected |
|---|---|
make demo-public |
Glossary invoke works without token |
make demo-blocked |
Vault invoke rejected without token (JSON-RPC error or HTTP 401) |
make demo-paid |
Vault invoke works with subscription key |
make demo-control-plane-blocked |
Subscription key 403 on /v1/tools |
make demo-langchainUses ORLOJ_AGENT_SYSTEM=legal-vault by default. Meridian calls LegalVault over A2A via the query_lexis_research tool and synthesizes a client memo. For raw LegalVault output without LangChain orchestration: make demo-langchain -- --direct-a2a.
| Target | Purpose |
|---|---|
make setup-ops-auth |
Generate/write ORLOJ_API_TOKEN, restart orlojd, apply with admin |
make setup-paywall |
Apply manifests, mint subscription key, write LEGALVAULT_SUBSCRIPTION_KEY to .env |
make mint-subscription |
Mint only (same .env write as setup-paywall) |
Orloj uses three independent layers.
| Layer | Config | What it controls |
|---|---|---|
| Instance auth mode | ORLOJ_AUTH_MODE → --auth-mode=off|native |
Web console login (native = username/password → session cookie). Does not disable per-system A2A auth |
| Token infrastructure | ORLOJ_API_TOKEN, ORLOJ_API_TOKENS, tokens in DB (POST /v1/tokens) |
Whether bearer tokens are parsed/validated; control-plane access (orlojctl apply, /v1/tools, minting) |
| Per-system A2A policy | AgentSystem.spec.a2a.auth: public | bearer |
Which AgentSystems accept anonymous invoke vs require bearer |
Blocking vs accepting on bearer systems:
| Goal | Needs instance tokens? |
|---|---|
Reject anonymous callers (make demo-blocked) |
No — spec.a2a.auth: bearer alone |
Accept a valid subscription key (make demo-paid) |
Yes — server must validate bearer tokens |
With auth-mode=off and no tokens configured, the control plane is open and bearer systems still block unauthenticated A2A invoke. Once you mint tokens (env or DB), instance token auth activates automatically even if auth-mode stays off.
Who gets which secret:
| Secret | Who | Purpose |
|---|---|---|
ORLOJ_API_TOKEN |
LegalVault ops | Admin bootstrap; control plane + minting; enables bearer validation |
LEGALVAULT_SUBSCRIPTION_KEY |
Premium lessee (e.g. Meridian) | Scoped a2a token for legal-vault only — never hand out ORLOJ_API_TOKEN to clients |
The Orloj dashboard and paywalled A2A are not either/or — they use different credentials:
| Who | Auth |
|---|---|
| Human in browser | ORLOJ_AUTH_MODE=native → sign in → session cookie |
Ops (orlojctl, minting) |
ORLOJ_API_TOKEN in .env |
| A2A lessee (Meridian) | LEGALVAULT_SUBSCRIPTION_KEY |
Leave defaults in .env:
ORLOJ_AUTH_MODE=off
ORLOJ_API_TOKEN= # empty until paywall demosmake up && make apply
make demo-public
make demo-blocked
# When ready for paid invoke:
make setup-ops-auth && make setup-paywall && make demo-paidWith ORLOJ_AUTH_MODE=off and ORLOJ_API_TOKEN set, the web UI at http://localhost:8080 will 401 on control-plane APIs (worker/dashboard may reload). That is expected — use Workflow B if you need the console.
Set native auth in .env:
ORLOJ_AUTH_MODE=nativemake up
make setup-ops-auth # bootstraps native admin + ORLOJ_API_TOKEN, then apply
make setup-paywallWith auth-mode=native, Orloj returns admin setup required on protected APIs until the first admin account exists. You can create it in the browser at http://localhost:8080, or let the repo scripts call POST /v1/auth/setup for you (scripts/bootstrap-native-admin.sh — also run automatically from make apply and make setup-ops-auth).
After bootstrap:
- Sign in at http://localhost:8080 with
ORLOJ_ADMIN_USERNAME/ORLOJ_ADMIN_PASSWORDfrom.env(session cookie for the UI). - Run
make demo-paidormake demo-langchain— lessees still useLEGALVAULT_SUBSCRIPTION_KEYfor A2A.
ORLOJ_API_TOKEN stays in .env for orlojctl, token minting, and bearer validation on the server. It is separate from the native web login password.
- Expose AgentSystems via A2A —
spec.a2a.auth - A2A Interoperability