Dev.to WebDev 🛠 Dev 👁 0 📖 3 min read

I built a housing-ad scanner that only looks for one thing: illegal preferences

FairHousingAdPrecheck does one narrow job. You paste a listing, agent, or social housing ad, and it returns a scored pre-check report: does the copy indicate a preference, limitation, or discrimination based on a protect

FairHousingAdPrecheck does one narrow job. You paste a listing, agent, or social housing ad, and it returns a scored pre-check report: does the copy indicate a preference, limitation, or discrimination based on a protected class? That is the entire scope. I keep repeating "narrow" because the temptation, when you build a compliance tool, is to imply it covers more than it does.

The single rule that drives it

The Fair Housing Act makes it unlawful to state a preference or limitation based on race, color, religion, national origin, sex, familial status, or disability. In practice that shows up as phrasing: "no children", "adults only", "perfect for a single professional", "Christian home", "not suitable for wheelchairs". The detection is mostly pattern work. I maintain a list of high-signal phrases and a second list of softer, context-dependent ones that get flagged for human review rather than auto-failed.

The reason it is a rule list and not a model: the cost of a false negative here is high, and a model will happily explain away "great for a quiet couple" as innocent. A pattern matcher is boring and predictable, which is what you want from a guardrail. A model only summarizes the findings.

What the report covers

The axes are concrete. Protected-class preference: any "no / ideal for / restricted to" wording tied to a group. Familial status: "no children", "adults only", couple-coded copy. Disability: ability screens or a blanket "no pets" with no assistance-animal carve-out. Religion or national origin: faith- or ancestry-coded exclusions. Steering and exclusivity: copy that funnels people toward or away from neighborhoods, plus an Equal Housing Opportunity notice check.

Some of these are clear violations. Some are only risky depending on context — a "no pets" line is fine if the law requires an assistance-animal exception to be stated. The tool separates "this is likely prohibited" from "a human should read this line", and that separation is the point.

An example helps. A line like "perfect for a young professional couple" fires two axes at once — familial status by implying no children, and a soft demographic preference. The report does not decide it is unlawful; it surfaces the line so a human decides. That "surface, don't adjudicate" split is the whole design, and it is why the tool stays useful instead of confidently wrong. You can read the current check logic on the FairHousingAdPrecheck page before pasting anything.

The honest boundary

It only reads what you paste. It does not crawl your site, your agent's Instagram, or your past posts. It does not know state or local ordinances that go further than federal law, and it does not adjudicate whether a flagged phrase is actually unlawful in your situation. A landlord in one city and an agent in another may face different rules I cannot model.

So the output is decision-support. The report tells you which lines to reconsider before you publish; it does not tell you that an ad is lawful. If a listing matters — a real campaign, a client deliverable — the flagged lines go to someone who can give a real opinion. What the FairHousingAdPrecheck scan buys you is catching the obvious mistakes yourself, in the thirty seconds before you hit publish.

FAQ

What kind of wording does it flag?
Phrases that signal a preference by protected class — "no children", "adults only", faith- or ancestry-coded exclusions, and disability screens without an assistance-animal exception.

Is this a legal determination?
No. It is a heuristic pre-check for decision-support, not legal advice. A lawyer should review anything the tool flags before it goes live.

Does it check state and local fair-housing laws?
It focuses on federal Fair Housing Act signals and notes where state or local law may go further, but it does not model those ordinances in detail.

Can it scan my whole website?
No. It checks the single block of text you paste. It does not crawl pages or pull historical posts.

📰 Read the original article on Dev.to WebDev

Originally published by Dev.to WebDev. Aggregated on AIWithGhost for educational purposes — full credit and traffic to the original publisher.