@ritualdev-lab/fineprint
v0.1.3
Published
Enterprise In-Memory Contract, Lease & NDA Scanner running completely in-memory with Gemini 1.5 Flash (100% Private, Client-Side, $0 Infrastructure Cost)
Maintainers
Readme
FinePrint AI: Enterprise In-Memory Contract, Lease & NDA Scanner
100% In-Memory Ephemeral Privacy. Zero Data Leakage. $0 Infrastructure Cost.
Built by RitualDev Studio. Proprietary & Closed-Source.
⚡ What is FinePrint AI?
FinePrint AI is an enterprise in-browser legal risk intelligence engine designed for startup founders, developers, employees, tenants, and small businesses who sign agreements without spending $1,500+ on law firm retainers.
Traditional legal AI tools upload confidential agreements to third-party cloud servers and relational databases, creating severe confidentiality breaches and subpoena exposure. FinePrint AI runs 100% in-browser in ephemeral memory: documents are parsed and analyzed directly inside your browser tab's RAM and vanish on tab close.
🏗️ Core Architecture & Features
1. In-Memory Multi-Format Document Parser
- Binary PDF AST Parser: Zero-dependency PDF parser decoding text operator streams (
BT ... ET),Tj/TJkerning arrays, hex encoded strings, and octal escapes directly from in-memory byte buffers. - Markdown & Plaintext Normalizer: Cleans whitespace, normalizes formatting, and computes deterministic SHA-256 contract hashes.
- Legal Structure Chunker: Recursively splits agreements into numbered articles (
Article IV), outline sections (Section 3.2.1),RECITALS,WHEREAS, andDEFINITIONS.
2. Layer 1: Offline Red-Flag Matrix (60+ Legal Traps)
- Non-Disclosure Agreements (NDAs): Residual knowledge carve-out loopholes, perpetual confidentiality terms, hidden non-solicitation riders, unilateral one-way disclosures, injunction bond waivers.
- Residential & Commercial Leases: Automatic annual renewal traps without notice, landlord entry without 24-hr advance notice, tenant liability for structural/roof/foundation repairs, eviction waivers of due process, non-refundable deposit penalties.
- SaaS Terms & Vendor MSAs: Unilateral contract/pricing modification rights, perpetual commercial licenses to user IP/data, mandatory binding arbitration with class-action bans, one-sided uncapped customer indemnification.
- Employment Contracts: Draconian 2-year non-competes, 24/7 personal side-project invention assignment forfeitures, moonlighting & open-source bans, bonus/commission clawbacks.
- General Commercial Terms: Asymmetric attorney's fees, inconvenient offshore jurisdiction traps, jury trial waivers, shortened statutes of limitations.
3. Layer 2: Gemini 1.5 Flash AI Engine ($0 Tier)
- Google Gemini 1.5 Flash Free Tier (15 RPM / 1M TPM at $0/month cost).
- Structured JSON output (
responseMimeType: "application/json"). - Deep contextual analysis: detects ambiguous phrasing, jurisdiction traps, hidden warranties, and one-sided liabilities.
- 100% Graceful Offline Fallback: Seamlessly degrades to the offline rule matrix if network is severed or an API key is not supplied.
4. In-Browser Redline Exporters & Negotiation Playbook
- Executive Legal Brief: Color-coded risk meter report exportable to self-contained HTML (zero external CDNs) and PDF.
- Redline Counter-Proposal: Generates full substituted contract drafts in Markdown, HTML, and Plaintext showing tracked changes (
~~deletions~~and**[PROPOSED SUBSTITUTIONS]**). - Negotiation Playbook: 1-click counter-offer email generator with tone customization (
firm_professional,collaborative,assertive_legal).
5. Interactive Studio UI & FinePrint CLI
- Visual Studio UI: Interactive split-screen contract reader, sample presets, and real-time risk scorecard.
- FinePrint CLI (
fineprint): Command-line tool with strict CI/CD gatekeeping (--strictexits with code 1 on toxic dealbreakers).
💻 CLI Usage
# Scan a contract and print risk scorecard
fineprint scan ./nda.pdf
# Run strict CI/CD audit (fails build if contract is toxic)
fineprint scan ./saas-agreement.txt --strict
# Export printable HTML executive legal brief
fineprint scan ./lease.md --out ./audit-report.html --format html
# Generate tracked-changes redline counter-proposal
fineprint redline ./employment-contract.pdf --out ./counter-draft.md
# Generate 1-click push-back negotiation email
fineprint email ./vendor-msa.txt --role Customer --tone collaborative
# Inspect offline legal rule matrix
fineprint rules --category saas🚀 TypeScript Library API
import {
parseContractDocument,
auditContractDocument,
generateExecutiveBriefHtml,
generateRedlineDocument,
generateNegotiationEmail
} from '@ritualdev/fineprint';
// 1. Ingest plaintext, markdown, or binary PDF byte buffer
const contract = parseContractDocument(fileBuffer, { filename: 'vendor_agreement.pdf' });
// 2. Perform comprehensive hybrid audit
const audit = await auditContractDocument(contract, {
apiKey: process.env.GEMINI_API_KEY,
userRole: 'Buyer'
});
console.log(`Grade: ${audit.grade} (${audit.status}) | Score: ${audit.compositeRiskScore}/100`);
// 3. Export HTML executive brief
const htmlBrief = generateExecutiveBriefHtml(audit);
// 4. Export tracked-changes redline counter-proposal
const redline = generateRedlineDocument(audit, contract, { format: 'markdown' });
// 5. Generate push-back negotiation email
const email = generateNegotiationEmail(audit, { tone: 'firm_professional' });💼 Commercial Tiers
| Feature | Community ($0 Free) | Pro ($19/mo) | Enterprise ($49/mo) | |---|---|---|---| | Max Scans | 5 scans / day | Unlimited | Unlimited | | Offline Rule Matrix | ✅ Full 60+ Rules | ✅ Full 60+ Rules | ✅ Full 60+ Rules | | Gemini 1.5 Flash AI | ❌ Offline Only | ✅ Full AI Inference | ✅ Full AI Inference | | Redline Exports | Schedule Only | ✅ Full Tracked Draft | ✅ Full Tracked Draft | | Negotiation Emails | ✅ Standard Template | ✅ Tone Customization | ✅ Tone Customization | | CLI CI/CD Gatekeeper | ❌ Personal Use | ❌ Personal Use | ✅ Unlimited CI/CD | | White-Label Branding | ❌ FinePrint AI | ❌ FinePrint AI | ✅ Custom Corporate |
📜 License
Proprietary Closed-Source Commercial Software. © 2026 RitualDev Studio. All Rights Reserved.
