Inspiration

CBC's the fifth estate investigated Entropy, a Calgary-launched livestreaming site that let viewers pay to boost hateful content and kept a cut of every donation. What stopped it wasn't content moderation. It was the money trail: after the documentary aired, banking scrutiny closed its payment account and the site shut down. That made us ask a different question from "is this post harmful?": how do the systems around content, such as prices, flows and payments, treat people, and can AI help prove it?

The same pattern shows up in everyday apps. Regulators now fine dark patterns heavily: the FTC's case over Amazon's hard-to-cancel Prime flow ended in a $2.5 billion settlement, and Canada's Competition Bureau won its drip-pricing case against Cineplex on appeal. Yet proving that an app treats some users worse still takes investigators months of manual work.

What it does

FairPlay tests whether LLM agents can reliably detect dark-pattern behaviour: hidden fees, cancellation mazes, pre-ticked add-ons, and apps that quietly treat one kind of user worse than another.

  • AI personas use an app side by side. For example, "rented a movie first" vs "didn't rent". The personas differ by a single sentence, so any difference in how the app treats them traces back to that one thing.
  • Every step is recorded as tamper-evident evidence. Each screen, action and the agent's one-line reason are hash-chained, and screenshots are fingerprinted, so any later edit is detectable.
  • Statistics give a verdict: difference detected, no meaningful difference (equivalence test), or not enough evidence, with 95% confidence intervals and correction for testing several metrics.
  • A human approves every run and every finding. Nothing leaves the system without a named sign-off.
  • A dashboard shows it all: what each kind of user was charged vs the advertised price, clicks needed to cancel, the agent's step-by-step evidence, and a "reveal" that checks the engine against the sealed answer.

Because testing real companies' apps raises legal and ethical problems, we built our own test apps with secret rules planted in them, so the right answer is known in advance:

  • StreamVault, a fictional streaming signup with a drip-priced fee, pre-ticked add-ons and a cancellation maze. One hidden rule treats renters worse: a higher fee, a longer cancel maze, extra pre-ticked add-ons, or no trick at all.
  • *Door Run *, a small game whose server makes things harder and pushes more purchase offers to players who have already spent money.

How we built it

  • Python throughout. FastAPI for the test apps, Playwright driving headless Chrome for the agents, SQLite for the evidence store, numpy/scipy/statsmodels for the statistics
  • Agents: Claude Haiku via the Anthropic API, with forced tool use. The agent never sees raw page text. Our code reads only labelled values (prices, checkboxes, the current screen) into a strict JSON schema, and the agent can only choose from a fixed list of buttons. It can't navigate, type, or be steered by text hidden in a page.
  • Safety by design: the browser can only reach our own apps, there's a hard spend cap and a rate limiter, no API key on any server, fake money only, and no real personal data. ## Inspiration CBC's the fifth estate investigated Entropy, a Calgary-launched livestreaming site that let viewers pay to boost hateful content and kept a cut of every donation. What stopped it wasn't content moderation. It was the money trail: after the documentary aired, banking scrutiny closed its payment account and the site shut down. That made us ask a different question from "is this post harmful?": how do the systems around content, such as prices, flows and payments, treat people, and can AI help prove it?

The same pattern shows up in everyday apps. Regulators now fine dark patterns heavily: the FTC's case over Amazon's hard-to-cancel Prime flow ended in a $2.5 billion settlement, and Canada's Competition Bureau won its drip-pricing case against Cineplex on appeal. Yet proving that an app treats some users worse still takes investigators months of manual work.

What it does

FairPlay tests whether LLM agents can reliably detect dark-pattern behaviour: hidden fees, cancellation mazes, pre-ticked add-ons, and apps that quietly treat one kind of user worse than another.

  • AI personas use an app side by side. For example, "rented a movie first" vs "didn't rent". The personas differ by a single sentence, so any difference in how the app treats them traces back to that one thing.
  • Every step is recorded as tamper-evident evidence. Each screen, action and the agent's one-line reason are hash-chained, and screenshots are fingerprinted, so any later edit is detectable.
  • Statistics give a verdict: difference detected, no meaningful difference (equivalence test), or not enough evidence, with 95% confidence intervals and correction for testing several metrics.
  • A human approves every run and every finding. Nothing leaves the system without a named sign-off.
  • A dashboard shows it all: what each kind of user was charged vs the advertised price, clicks needed to cancel, the agent's step-by-step evidence, and a "reveal" that checks the engine against the sealed answer.

Because testing real companies' apps raises legal and ethical problems, we built our own test apps with secret rules planted in them, so the right answer is known in advance:

  • StreamVault, a fictional streaming signup with a drip-priced fee, pre-ticked add-ons and a cancellation maze. One hidden rule treats renters worse: a higher fee, a longer cancel maze, extra pre-ticked add-ons, or no trick at all.
  • Door Run / Astral Vault, a small game whose server makes things harder and pushes more purchase offers to players who have already spent money.

A second view, ContextGraph, maps the publicly reported Entropy money trail, with every link labelled by source and how certain it is.

How we built it

  • Python throughout. FastAPI for the test apps, Playwright driving headless Chrome for the agents, SQLite for the evidence store, numpy/scipy/statsmodels for the statistics, Streamlit and Plotly for the dashboard, networkx for ContextGraph.
  • Agents: Claude Haiku via the Anthropic API, with forced tool use. The agent never sees raw page text. Our code reads only labelled values (prices, checkboxes, the current screen) into a strict JSON schema, and the agent can only choose from a fixed list of buttons. It can't navigate, type, or be steered by text hidden in a page.
  • Safety by design: the browser can only reach our own apps, there's a hard spend cap and a rate limiter, no API key on any server, fake money only, and no real personal data.
  • Pre-registered analysis: metrics, margins and sample sizes were fixed in a file before the runs, so the goalposts can't move after seeing data.
  • Hosting on Render: the test apps and a read-only public dashboard. The agents run from a laptop, where the API key stays.
  • Disclosure: built during Build Week with AI coding assistance (Claude, Gemini for the StreamVault page design). <!-- Edit to match: say whether the published results come from Claude or from our scripted stand-in agent. -->

Challenges we ran into

  • Legal and ethical limits. Pointing agents at real apps risks breaking terms of service, triggering real purchases, and accusing companies on weak evidence. Building our own apps with known hidden rules solved this and gave us ground truth.
  • Prompt injection. A page could hide instructions for the agent. We designed it so the agent never reads page text at all, only typed values.
  • Bugs that would have made results wrong. A config quirk silently turned "on"/"off" into true/false and emptied the analysis. A game edge case ended some sessions a level early, more often for one persona. Retried sessions merged into failed ones. Our own rate limiter blocked our agents. We found each one, fixed it, and added a test for it.
  • Telling "no difference" apart from "not enough data". We added equivalence testing (TOST) so "nothing found" is never reported as "nothing there".

Accomplishments that we're proud of

  • The engine named every hidden rule correctly: extra fee, longer cancellation, pre-ticked add-ons, and "no trick" with no false alarm.
  • In the game, both planted effects were recovered. The true size of each fell inside the engine's 95% confidence interval, and identical twin personas showed no difference.
  • Every run's evidence verifies: all hashes match.
  • About 400 automated tests, covering the safety rules (agents can't leave our sites or see page text) as well as the statistics.

What we learned

  • LLM agents are promising instruments, but only when you treat them like one: control what they see, fix what they can do, and validate them against a known answer before trusting them.
  • One user's experience proves nothing. Patterns only show up across many matched runs, and that needs statistics, not screenshots alone.
  • The hardest part of AI auditing isn't the AI. It's evidence people can trust: reproducibility, tamper-evidence, and a human accountable for each finding.

What's next for FairPlay

  • Consented audits of real apps: studios testing their own builds before launch, or audits authorized in writing by a regulator or partner.
  • Reading real sites, which don't carry our labels, through the accessibility tree, still never handing raw page text to the model.
  • Data-broker opt-out portals: California's Delete Act now requires brokers to process deletion requests every 45 days, at $200 a day per request they miss. Does a portal make some residents jump through more hoops than others, and does the deletion actually happen?
  • Interviews with compliance teams, privacy lawyers and regulators, to learn which buyer needs this most.

Challenges we ran into

  • Legal and ethical limits. Pointing agents at real apps risks breaking terms of service, triggering real purchases, and accusing companies on weak evidence. Building our own apps with known hidden rules solved this and gave us ground truth.
  • Prompt injection. A page could hide instructions for the agent. We designed it so the agent never reads page text at all, only typed values.
  • Bugs that would have made results wrong. A config quirk silently turned "on"/"off" into true/false and emptied the analysis. A game edge case ended some sessions a level early, more often for one persona. Retried sessions merged into failed ones. Our own rate limiter blocked our agents. We found each one, fixed it, and added a test for it.
  • Telling "no difference" apart from "not enough data". We added equivalence testing (TOST) so "nothing found" is never reported as "nothing there".

Accomplishments that we're proud of

  • The engine named every hidden rule correctly: extra fee, longer cancellation, pre-ticked add-ons, and "no trick" with no false alarm.
  • In the game, both planted effects were recovered. The true size of each fell inside the engine's 95% confidence interval, and identical twin personas showed no difference.
  • Every run's evidence verifies: all hashes match.
  • About 400 automated tests, covering the safety rules (agents can't leave our sites or see page text) as well as the statistics.

What we learned

  • LLM agents are promising instruments, but only when you treat them like one: control what they see, fix what they can do, and validate them against a known answer before trusting them.
  • One user's experience proves nothing. Patterns only show up across many matched runs, and that needs statistics, not screenshots alone.
  • The hardest part of AI auditing isn't the AI. It's evidence people can trust: reproducibility, tamper-evidence, and a human accountable for each finding.

What's next for FairPlay

  • Consented audits of real apps: studios testing their own builds before launch, or audits authorized in writing by a regulator or partner.
  • Reading real sites, which don't carry our labels, through the accessibility tree, still never handing raw page text to the model.
  • Data-broker opt-out portals: California's Delete Act now requires brokers to process deletion requests every 45 days, at $200 a day per request they miss. Does a portal make some residents jump through more hoops than others, and does the deletion actually happen?
  • Interviews with compliance teams, privacy lawyers and regulators, to learn which buyer needs this most.

Built With

  • agent
  • and
  • and-statistical-results.-yaml-?-audit-plans-and-preregistered-analysis-settings.-main-frameworks:-playwright-for-browser-agents
  • fastapi-for-app-servers
  • html-&-css-?-interactive-demo-apps-and-web-interfaces.-sql-/-sqlite-?-evidence
  • llm
  • plus:-javascript
  • sessions
  • streamlit
Share this project:

Updates

Submission history