Upload a contract (PDF or DOCX) and get the risky clauses highlighted, each with a plain-English explanation and a suggested counter-clause. Personal data is redacted before any text reaches the AI, and nothing is stored.
the problem
Contracts are long and written in dense legal language, so most people sign them without knowing which clauses put them at risk. Sending a personal contract to an AI service also means handing over names, addresses and amounts.
the impact
Kontrakt Skydd turns a contract into a short list of risky clauses with plain-English explanations and proposed counter-clauses, while keeping personal data away from the AI provider and storing nothing.
technologies used
Language
Backend Framework
Build Tool
State Management
Styling
Other
challenges faced
Removing personal data reliably before any text reaches the AI, then restoring the real values afterwards.
Getting structured, trustworthy output from a language model and locating each quoted clause exactly in the source text.
Showing highlights on the original PDF pages, not only on the extracted text.
Keeping a public demo cheap and safe to run.
solutions implemented
Replaced names, emails, phone numbers, IBANs, addresses and amounts with tokens held only in request memory, then mapped them back in the result.
Validated the model's JSON with shared Zod schemas, retried once on failure and matched each quote with exact, normalised and fuzzy search.
Rendered the PDF in the browser with pdf.js and placed highlights by matching quotes against the page text.
Added per-IP and daily rate limits, a document size cap, a Content-Security-Policy and a health check, with the API on Render in Docker and the web app on Vercel.
key features
Upload a PDF or DOCX, or try one of three sample contracts.
Clauses highlighted by risk level, shown with colour and underline style, plus a summary of the findings.
An explanation and counter-clause for every finding, with filters by risk and category.
An Original tab showing the real PDF with highlights, and a Sent to AI tab showing exactly what left the user's machine.
Live progress steps while the contract is analysed.
outcomes & results
Deployed and live on Vercel and Render.
Open-source repository with tests for redaction and clause location, a documented privacy model and a list of known limits.
key learnings
Designing for privacy from the start: tokenising data, keeping it in memory and being honest about the limits of redaction.
Treating AI output as untrusted input and validating it at the boundary.
Streaming results with server-sent events over a POST request, and cancelling the AI call when the user leaves.
Structuring a NestJS API with ports and adapters so the AI provider can be swapped.
similar projects

Codensity — Developer Sustainability Platform
A developer platform that tracks the resource usage and carbon footprint of software features in production. It measures execution time, memory and CPU, then attributes energy (kWh) and emissions (gCO2e) back to the feature that caused them, with the arithmetic and published coefficients visible behind every figure.

Learning Management System (LMS) for Nursing Students
A learning management system (LMS) designed to provide nursing students with a comprehensive platform for preparing for their licensure exams, offering a wide range of resources and tools to enhance their learning experience.
explore more projects

eFama App - Agricultural Marketplace
A mobile application designed to connect South African farmers and buyers in a seamless marketplace, facilitating the trades of agriciultural products and services.

Codensity — Developer Sustainability Platform
A developer platform that tracks the resource usage and carbon footprint of software features in production. It measures execution time, memory and CPU, then attributes energy (kWh) and emissions (gCO2e) back to the feature that caused them, with the arithmetic and published coefficients visible behind every figure.

