Inspiration
Our main inspiration for this project came from a little moment where I was talking with one of my friends about a specific topic, and 1 hour later that exact same thing showed up on my social media feed. At first I thought wow what a coincidence! Until is started happening more and more often, that's when I finally realized, how much information do these social media platforms have? How much access do I really give them to my life. I had no idea what the answer was because I was always too lazy to read the privacy policy's and the terms and service agreement. That's when I understood that I was signing off my critical information just because I was too lazy to read. So when the opportunity presented itself, we created a solution.
What it does
PolicyPeek automatically detects privacy policies, terms of service, and other legal documents on any webpage. With one click, it uses Chrome's built-in Gemini Nano AI to generate clear, concise summaries that highlight key takeaways, what data is collected, privacy risks, and your rights as a user. All analysis happens locally on your device, no data ever leaves your browser.
How we built it
We built PolicyPeek using Chrome's Built-in AI Prompt API to leverage Gemini Nano for on-device natural language processing. The extension uses Manifest V3 architecture with content scripts to automatically scan and detect policy links across websites. A background service worker handles policy fetching and coordination between components. The entire interface is built with vanilla JavaScript for speed and simplicity, featuring intuitive tooltips, notifications, and a clean analysis page.
Challenges we ran into
Managing the Gemini Nano model download flow proved challenging as we had to handle various availability states and user gesture requirements. Extracting clean text from diverse policy page formats was difficult since some sites block content fetching.
One major challenge was that most privacy policies are extremely long, often 20,000+ characters, which exceeded the AI model's context window limits. We developed a smart text truncation algorithm that intelligently reduces policy length to 8,000 characters while preserving meaning. The algorithm searches for natural sentence and paragraph boundaries, only cutting at those points if they're within 80% of the target length. This ensures the AI receives complete, coherent text sections rather than abruptly cut-off sentences, resulting in more accurate and useful summaries.
Accomplishments that we're proud of
An accomplishment we are proud of is creating a clean and simple UI, for a while no matter what design we tried it didn't feel right. It was either too much or too little, but after a lot of editing I feel like we managed to put a perfect mix of modern and simplicity to life in our extension and pop-up menu.
What we learned
We gained deep experience working with Chrome's Prompt API and managing different AI model availability states. We learned effective techniques for extracting and cleaning text from complex HTML documents across various website structures. The project taught us Manifest V3 best practices and how to architect extensions with content scripts, background service workers, and coordinated messaging between components.
What's next for Policy Peek
The future of Policy Peek will include a database that resets itself every week, it will save the previously analyzed links and their simplifications so that when multiple users try to analyze the same link, we can provide faster and more efficient responses. However, in the risk of a terms of service update, the database wipes itself clean every 7 days and re collects the simplifications of the links.
Built With
- css
- html
- javascript
- promptapi
Log in or sign up for Devpost to join the conversation.