A Google Chrome Extension that uses AI to analyze text or link to Terms of Service/User Agreement/Contract and finds the real and potential red flags in it. It connects to a local Python backend powered by FastAPI, LangChain, and Google Gemini (can be replaced with any other LLM provider).
- Analyze Page: Right-click anywhere on a page to analyze the visible text.
- Analyze Link: Right-click a link (e.g., "Terms of Service") to scrape that URL and analyze its content without visiting it manually.
- AI Summaries: Uses LLM to highlight key points, red flags, and summaries.
- Multi-Model Support: Works with Google Gemini (default), OpenAI, Claude (Anthropic), and Ollama (local LLMs).
- BYOK (Bring Your Own Key): Securely input your own Google Gemini API Key in the extension settings.
- Frontend: Chrome Extension (Manifest V3), JavaScript, HTML.
- Backend: Python 3.9+, FastAPI, Uvicorn.
- AI Orchestration: LangChain (Google GenAI).
- Scraping: BeautifulSoup4, Requests.
- Python 3.9 or higher installed.
- uv installed (https://docs.astral.sh/uv/).
- Google Chrome (or Chromium-based browsers like Brave/Edge).
- Google Gemini API Key (Get one for free at Google AI Studio).
agreement-analyzer/
├── backend/ # Python Server
│ ├── server.py # FastAPI application logic
│ └── requirements.txt # Python dependencies
├── extension/ # Chrome Extension Source
│ ├── manifest.json # Extension configuration
│ ├── background.js # Logic for context menus & API calls
│ ├── options.html # Settings page (API Key input)
│ ├── options.js # Settings logic
│ └── icon.png # (Optional) App Icon
└── README.md
- Navigate to the
backendfolder:cd backend - Install the required dependencies:
uv sync --frozen --no-dev
- Start the server:
The server will run at
uv run uvicorn server:app --reload --port 8001
http://127.0.0.1:8001.
- Navigate to the project root:
cd agreement-analyzer - Start the service:
The server will run at
docker-compose up --build -d
http://localhost:8001.
- Open Chrome and navigate to
chrome://extensions/. - Enable Developer mode using the toggle in the top-right corner.
- Click the Load unpacked button.
- Select the
extensionfolder from this project.
- Click the extension icon (puzzle piece) in Chrome and find "Agreement Analyzer".
- Right-click the icon and select Options.
- Paste your Google Gemini API Key into the field and click Save.
-
Current Page: Right-click anywhere on a webpage
$\rightarrow$ Select "Analyze Current Page Agreement". -
Linked Page: Right-click on a hyperlink (e.g., "Terms & Conditions")
$\rightarrow$ Select "Analyze Linked Agreement".
Wait a few seconds (depending on the length of the text). An alert popup will appear displaying the AI-generated analysis.
Error: "Failed to fetch"
- Ensure the Python server is running (
http://127.0.0.1:8001or your configured IP/Port). - Check if your firewall is blocking the connection.
Error: "400 Not enough text found"
- The page or link might be empty or protected by JavaScript that
BeautifulSoupcannot execute. This tool works best on static text pages.
Error: "401 API Key missing"
- Go to the Extension Options page and ensure your Gemini API key is saved.
Alert box cuts off text
- Standard JavaScript
alert()boxes have character limits. For a better experience, view theserver.pylogs to see the full Markdown output, or check the browser console.
This project is open-source. Feel free to modify and distribute.