Data Broken - Opt out of the data broker nightmare with Privotron and Amazon Q Developer

This is a submission for the Amazon Q Developer "Quack The Code" Challenge: Crushing the Command Line What I Built Privotron is a command-line automation tool that helps users opt out of invasive data broker databases. It targets the expanding industry of data brokers, which collect, buy, and sell personal information, including home addresses, health conditions, religious or political affiliations, and behavioral profiles, often without meaningful consent. Opting out of these services is legally permitted in many jurisdictions but is intentionally made tedious: websites are inconsistent, forms are buried, and requests often require multiple steps. Privotron automates these processes, using browser automation to simulate human opt-out actions, saving users time and frustration. Privotron is built on a modern Python stack that leverages several powerful libraries for browser automation and configuration management. At its core, the application uses Playwright, a robust browser automation framework that provides cross-browser support and reliable DOM interaction capabilities. The command-line interface is implemented using Click, which enables sophisticated argument parsing and validation with minimal boilerplate code. For configuration management, Privotron employs PyYAML to parse broker-specific YAML files, allowing for declarative definitions of opt-out workflows. The architecture combines declarative configuration with imperative execution, allowing for a flexible and extensible system that can adapt to the varied requirements of different data broker opt-out processes. Crucially, Privotron is designed to be pluggable and community-driven. I've provided a detailed broker contribution guide to make it easy for users to add support for new brokers. The long-term goal is to create a crowd-sourced library of automation plugins. Currently, Privotron has three different data brokers to start. To this end Amazon Q Developer has been instrumental in making this application easy to extend by non-developers, allowing for the use of human-readable YAML "playbooks" that explain exactly how the opt out should work. It also was crucial at helping write clear documentation with meaningful examples. It also automated adding a number of convenience features, like user profiles so users do not have to re-enter their details each time the repo updates with new data brokers. Let's dive in and see how it works! Demo Here is a simple example of what a data broker opt-out form looks like. Many are far more invasive, asking for social security numbers and other sensitive pieces of information. While it doesn't look like much, the goal of Privotron is to fill out as many of these as possible with minimal user intervention. Every broker is unique and it can take a great deal of time to locate and work through each opt-out form, which is one of the main inconveniences Privotron attempts to alleviate. To this end, the CLI asks for some basic information it can combine in various ways to answer the various questions these forms may throw at it. Users give Privotron some personally identifiable information. This data is sensitive and is only used by Privotron to fill in data broker forms, and is only stored if the user requests in a local profile file that they can delete at any time. Upon invoking Privotron with their profile or their information, Privotron will open a web browser and automatically start working through data broker opt out forms. Through clever lists of "actions" in each broker playbook, it fills required fields and handles various buttons and checkboxes. Using the user's own computer and residential IP helps alleviate some of the anti-bot measures these data brokers take, as shown above. I hope in the future to add better support for working through captchas and other anti-bot measures. Many brokers require users to select what records to remove. This requires some manual user intervention to validate the records they want deleted. Privotron will prompt the user and will continue when the user wishes to. This gives broker contributors flexibility in handling sites that have non-deduplicated data where users may come up in various different records they may wish to delete. Below is an example of the simplest opt-out playbook currently in Privotron. It shows how the playbooks are human readable and easy to debug. name: United States Phonebook slug: unitedstatesphonebook url: https://www.unitedstatesphonebook.com/ required_fields: - phone - zip steps: - action: navigate url: "https://www.unitedstatesphonebook.com/contact.php" - action: fill selector: '[name="number"]' field: phone - action: fill selector: '[name="zip"]' field: zip - action: click selector: '[value="Request Removal"]' - action: wait seconds: 5 Code Repository kevinl95 / Privotron F

May 12, 2025 - 04:19
 0
Data Broken - Opt out of the data broker nightmare with Privotron and Amazon Q Developer

This is a submission for the Amazon Q Developer "Quack The Code" Challenge: Crushing the Command Line

What I Built

Privotron is a command-line automation tool that helps users opt out of invasive data broker databases. It targets the expanding industry of data brokers, which collect, buy, and sell personal information, including home addresses, health conditions, religious or political affiliations, and behavioral profiles, often without meaningful consent.

Infographic about Data brokers with the text

Opting out of these services is legally permitted in many jurisdictions but is intentionally made tedious: websites are inconsistent, forms are buried, and requests often require multiple steps. Privotron automates these processes, using browser automation to simulate human opt-out actions, saving users time and frustration.

Privotron is built on a modern Python stack that leverages several powerful libraries for browser automation and configuration management. At its core, the application uses Playwright, a robust browser automation framework that provides cross-browser support and reliable DOM interaction capabilities. The command-line interface is implemented using Click, which enables sophisticated argument parsing and validation with minimal boilerplate code. For configuration management, Privotron employs PyYAML to parse broker-specific YAML files, allowing for declarative definitions of opt-out workflows. The architecture combines declarative configuration with imperative execution, allowing for a flexible and extensible system that can adapt to the varied requirements of different data broker opt-out processes.

Crucially, Privotron is designed to be pluggable and community-driven. I've provided a detailed broker contribution guide to make it easy for users to add support for new brokers. The long-term goal is to create a crowd-sourced library of automation plugins. Currently, Privotron has three different data brokers to start.

To this end Amazon Q Developer has been instrumental in making this application easy to extend by non-developers, allowing for the use of human-readable YAML "playbooks" that explain exactly how the opt out should work. It also was crucial at helping write clear documentation with meaningful examples. It also automated adding a number of convenience features, like user profiles so users do not have to re-enter their details each time the repo updates with new data brokers. Let's dive in and see how it works!

Demo

An example data broker opt-out form, asking for personally identifiable information

Here is a simple example of what a data broker opt-out form looks like. Many are far more invasive, asking for social security numbers and other sensitive pieces of information. While it doesn't look like much, the goal of Privotron is to fill out as many of these as possible with minimal user intervention. Every broker is unique and it can take a great deal of time to locate and work through each opt-out form, which is one of the main inconveniences Privotron attempts to alleviate. To this end, the CLI asks for some basic information it can combine in various ways to answer the various questions these forms may throw at it.

Privotron command line interface help menu

Users give Privotron some personally identifiable information. This data is sensitive and is only used by Privotron to fill in data broker forms, and is only stored if the user requests in a local profile file that they can delete at any time.

Privotron submits an opt-out form and handles an anti-bot measure

Upon invoking Privotron with their profile or their information, Privotron will open a web browser and automatically start working through data broker opt out forms. Through clever lists of "actions" in each broker playbook, it fills required fields and handles various buttons and checkboxes. Using the user's own computer and residential IP helps alleviate some of the anti-bot measures these data brokers take, as shown above. I hope in the future to add better support for working through captchas and other anti-bot measures.

Image description

Many brokers require users to select what records to remove. This requires some manual user intervention to validate the records they want deleted. Privotron will prompt the user and will continue when the user wishes to. This gives broker contributors flexibility in handling sites that have non-deduplicated data where users may come up in various different records they may wish to delete.

Below is an example of the simplest opt-out playbook currently in Privotron. It shows how the playbooks are human readable and easy to debug.

name: United States Phonebook
slug: unitedstatesphonebook
url: https://www.unitedstatesphonebook.com/
required_fields:
  - phone
  - zip
steps:
  - action: navigate
    url: "https://www.unitedstatesphonebook.com/contact.php"
  - action: fill
    selector: '[name="number"]'
    field: phone
  - action: fill
    selector: '[name="zip"]'
    field: zip
  - action: click
    selector: '[value="Request Removal"]'
  - action: wait
    seconds: 5

Code Repository

GitHub logo kevinl95 / Privotron

Framework and tool to make it easier to opt out of data brokers

Privotron

Privotron is an open-source framework and automation tool designed to help individuals reclaim their privacy by opting out of data brokers. Data brokers collect, store, and sell personal information without explicit consent, posing significant privacy risks. Privotron makes the opt-out process easier by automating browser interactions with data broker websites.

Why Privotron?

  • Privacy Protection: Data brokers collect and sell your personal information without your explicit consent
  • Time Saving: Manually opting out of dozens of data brokers can take hours or days
  • Automation: Privotron automates the tedious process of filling out opt-out forms
  • Tracking: Keep track of which brokers you've already opted out from
  • Community-Driven: Easily contribute new broker configurations to help others

Installation

Prerequisites

  • Python 3.13 or higher
  • poetry (for dependency management)

Using Poetry

# Clone the repository
git clone https://github.com/yourusername/privotron.git
cd privotron
# Install dependencies
poetry install

# Install Playwright browsers
poetry run

How I Used Amazon Q Developer

I primarily interacted with Amazon Q Developer through the excellent official extension for Visual Studio Code.

Amazon Q Developer was instrumental in helping add a number of quality-of-life features, as well as helping expand Privotron's "actions", which are the different ways it can interact with a Data Broker's webpage. A good example of this is how, once I got the core of the application running, Amazon Q was able to understand the data I was asking for from users and build me the profile feature that prevents users from needing to re-enter their information. All I needed to do is explain the feature, specify a minor detail that I wanted Click to have a new optional CLI argument, and Amazon Q built the feature for me as you see it in the project today:

Amazon Q describing that it will implement a state file for user profile data using JSON

I also used Amazon Q Developer to help me handle edge cases in browser automation. As you can imagine, broker websites vary widely. I would frequently copy and paste new pieces of broker UI HTML into Amazon Q and it would update Privotron to handle these new edge cases. Here's an example of how it made the state selector action, which handles dropdowns for US states that are common on broker opt-out forms, much more flexible in seconds once I gave it an example of what I was trying to handle:

Amazon Q is prompted with an example of a US state selection dropdown in HTML and says it will adapt the code to handle this kind of UI widget

Here's the mapping it came up with, saving me some tedious manual work:

A mapping of US states to their two-letter abreviations

I was also able to ask it to make convenience functions for me. I already was collecting the user's first and last name, but needed to easily be able to fill in forms asking for the users full name. Amazon Q handled this new convenience action like a champ, and even anticipated that I may want the user's full name listed in the format "Lastname, Firstname" without be even asking!

Amazon Q explaining a new Privotron action that lets the user choose to have a full name entered into an opt-out form, either forwards or backwards

Finally, Amazon Q Developer understood my markdown files and the code well enough that it wrote an excellent broker contribution guide which you can find in the repo right now! It has meaningful examples and describes the various actions Privotron can take on a broker opt-out page, making it the cornerstone of my strategy to crowdsource additional broker opt-out playbooks.

Amazon Q describing how it automatically wrote a broker contribution guide with detailed examples

Amazon Q Developer saved hours of work and automated away the tedious bits of cleaning up a project to show off, putting me much farther ahead with this project than I would have otherwise been. It also anticipated a number of edge cases and conveniences that I likely would not have added in my first cut, making Privotron far more useful in this initial iteration than it otherwise would have been.