The analysis pipeline
How LeaseGuard works
Every claim in a LeaseGuard report is backed by a retrieved statute section. The AI never asserts legal facts from training knowledge alone — retrieval happens at runtime, on every analysis.
01
Upload your lease PDF
Drag and drop any Ontario residential lease — scanned or digital. LeaseGuard accepts text-layer PDFs and image-only scans (OCR via Tesseract). Maximum 25 MB.
02
Text extraction
PyMuPDF extracts the text layer directly. If the PDF is a scanned image with no text layer, Tesseract OCR reads it page by page. Confidence is reported alongside the result.
03
Document and jurisdiction validation
Before any expensive analysis runs, LeaseGuard checks that the document is actually a residential lease and that it governs Ontario. Resumes, invoices, and leases from other provinces are rejected immediately with a clear explanation.
04
Clause segmentation
The full lease text is split into individual clauses. Each clause gets a number, an optional heading, and character-position markers so the PDF viewer can highlight the exact passage later.
05
Statute retrieval via RAG
For each clause, LeaseGuard queries 2,372 chunks of Ontario statute text — the Residential Tenancies Act, O.Reg. 516/06, O.Reg. 517/06, and the Ontario Standard Form of Lease — using hybrid BM25 + vector search. Three queries are generated per clause and merged using Reciprocal Rank Fusion so the most relevant sections rise to the top.
06
Risk scoring
Scoring is deterministic TypeScript — not an LLM judgment call. Patterns are matched against the retrieved statute text, statutory violations are flagged, and a 0–10 risk score is produced with a plain-English explanation. Clauses that contradict the RTA are marked potentially unenforceable.
07
Contradiction detection
Pairs of clause types that commonly conflict — entry rights vs. quiet enjoyment, rent increase vs. rent payment — are checked against each other using a Claude call grounded in the retrieved statutes. Only high-confidence contradictions (above 0.65) are surfaced.
08
Report assembled
All results are combined into a structured report: Overview, Red Flags, Clause Explorer, Negotiation Guide, Missing Protections, Contradictions, Sources, and Agent Trace. Every legal claim links back to a specific statute section — nothing is asserted from AI training knowledge alone.
What LeaseGuard checks
Six clause types — the most commonly abused areas of Ontario leases.
Rent increases
RTA s. 116 — written notice, 90-day minimum, guideline cap
Landlord entry rights
RTA s. 27 — 24-hour written notice required for most entry
Maintenance obligations
RTA s. 20 — landlord must maintain in good state of repair
Subletting & assignment
RTA s. 97 — landlord cannot unreasonably withhold consent
Early termination clauses
RTA s. 48 — tenant rights on landlord notice to vacate
Security deposits
RTA s. 105–10 — only last month’s rent deposit is lawful in Ontario
Analyse your lease
Free · no account required · Ontario leases only