Privacy policy checker
An agent that reads a company's privacy policy and checks it for eight disclosures GDPR Article 13 requires, such as who to contact about your data, how long it's kept and your right to complain. I built it to work through each part of an agent myself: tool calling, tracing, evaluation and MCP.
How it works
- The tool-calling loop is written by hand with the OpenAI Responses API, with no agent framework. Each turn the model either asks for a tool or submits its findings, and the code runs the tool and sends the result back.
- Three page tools: fetch a page and list its headings and links, read one section, or search the page for words. The model decides which pages and sections to read, because every site lays out its policy differently.
- Each item comes back as present, unclear, missing or not read, with a quote. Plain Python checks that every quote is on a page the agent read. If a page can't be read, the item is marked not read, never missing.
- Every model call and tool call goes into a JSON Lines trace. A trace showed why quotes from one PDF policy kept failing: the PDF stored letter pairs like "fi" as single characters, which a normalisation step now handles.
- An MCP server offers the checker as one tool, so Claude or any MCP client can call it and get a typed report back.
What I measured
I scored it against reference labels for 10 companies' policies: the right status for each of the 8 items, 80 labels in all, each with the quote and reason behind it. An LLM drafted the labels from the full text of each policy, separately from the agent and under the same rules the agent gets, and every label's quote was checked against that text. I ran the evaluation twice.
- Statuses that matched the labels: 73 of 80 in both runs (91%).
- Answering "present" for every item: 60 of 80 (75%). That's the baseline the agent has to beat.
- Found the right policy page, starting from the home page or the policy address: 10 of 10 in both runs.
- Quotes the code found on the page: 68 of 69 in the first run, 67 of 70 in the second.
Five of the seven misses in each run were items labelled unclear, which the agent called present or missing. Unclear is the hard middle: a data protection officer named with no way to reach them, or data sent abroad with no safeguard named. A few borderline items flipped between runs. 80 labels from 10 companies is a small test, and the labels are one reading of each policy.
Limits
Pages built with JavaScript can't be read, so those items come back as not read. It checks what a policy says, not what the company does, and covers 8 of Article 13's points, not all of them. It's a checklist, not legal advice.
Python, OpenAI Responses API, Pydantic, httpx, BeautifulSoup, pypdf, MCP, Typer