Problem
Almost everybody in the modern western world signs dozens if not hundreds of contracts each year. But most of them are done so nonchalantly that people hardly even recognize them as contracts. The primary example here is agreeing to a companies Terms of Service (ToS) to use their app or website. Most people when they see that big legal banner just scrolls right past it, checks the box saying they read the whole thing (they definitely didn’t) and moves right along into the app.
This behavior is understandable, no one wants to be inhibited in their onboarding processes by hours and hours to dredge through a longwinded onslaught of words from some corporation’s legal department. Sure, sometimes there is something hidden in those ToS that is actually worth catching and sometimes people will decide to not proceed in creating an account based on a disagreement with them, but its got to be rare. I have no numbers to back this claim up, but based on personal experience and a little extrapolation, I would guess something like 99% of ToS contracts that I sign have no real significant red flags in them that would have otherwise stopped me from proceeding with the account creation.
There in lies the problem though. The effort required to review the extensive ToS that pop up everywhere far far exceeds the benefit to me personally, where 99 times out of 100 I likely find nothing important. So the risk of possibly agreeing to unwelcome terms in that 100th case, is worth the time and efforts savings to just never read any of them at all
Solution
AI and LLMs thrive at solving problems that people always thought were important, but not important enough to prioritize given the effort required. So they were a perfect fit here. A well trained and prompted LLM can read those 100,000 word ToS in mere seconds compared to the hours it would take a human. Parsing, understanding, summarizing and alerting on what it reads is where the LLM can bring real value to human users. It can serve as an unbiased 3rd party reviewer of the contract, pointing out any potentially worrisome clauses to the user about to accept agreement, and discarding all of the verbose legalese to minimize the review time that still needs to be done by the reviewer.
Ultimately the AI legal review should not to make any decisions on behalf of the user. Which means there is still some level of required review by the human about to accept the ToS. Minimizing review time and effort involved is the goal, not to remove the human reviewal process altogether. So, beyond summarizing and highlighting the key points in the ToS, a further step of this process is to translate the boring text into terminology and a medium by which the user can effortlessly comprehend important content before making the now much more educated decision as to agree or not to the ToS.
Lawbot
To achieve this goal in a single weekend build at a hackathon, Jeremy Mumford and myself built Lawbot. A chrome extension that detects legal content on webpages you are viewing, automatically reviews the contract, and produced both a text and video summary of the terms of the contract as well as any possibly unfavorable terms for the user to look out for.
These original contracts and summaries are then stored in the cloud on a users account where they can return later to review them further and ask more prompted questions about the contracts content and obligations that either party has agreed to there in.
Implementation
The Lawbot application can be accessed through 2 primary modalities. An autonomous and interactive chrome extension, and a fully interactive web console. They are connected by the same login/backend and share data with each other, though they do have fairly different purposes.
Chrome Extension
The chrome extension is the primary value driver of Lawbot. It is the arm that solves the initial problem statement in providing the value of understanding the ToS in a way that simplifies the reviewal process significantly enough that it is justified, despite the continued low risk profile.
Once the chrome extension is installed on a users browser they will initially be prompted for log in so that their account can be created or connected to this new browser. Once logged in they will be able to configure their settings, including the ability to turn on automatic scanning. With automatic scanning on the user can mostly forget that the chrome extension is even installed. It will make itself know when they come across a contract document in the brownser.
The chrome extension has a very simple method of discovering contract content on browser pages, and it is super cheap and super fast.
it searches (ctrl+f) for a bunch of keywords.
Thats it, and thats all it needs to be. This isn’t a cop out or skimp. Sure we could also send the content of every webpage to an llm and ask it to decide if there is a contract document present on the page, but that would get VERY expensive VERY fast, and we don’t need to do it. Luckily for us, lawyers are creatures of habit. Partly out of ease and partly out of regulatory requirements, they are never innovative when it comes to key terminology used in their contract documents. So phrases like “Terms of Service”, “Privacy Policy”, “User Agreement” etc. Are not just phrases that show up most of the time there is a user agreement contract on the page. They are words that by law HAVE to show up every time. So an in browser process text search for those terms becomes both the easiest way to detect contract content on the web browser page as well as the most reliable.
Once contract content is detected, we send it through to our backend agent for summary. We used the OpenAI agent sdk to set up the llm interactions over this content which produces
- Summary of the contract
- List of Red flags to watch out for
This content then splits into 2 directions: It goes back to the frontend chrome extension popup to display to the user the summary content of the contract they are currently viewing. And it goes to a secondary backend endpoint for video production. The video production system had certain needs that our typescript backend couldn’t easily supply, so we speparated this piece out specifically into a python backend instead. This video production backend:
- consolidates the summary and red flags into a short transcript
- generates voice audio using OpenAI’s tts-1
- aligns word level timestamps using Whisper-1 to allow us to output transcript subtitles that match the audio during the video playtime
To make the videos as consumable as possible, we chose to make the video structure follow the example of many tiktok “brainrot” videos which reads text overlayed on a video gameplay sequence in the background, usually a farming simulator, minecraft parkour, or subway surfer clip. Once that video is produced (usually a 15-20 second delay from initial contract retrieval) it is also returned for viewing to the extension popup.
All of this results in the user never having to leave the active contract page, not having to click on any extra buttons, and not having to read any of the heavy legal contract they are about to agree to. Instead, they will automatically get a popup with a text summary explaining the contract to them. By the time they have finished reading that summary, a video pops up explaining the red flags they should look out for. And just like that with almost no additional work on the users part, they are able to make a genuinely educated decision about whether to continue and agree with the terms or not.
Web Console
All of the contracts a user sees and summarizes then get stored on that users account. If they would like to later come back and review those contracts, they are able to do so in the web console connected to their account. This web console has a list of all agreements make, module to interact with a legal agent and ask it questions about certain contracts or to search across multiple contracts, and mist importantly, a data removal feature that allows users to effectively be released from a contract they no longer want to participate in. This last feature utilizes a simple email to the contracted party requesting data deletion and account removal, but it handles it autonomously, including follow ups, allowing the user to “fire and forget” what would otherwise be a tedious removal processes. We were able to achieve this recursive iteration using a n8n workflow.
Hackathon Result
We made it to the finals judging round, one of 6 teams out of about 40 to make it to that round. But we did not place in the top 3.
Resources
Github: https://github.com/landiinii/lawbot
Linkedin post about the project: https://lnkd.in/p/gCAjs8cS
Hackathon hosting group: https://justbuild.ing/