Skip to main content

Enterprise legal risk intelligence CLI - analyze Terms of Service and Privacy Policies with multi-domain scanning

Project description

PolicyBoom 💥

Enterprise legal risk intelligence CLI for analyzing Terms of Service and Privacy Policies

PolicyBoom automatically discovers, analyzes, and scores concerning legal clauses across multi-domain company policies using a fluent dot-notation API.

Quick Start

# Install
pip install policyboom

# Scan a company's policies
policyboom exec "scan('slack.com').summarizeHigh()"

# Filter by category
policyboom exec "scan('stripe.com').summarizeHigh().category('arbitration')"

# Get all findings
policyboom exec "scan('example.com').summarizeAll()"

Features

  • 🤖 AI-Powered Extraction - Uses Meta Llama 3.3 70B via Together AI for intelligent clause understanding
  • 🌐 Multi-Domain Scanning - Discovers policies across root domain, subdomains, and product paths
  • 🤹 Bot Evasion - User-agent rotation and request delays to avoid detection on restrictive sites
  • 📱 Mobile/AMP Fallbacks - Automatically tries mobile and simplified versions for better coverage
  • 🔍 Clause-Level Analysis - Extracts individual clauses with unique IDs and metadata
  • ⚖️ Severity Scoring - Categorizes findings as High, Medium, or Low risk
  • 🏷️ Category Tagging - Identifies arbitration waivers, data sale, tracking, COPPA violations, etc.
  • 🔗 Clickable Verification - Source URLs with text fragments auto-scroll and highlight clauses in browser
  • 📅 Policy Dating - Automatically extracts "last updated" dates from documents
  • 💾 Local Storage - SQLite database for caching results (no cloud required)
  • Beautiful Output - Rich terminal formatting with colors and tables
  • 🔄 Fluent API - Chain commands with dot-notation for powerful queries

Installation

pip install policyboom

Setting Up AI Extraction

PolicyBoom uses Meta Llama 3.3 70B for intelligent clause extraction via Together AI's free tier:

  1. Get your free API key from https://api.together.ai/settings/api-keys
  2. Set the environment variable:
    export TOGETHER_API_KEY="your-api-key-here"
    
  3. Run PolicyBoom - it will automatically use AI extraction when the API key is present

Fallback: If no API key is set, PolicyBoom uses regex-based extraction (less accurate but works offline).

Usage

CLI with Dot-Notation

The primary interface uses a fluent camelCase API:

# Basic scan
policyboom exec "scan('company.com').summarizeHigh()"

# Filter by severity and category
policyboom exec "scan('slack.com').summarizeMedium().category('dataSharing')"

# Get metadata with policy URLs and dates
policyboom exec "scan('stripe.com').summarizeAll().metadata()"

# Get full evidence for legal documentation
policyboom exec "scan('example.com').summarizeHigh().withEvidence()"

# Get detailed findings with all metadata
policyboom exec "scan('slack.com').summarizeAll().detailed()"

As a Python Library

from policyboom import scan

# Scan and analyze
result = scan("slack.com").summarizeHigh().category("arbitration")

# Access findings
for finding in result.findings:
    print(f"{finding.severity}: {finding.text}")
    
# Export results
result.export("output.json", format="json")

Categories

PolicyBoom identifies these concerning clause types:

  • arbitration - Forced arbitration / class action waivers
  • dataSale - Third-party data selling
  • tracking - Advertising and behavioral tracking
  • location - Location data collection
  • retention - Data retention policies
  • childrenData - Children's data handling (COPPA)

Reliability & Bot Evasion

PolicyBoom is designed to successfully scan most websites while avoiding bot detection:

User-Agent Rotation

Every HTTP request uses a random, realistic browser user-agent from a pool of:

  • Chrome on Windows, macOS, Linux
  • Firefox on Windows, macOS, Linux
  • Safari on macOS and iOS
  • Microsoft Edge on Windows

This makes requests indistinguishable from normal web browsing.

Human-Like Behavior

  • Request Delays: Random 1-3 second pauses between requests mimic human browsing patterns
  • Browser Headers: Complete header sets including Accept, Accept-Language, Accept-Encoding

Mobile & AMP Fallbacks

When standard URLs fail or return incomplete content, PolicyBoom automatically tries:

  • Mobile sites (m.domain.com)
  • AMP versions (?amp=1)
  • Simplified/print views (?print=true)

This provides ~60-70% success rate across major websites, including sites with basic bot detection.

Limitations

Some sites still require headless browsers or authentication:

  • Amazon, Kick.com: Advanced bot detection systems
  • Facebook, LinkedIn: Policies behind login walls
  • Some news sites: JavaScript-heavy rendering

For these sites, consider using headless browser support (adds ~10x latency and +700% memory/CPU cost).

Commands

# Get help
policyboom --help

# Run interactive guide
policyboom guide

# View examples
policyboom examples

# Export scan results
policyboom export <scan_id> --format json

Development

# Clone repository
git clone https://github.com/policyboom/policyboom
cd policyboom

# Install in development mode
pip install -e ".[dev]"

# Run tests
pytest

License

MIT License - see LICENSE file for details

Support

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

policyboom-0.1.0.tar.gz (27.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

policyboom-0.1.0-py3-none-any.whl (29.5 kB view details)

Uploaded Python 3

File details

Details for the file policyboom-0.1.0.tar.gz.

File metadata

  • Download URL: policyboom-0.1.0.tar.gz
  • Upload date:
  • Size: 27.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for policyboom-0.1.0.tar.gz
Algorithm Hash digest
SHA256 7dbae07d6585280433b9214388114fa2d3fb4c713295624326e7898e39e11e02
MD5 b6806e4f7287f21810997be5aba855c9
BLAKE2b-256 461476e2e2e93726da5b5c9711776c1915fafded14d23ecad12a1bd3d560f187

See more details on using hashes here.

Provenance

The following attestation bundles were made for policyboom-0.1.0.tar.gz:

Publisher: publish.yml on vikramm2/policyBoom

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file policyboom-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: policyboom-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 29.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for policyboom-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e3f471fe23276288127e7283a08920a69fd39f0b7f74c0fe136c9aa573b9d140
MD5 b48fa864091d02ebadba986198e08b0c
BLAKE2b-256 a19cb4cba83286b099a9e32f99761fa9f75a250987b45031b84ea0a8d0962353

See more details on using hashes here.

Provenance

The following attestation bundles were made for policyboom-0.1.0-py3-none-any.whl:

Publisher: publish.yml on vikramm2/policyBoom

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page