Canonical: https://ai-release.org/guides/kak-proverit-dogovor-arendy-neyrosetyu-poshagovaya-inst.html · Markdown · JSON · Updated: 2026-12-05
poppler-utils (pdftotext, pdfinfo, pdftoppm), qpdf, tesseract-ocr; a Google account with Gemini access; the lease as a PDF; any text editor~/lease-check/lease.txt — layout-preserving plain text of the contract, plus per-page-range chunks (part1.txt, part2.txt) ready to paste into a chat.findings.md — a risk table covering 11 lease topics with verbatim quotes, page/section numbers and a High/Medium/Low mark per row.mkdir -p ~/lease-check && cd ~/lease-check
pdfinfo lease.pdf | grep -E "Pages|Encrypted"
pdftotext -layout lease.pdf lease.txt
wc -w -l lease.txtDetails and checks — in the steps below.

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).

wsl --install -d Ubuntu). The commands below run in bash.sudo apt update && sudo apt install -y poppler-utils qpdf tesseract-ocr. macOS: brew install poppler qpdf tesseract.Example: verify the toolchain before touching the contract:
pdftotext -v; qpdf --version; tesseract --versionEach line must print a version. command not found means the package is missing — install it before Step 1.
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.txtBoth 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.
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 -3Why: 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.

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 -5Why: 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:
grep -n "<first 6 words>" lease_clean.txt finds itHow 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.
Problem. Gemini answers as if the contract were empty ("the document does not specify...") for clauses you can see with your own eyes.
wc -w lease.txt prints 0 lease.txtpdftotext extracts no text layer.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.txtProblem. OCR fails immediately on the first page.
TesseractNotFoundError: tesseract is not installed or it's not in your PATH. See README file for more information.tesseract binary, or the binary is missing.sudo apt install -y tesseract-ocr (macOS: brew install tesseract), then which tesseract. For a non-English lease you also need the matching language pack — check the exact package name in the documentation.Problem. Splitting the PDF does nothing.
qpdf: command not foundqpdf was never installed, or you are in a different shell than the one where you installed it.sudo apt install -y qpdf (macOS: brew install qpdf), verify with qpdf --version, then repeat the qpdf --pages ... command from Step 2.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.
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.
Status: practical guide. Some statements come from vendors; verify in your environment.
Time to complete: 30–45 minutes for a 10–20 page lease Difficulty: Basic (commands are copy-paste; no programming)
Machine data: Citation Map JSON · JSON-LD · Semantic Embeddings — separate stage.
| Entity | Type | Role |
|---|---|---|
| как проверить договор аренды нейросетью | тема/инструмент | упоминается в заголовке, TL;DR или разделах гайда |
| Gemini для проверки договора | тема/инструмент | упоминается в заголовке, TL;DR или разделах гайда |
| промпты для анализа договора аренды | тема/инструмент | упоминается в заголовке, TL;DR или разделах гайда |
| Windows | платформа/технология | упоминается в заголовке, TL;DR или разделах гайда |
| Linux | платформа/технология | упоминается в заголовке, TL;DR или разделах гайда |
| macOS | платформа/технология | упоминается в заголовке, TL;DR или разделах гайда |
| компания | упоминается в заголовке, TL;DR или разделах гайда | |
| Gemini | тема/инструмент | упоминается в заголовке, TL;DR или разделах гайда |
No independent confirmation is provided; source claims and editorial conclusions are separated below.
| Source | Type | Role |
|---|---|---|
| No external links | — | — |
Cite as: AI Release. Как проверить договор аренды нейросетью: пошаговая инструкция с Gemini и готовыми промптами. ai-release.org.