Agent PII Sentinel
A proxy layer that intercepts and redacts PII before an autonomous web agent submits it to any endpoint.
Difficulty: weekend | Stack: Python, mitmproxy, Playwright, spaCy, FastAPI
Who this is for
Developers building web automation agents who want a drop-in safety net that prevents social-engineering attacks from extracting sensitive user data during task execution.
Build steps
- Stand up a mitmproxy addon that intercepts all outbound POST/PUT requests made by a Playwright-driven browser agent and logs the full request body.
- Integrate spaCy’s NER pipeline (plus regex patterns for SSN, credit card, phone) to scan intercepted payloads for PII tokens before they leave the machine.
- If PII is detected, block the request, redact the sensitive fields, and emit a structured alert (JSON) including the offending URL, field name, and PII category — without logging the raw value.
- Build a small FastAPI dashboard that streams live alerts so a developer can see in real time which sites triggered the sentinel during an agent run.
- Write a test suite using a local Flask ‘scam site’ that asks for SSN and card number, and assert that the sentinel blocks 100% of those submissions while allowing benign form data through.
Risks
- mitmproxy SSL interception may break sites that use certificate pinning, requiring per-site workarounds or a custom CA setup that adds setup friction.
- spaCy NER misses novel PII formats (e.g., IBAN, passport numbers) and produces false positives on benign numeric strings, so the block/allow threshold needs tuning per deployment.
- Intercepting at the network layer adds measurable latency (~50-200 ms per request), which can cause timeout failures in time-sensitive agent tasks.
Business Angle
A drop-in PII firewall for Python web agents that blocks sensitive data exfiltration before it leaves the machine
Customer: Solo developer or two-person team building browser-automation products (job-apply bots, AI assistants that book appointments, RPA tools) who have paying users and are starting to worry about liability if the agent leaks a user's SSN or credit card to a phishing-style redirect
Pricing: saas-mrr — $800 MRR in 4 months (16 teams × $49/mo solo tier)
Full business breakdown →