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

First-Time Setup

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. Run the setup command:
    policyboom setup
    
  3. Enter your API key when prompted (it will be saved securely to ~/.policyboom/config.json)
  4. Start scanning:
    policyboom exec "scan('stripe.com').summarizeHigh()"
    

That's it! Your API key is now saved and will be used automatically for all scans.

Alternative: You can also set the environment variable if you prefer:

export TOGETHER_API_KEY="your-api-key-here"

No API key? PolicyBoom will show a helpful message directing you to run policyboom setup.

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.1.tar.gz (29.1 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.1-py3-none-any.whl (31.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: policyboom-0.1.1.tar.gz
  • Upload date:
  • Size: 29.1 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.1.tar.gz
Algorithm Hash digest
SHA256 16dc34bcb745dc28148649cd1f2ee30fd67dc848f7be51d5100795080fb77bb1
MD5 cbcefbade7a84157895cd5eb2bf11736
BLAKE2b-256 c5b8127ba5db8985ce86d367716bd48c4cedca7e34e42af201b3c5a0128a2ad4

See more details on using hashes here.

Provenance

The following attestation bundles were made for policyboom-0.1.1.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.1-py3-none-any.whl.

File metadata

  • Download URL: policyboom-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 31.4 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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 50040cd032558ee6d877a61a57cc8505e7f881b20570b852ea3fa8c4c575b8b4
MD5 ee7de25574b422f5f59e90a910487378
BLAKE2b-256 63b7fd4552181498b1dddab28cc3e28a145671a94244c260c73e74f374b2c892

See more details on using hashes here.

Provenance

The following attestation bundles were made for policyboom-0.1.1-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