Inconsistent triage
Reviewers use different labels, thresholds, and checklists for similar language.
Deterministic contract review and comparison with bounded authority, source-bound evidence, layered privacy, and mandatory legal review.
An implementation-oriented architecture for commercial clause classification, literal-only playbooks, explainable issue spotting, and directional contract change analysis.
ABSTRACT
Grandice provides two constrained legal workflows: one reviews a commercial contract against a fixed clause taxonomy and bounded playbook; the other compares an original contract to a revised version and reports clause-level changes and supported risk deltas.
The implementation is deterministic. Contract text is never passed to an LLM, interpreted as instructions, used to construct tool calls, browsed, or persisted by the legal analysis module. Every cited clause and finding is tied to caller-supplied source metadata and cryptographic document and span digests.
Grandice Privacy Shield can tokenize sensitive values locally before transfer. The gateway applies an additional configured residual scan to raw legal JSON before schema validation. Results disclose assumptions, limitations, omitted counts, and an invariant professional-review requirement.
EXECUTIVE PERSPECTIVE
Commercial review often combines clause inventories, organization-specific checklists, version comparison, and escalation. Unstructured workflows make it difficult to reproduce why an issue was raised, distinguish a missing clause from failed extraction, or verify that evidence came from the correct contract version.
Reviewers use different labels, thresholds, and checklists for similar language.
Findings circulate without exact locations or reliable document-version bindings.
Lexical similarity can be presented as legal equivalence when wording is ambiguous.
Full-content logging can create a secondary repository for sensitive deal material.
Grandice addresses the repeatable issue-spotting layer. Source authenticity, legal interpretation, negotiation position, jurisdiction-specific analysis, approval, and downstream action remain with the adopting institution and qualified professionals.
SCOPE AND RESPONSIBILITY BOUNDARY
DESIGN PRINCIPLES
Contract text has no control-plane authority. Prompt-like text, JSON, URLs, and fake tool calls remain inert characters.
Fixed parser, taxonomy, rules, matching thresholds, and methodology versions drive every authoritative output.
Body, text, JSON, clauses, findings, playbooks, excerpts, candidates, changes, and processing deadlines all have limits.
Document and span digests prevent an evidence location from being silently reassigned to another version.
Caps and ambiguous matches change explicit completeness fields and warnings; they do not disappear silently.
Neither a contract nor a playbook can suppress warnings, alter severity logic, or remove the professional-review gate.
SYSTEM ARCHITECTURE
The strongest privacy mode protects content before it leaves the caller environment. The gateway then authenticates, enforces quotas and structural bounds, scans raw JSON, validates the legal schema, and dispatches only to predefined deterministic code.
MANAGED WORKFLOWS
legal.contract-reviewer.v1Segments one document, classifies clauses, evaluates fixed risks and a bounded playbook, and returns source-bound evidence.
No legal conclusions, drafting, source verification, browsing, or execution.
legal.contract-comparator.v1Compares original to revised using typed category blocking, exact hashes, bounded token similarity, and risk-delta keys.
No claim of semantic equivalence or complete redline fidelity.
REVIEW METHODOLOGY
Lines with bounded recognized headings, numbering, or capitalization start clauses. Each segment records document ID, source ID, Unicode code-point and line coordinates, excerpt, classification method, and document/span/excerpt digests.
Categories cover services, scope, service levels, fees, payment, taxes, term, termination, renewal, warranties, liability, indemnity, insurance, confidentiality, data protection, security, intellectual property, licensing, assignment, subcontracting, compliance, audit, records, governing law, disputes, force majeure, notices, change control, and standard boilerplate.
Current rules identify supported language for potentially unlimited liability, broad indemnity, unilateral termination, automatic renewal, assignment imbalance, confidentiality and data-protection gaps, missing liability caps, required clauses, prohibited literals, governing-law preference mismatch, and declared review policies.
A match means a configured literal or absence rule fired. It does not mean the clause is unenforceable, unacceptable, illegal, one-sided in context, or complete. “Not detected” is not equivalent to “legally absent.”
PLAYBOOK CONTROL
A caller can send an immutable playbook inside a request. The schema accepts only bounded known fields. It does not accept regular expressions, prompts, templates, code, URLs, imports, tools, dynamic field paths, approval actions, or severity overrides for mandatory platform warnings.
COMPARISON METHODOLOGY
The declared direction is always original_to_revised. Exact span hashes match first. Remaining candidates are blocked by clause category and position, with no more than sixteen revised candidates and 512 normalized tokens per original clause.
Risk deltas identify supported findings that are new, resolved, or persistent. IDs use canonical rule and clause-category identity; prohibited literal rules additionally bind a phrase digest. Deltas remain limited to the implemented rules and supplied playbook.
PROVENANCE AND SPAN INTEGRITY
Caller citations identify the asserted source; Grandice does not verify their authenticity. The legal runtime computes SHA-256 values for document text, exact source spans, and rendered excerpts. Coordinates use versioned zero-based, end-exclusive Unicode code points.
PRIVACY AND CONFIDENTIALITY
Contracts routinely contain party names, contacts, addresses, signatures, pricing, trade secrets, and negotiation context. Local protection is the preferred path for confidential workloads because configured residual detection is defense in depth—not proof that a contract contains no sensitive information.
legal-strict-v1 raw-JSON residual scanAUDIT AND GOVERNANCE
Each terminal API outcome records request ID, time, authenticated key and available organization/member references, endpoint, agent, asserted privacy mode, status, duration, schema names, source/warning counts, and methodology version. Contract text, excerpts, citations, findings, token maps, and response bodies are excluded.
dom_...agentlegal.contract-reviewer.v1
status200privacy_modesidecar
input_schemaContractAnalysisInputoutput_schemaContractAnalysis
methodologygrandice-legal-deterministic-1.0.0contentnot stored
Primary domain audit metadata is purged at gateway startup and by an hourly opportunistic cleanup after the configured period—90 days by default. Reverse-proxy logs, crash reporting, encrypted backups, and institutional observability have separate lifecycles and require deployment-specific review.
RUNTIME CONTROLS
API deadlines bound caller waiting time. The token and candidate caps remove the unbounded quadratic comparison path that a timeout alone cannot stop in a worker thread. Exact omitted counts and complete: false are returned when supported output caps are reached.
DEVELOPER INTEGRATION
/v1/legal/contracts/review/v1/legal/contracts/compare/v1/agents/v1/agents/runs/v1/domain/runs/{request_id}{
"metadata": {
"as_of": "2026-09-15",
"sources": [{
"source_id": "msa-source",
"citation": "Caller contract repository record",
"as_of": "2026-09-15"
}]
},
"document": {
"document_id": "msa-v7",
"source_id": "msa-source",
"document_type": "master_services_agreement",
"text": "1. Services\n..."
},
"playbook": {
"playbook_id": "commercial-standard",
"version": "3",
"required_clause_types": ["confidentiality", "data_protection"],
"liability_cap_required": true
}
}
For local tokenization, preserve one request-scoped token map for all documents in a comparison and rehydrate only returned display fields in the caller trust boundary. Never rehydrate into control fields such as agent IDs, playbook IDs, clause categories, status, or severity.
EVALUATION ROADMAP
CURRENT LIMITATIONS
CONCLUSION
Grandice combines deterministic clause processing, bounded comparison, literal-only playbooks, cryptographically bound evidence, Privacy Shield integration, metadata-only audit, and an explicit qualified-review boundary.
The result is a developer-controlled issue-spotting layer, not an autonomous legal actor. Production adoption still requires source controls, approved playbooks, tenant authorization, representative legal evaluation, privacy and security review, retention governance, and qualified professional supervision.
APPENDIX
{
"request_id": "dom_...",
"privacy": {
"mode": "sidecar",
"residual_check": {
"status": "passed",
"coverage": "configured_policy_detectors",
"guarantee": "best_effort"
},
"content_retained": false
},
"data": {
"methodology_version": "grandice-legal-deterministic-1.0.0",
"complete": true,
"legal_advice": false,
"content_persisted": false,
"professional_review_required": true
}
}
grandice_domain/legal.pyLegal schemas, taxonomy, segmentation, rules, evidence hashing, and comparisongrandice_domain/agents.pyVersioned legal workflow registry and declared capabilitiesgateway/routes/legal.pyAuthenticated direct legal APIs, deadlines, audit, and response headersgateway/domain_runtime.pyRaw-JSON limits, residual privacy enforcement, audit write, and envelopeLEGAL-APIS.mdInput contracts, limits, privacy guidance, and responsibility boundarytests/test_legal_domain.pyCore behavior, evidence, ambiguity, delta, injection, and cap testsThis document describes the September 2026 initial implementation. It is technical product documentation, not legal, privacy, security, regulatory, or compliance advice. Grandice does not verify sources or replace qualified legal professionals. Adopting institutions must perform their own validation and governance review.