← All guides AI Release
RU Subscribe to @ai_releaseorg

How to Review a Lease Agreement with AI: Step-by-Step Guide with Gemini and Ready-Made Prompts

Updated: 05.12.2026 · AI Release · @ai_releaseorg
How to Review a Lease Agreement with AI: Step-by-Step Guide with Gemini and Ready-Made Prompts

🤖 AI summary

Which topics does it cover?
как проверить договор аренды нейросетью, Gemini для проверки договора, промпты для анализа договора аренды →

TL;DR

What you will get

Quick start

mkdir -p ~/lease-check && cd ~/lease-check
pdfinfo lease.pdf | grep -E "Pages|Encrypted"
pdftotext -layout lease.pdf lease.txt
wc -w -l lease.txt

Details and checks — in the steps below.

Prompt to copy

Illustration: Prompt to copy
Illustration: Prompt to copy
PromptCopy the whole block — this is the ready-to-use system prompt
You are a lease contract reviewer. You analyse a residential lease agreement and return findings a non-lawyer tenant can act on. You are not a lawyer and you do not give legal advice.

INPUT
- Document: the lease text pasted below, between <LEASE> and </LEASE>.
- Jurisdiction: <country/city>.
- My role: tenant.
- My priorities: <for example: deposit refund, early termination, pets, subletting>.

RULES
1. Use only the text inside <LEASE>. Never use outside knowledge about "typical" leases.
2. For every finding, quote the exact sentence and give the page or section number where it appears. If you cannot quote it, write NO QUOTE FOUND and drop the finding.
3. If a topic is not covered by the document, write "not regulated in the document" instead of guessing.
4. Do not paraphrase numbers: copy rent, deposit, penalties and notice periods exactly as written.
5. Flag internal contradictions: the same subject governed by two different rules.
6. Mark anything you are unsure about as CHECK WITH A LAWYER.

OUTPUT — one Markdown table with these columns:
| # | Topic | What the contract says (verbatim quote) | Page/Section | Risk for tenant (High/Medium/Low) | What to ask the landlord |

TOPICS to cover, one or more rows each:
1. Parties and property (address, area, who signs)
2. Term, start and end dates, renewal, automatic extension
3. Rent: amount, currency, due date, payment method, indexation
4. Deposit: amount, holding, return deadline, deductions
5. Utilities and other recurring payments: who pays what
6. Repairs, maintenance, appliances, furniture inventory
7. Termination: notice periods, penalties, early exit, landlord's right to evict
8. Subletting, guests, pets
9. Insurance and liability for damage
10. Dispute resolution, applicable law, jurisdiction
11. Any clause that is unusually harsh for the tenant

AFTER THE TABLE
- "Top 5 issues" — the five rows with the highest risk, one sentence each.
- "Missing clauses" — topics from the list above that the document does not cover.
- "Questions for the landlord" — numbered, each tied to a row number.
- "Next steps" — what to verify with a local lawyer or tenants' association.

<LEASE>
</LEASE>

Replace before sending: <country/city>, <for example: …>, and the empty <LEASE> … </LEASE> block (paste your chunk between the tags).

Requirements and setup

Illustration: Requirements and setup
Illustration: Requirements and setup

Example: verify the toolchain before touching the contract:

pdftotext -v; qpdf --version; tesseract --version

Each line must print a version. command not found means the package is missing — install it before Step 1.

Step 1. Prepare and clean the lease

What to do: confirm the PDF is readable, extract text with layout preserved, and mask personal data before anything leaves your machine.

cd ~/lease-check
pdfinfo lease.pdf | grep -E "Pages|Page size|Encrypted"
pdftotext -layout lease.pdf lease.txt
wc -w -l lease.txt

-layout keeps columns and numbered clauses on their own lines, which is what the prompt needs to quote page/section numbers correctly.

Why: a scanned or password-protected file silently produces an empty text file, and every later answer will be a hallucination on an empty context.

How to check: wc -w -l lease.txt must print a non-zero word count. A 12-page lease typically returns several thousand words; 0 lease.txt means the PDF is an image scan — go to Troubleshooting.

Example: mask account numbers and e-mails (names still need a manual pass, regex cannot do it reliably):

python3 - <<'PY'
import re
src = open('lease.txt', encoding='utf-8').read()
clean = re.sub(r'\b\d{12,20}\b', '[ACCOUNT]', src)
clean = re.sub(r'[\w.+-]+@[\w-]+\.[\w.]+', '[EMAIL]', clean)
open('lease_clean.txt', 'w', encoding='utf-8').write(clean)
print('masks:', clean.count('[ACCOUNT]'), clean.count('[EMAIL]'))
PY
grep -c "\[ACCOUNT\]" lease_clean.txt

Both numbers must match what the script printed. If grep returns 0, the pattern did not hit — replace names and passport/ID numbers by hand in the editor.

Step 2. Split the lease and run the prompt

What to do: cut the PDF into chunks of 8–10 pages along section boundaries, extract each chunk to text, then feed the prompt once per chunk.

pages=$(pdfinfo lease.pdf | awk '/^Pages:/ {print $2}')
echo "total pages: $pages"
qpdf --pages lease.pdf 1-8 -- lease.pdf part1.pdf
pdftotext -layout part1.pdf part1.txt
grep -nE "^[[:space:]]*[0-9]+\." part1.txt | head -3

Why: chat models drop the middle of long inputs. Small chunks plus a per-chunk table give you a complete, checkable result; splitting on a numbered heading avoids cutting a clause in half.

How to check: the last command prints section numbers, and the last line of part1.txt must not end mid-sentence. If it does, move the boundary one page earlier (qpdf --pages lease.pdf 1-7 -- lease.pdf part1.pdf).

Example: order of work for the first chunk — paste the prompt, send it, then paste <LEASE> + part1.txt + </LEASE> in the next message and send. Repeat with part2.txt in the same chat so the model keeps the rule set. If the table stops mid-row, send Continue the table from row N.

Why it works: the rules block stays in context across messages, so you do not re-paste 40 lines of instructions for every chunk.

Step 3. Verify every quote and build the findings file

Illustration: Step 3. Verify every quote and build the findings file
Illustration: Step 3. Verify every quote and build the findings file

What to do: check each quoted sentence against the source text, then save the merged table as findings.md.

grep -n -i -E "deposit|terminat|penalt" lease_clean.txt | head -5

Why: this is the step that separates a usable review from a confident-looking fiction. Any sentence the model quoted must exist in your file, character for character.

Example (your text will differ):

112:3.2 The Deposit shall be refunded within 30 (thirty) days of the handover...
145:5.1 The Landlord may deduct from the Deposit the cost of any repair...

Cross-check checklist before you send anything to the landlord:

How to check: success looks like findings.md with 11 topic rows, a "Top 5 issues" list, and zero rows containing NO QUOTE FOUND that you have not manually resolved.

Where this does not work: handwritten annexes, photos of the flat inventory, and anything the OCR mangled. Gemini also cannot tell you whether a clause is *legal* in your city — it can only show what the paper says, where it contradicts itself, and where it is silent. Treat the output as a list of questions, not a verdict.

Troubleshooting

Problem. Gemini answers as if the contract were empty ("the document does not specify...") for clauses you can see with your own eyes.

pdftoppm -r 300 -png lease.pdf page
for f in page-*.png; do tesseract "$f" "${f%.png}"; done
cat page-*.txt > lease.txt && wc -w lease.txt

Problem. OCR fails immediately on the first page.

Problem. Splitting the PDF does nothing.

Summary and next steps

You now have masked lease text, per-chunk findings with verbatim quotes, and a verified findings.md you can act on. Next, send the "Questions for the landlord" list in writing so the answers become part of the negotiation record, and have a local lawyer review only the High-risk rows.

FAQ

Can I do this with a free Gemini account?

Access tiers and input limits change, so check the current plan limits in the documentation. If a long lease is rejected or truncated, split it into smaller chunks as in Step 2 rather than pasting everything at once.

Is it safe to upload my lease?

Mask names, ID and account numbers first (Step 1) — the model does not need them to review clauses. Whether your inputs are used for training depends on your account settings; verify that in the documentation before pasting anything sensitive.

Does it work with a scanned or handwritten lease?

Scans work after OCR, with quality depending on the scan. Handwritten annexes and inventory photos are unreliable: review those manually and treat any model output about them as unverified.

Can Gemini tell me if a clause is illegal?

No. It shows what the text says, spots contradictions and gaps, and marks risk. Legality depends on local law — that question goes to a lawyer or tenants' association.

🤖 AI summary

AI Release Knowledge Layer
Machine-readable description · Version 1.0

Status: practical guide. Some statements come from vendors; verify in your environment.

1. Summary

Time to complete: 30–45 minutes for a 10–20 page lease Difficulty: Basic (commands are copy-paste; no programming)

Inside: direct answers, key facts, entities, context, reliability, unknowns and sources.

Machine data: Citation Map JSON · JSON-LD · Semantic Embeddings — separate stage.

Full Knowledge Layer: sections 2–8

2. Direct answers

What is required?
OS: Linux, macOS, or Windows with WSL2 (wsl --install -d Ubuntu). The commands below run in bash.; Packages (Debian/Ubuntu): sudo apt update && sudo apt install -y poppler-utils qpdf tesseract-ocr. macOS: brew install poppler qpdf tesseract.; Gemini access through the web app or Google AI Studio. Model names and… → details (AR-GUIDE-KAKPROVERI-003)
How to do it?
Step 1. Prepare and clean the lease → Step 2. Split the lease and run the prompt → Step 3. Verify every quote and build the findings file → details (AR-GUIDE-KAKPROVERI-004)
Which topics does it cover?
как проверить договор аренды нейросетью, Gemini для проверки договора, промпты для анализа договора аренды → details (AR-GUIDE-KAKPROVERI-002)
What are the key points?
Time to complete: 30–45 minutes for a 10–20 page lease Difficulty: Basic (commands are copy-paste; no programming) → details (AR-GUIDE-KAKPROVERI-007)

3. Key facts

  1. Time to complete: 30–45 minutes for a 10–20 page lease — evidence; status: заявление источника.
  2. Difficulty: Basic (commands are copy-paste; no programming) — evidence; status: заявление источника.
  3. You need: Linux/macOS shell or WSL2 on Windows; poppler-utils (pdftotext, pdfinfo, pdftoppm), qpdf, tesseract-ocr; a Google account with Gemini access; the lease as a PDF; any text editor — evidence; status: заявление источника.
  4. OS: Linux, macOS, or Windows with WSL2 (wsl --install -d Ubuntu). The commands below run in bash. — evidence; status: заявление источника.
  5. Packages (Debian/Ubuntu): sudo apt update && sudo apt install -y poppler-utils qpdf tesseract-ocr. macOS: brew install poppler qpdf tesseract. — evidence; status: заявление источника.
  6. Gemini access through the web app or Google AI Studio. Model names and availability change often — take the current name from the model picker and verify in the documentation, not from this guide. For how the assistants differ, see ChatGPT, Claude, Gemini, DeepSeek: AI assistant comparison; for Gemini tiers specifically, see Gemini 4 Argon: features, access, and comparison with GPT-6.1. — evidence; status: заявление источника.

4. Entities

EntityTypeRole
как проверить договор аренды нейросетьютема/инструментупоминается в заголовке, TL;DR или разделах гайда
Gemini для проверки договоратема/инструментупоминается в заголовке, TL;DR или разделах гайда
промпты для анализа договора арендытема/инструментупоминается в заголовке, TL;DR или разделах гайда
Windowsплатформа/технологияупоминается в заголовке, TL;DR или разделах гайда
Linuxплатформа/технологияупоминается в заголовке, TL;DR или разделах гайда
macOSплатформа/технологияупоминается в заголовке, TL;DR или разделах гайда
Googleкомпанияупоминается в заголовке, TL;DR или разделах гайда
Geminiтема/инструментупоминается в заголовке, TL;DR или разделах гайда

5. Context

  • Guide — describes → How to Review a Lease Agreement with AI: Step-by-Step Guide with Gemini and Ready-Made Prompts (AR-GUIDE-KAKPROVERI-001).
  • Guide — includes step → Step 1. Prepare and clean the lease (AR-GUIDE-KAKPROVERI-001).

6. Reliability

Confirmed

No independent confirmation is provided; source claims and editorial conclusions are separated below.

Source claims

  • Product features, versions, prices and limits come from vendors and the guide.
  • Commands and steps are recommendations, not guaranteed results.

AI Release analysis

  • Structure, comparison and selection criteria are editorial.
  • The guide does not replace an independent audit or legal advice.

7. Unknowns

  • Current versions, prices and limits.
  • Independent benchmarks and quality checks.
  • Terms of use and data policy.

8. Sources

SourceTypeRole
No external links——

Cite as: AI Release. Как проверить договор аренды нейросетью: пошаговая инструкция с Gemini и готовыми промптами. ai-release.org.