TrustBase is a Flask-based privacy intelligence app that audits a website using:
- policy/TOS language analysis,
- cookie behavior checks,
- optional AI breach snapshot generation,
- and a final averaged grade.
It is designed for fast, practical trust/compliance reviews from a single URL input.
-
Policy Risk Audit
- Detects risky privacy language categories (collection, sharing, rights, retention, vague terms).
- Highlights risky terms in policy text.
- Produces a policy grade + risk level.
-
Cookie Compliance Audit
- Collects observed cookies for a site.
- Compares behavior against policy disclosures.
- Produces cookie compliance score + grade.
-
Optional AI Breach Snapshot
- Toggle-able checkbox to reduce token usage.
- Generates structured incident summaries with source links and synopsis.
- Produces breach grade + risk level.
-
Final TrustBase Grade
- Averages available component grades:
- Policy,
- Cookie,
- and optional Breach.
- Averages available component grades:
- Python 3.10+
- Flask
- Playwright (for cookie collection)
- Google GenAI SDK (
google-genai) - BeautifulSoup + requests
- Create and activate virtual environment
python -m venv .venv
.\.venv\Scripts\Activate.ps1- Install dependencies
pip install -r requirements.txt- Install Playwright browser runtime
playwright install chromium- Set environment variables
Create/edit .env:
GEMINI_API_KEY=your_real_api_key_here- Run app
python app.pyOpen:
http://127.0.0.1:5000/(Home)http://127.0.0.1:5000/compare(Main audit workflow)
You can test your Gemini key via CLI:
python test_key.pyThis script auto-discovers models from your account and falls back across candidates.
/→ Home page/about→ Product/function glossary and grading documentation/compare→ Primary TrustBase audit page/cookie-audit→ Alias of the same audit workflow/test-keyand/test_key.html→ Web key test page
- Letter-to-points mapping:
A=4, B=3, C=2, D=1, F=0 - Final grade = average of available component grades
- Final risk level:
A/B→ LowC→ MediumD/F→ High
Component grades include:
- Policy grade (from policy risk score)
- Cookie grade (from cookie compliance score)
- Breach grade (if AI breach lookup is enabled)
app.py— Flask app, routes, grading aggregation, AI breach integrationParser.py— policy term detection and risk scoring logicCookieAudit.py— cookie classification, policy fetch, cookie truthfulness logictest_key.py— CLI Gemini key/model connectivity testtemplates/— Jinja templates (base,index,about,compare, etc.)static/style.css— global UI stylingstatic/trustbase.png— logo assetrequirements.txt— Python dependencies
- AI breach summaries may vary by model output and available public info.
- Always validate critical legal/compliance findings with human review.
- Some sites aggressively block crawling/automation; cookie or policy fetch can fail per-site.
No license has been specified yet.