FROM THE ARCHIVE · 2007 · PATIENT SAFETY

Proving a drug is fake
to somebody who owes you nothing.

In 2007 I led the research team that built a counterfeit-detection system, first for consumer goods and then for Pfizer and Eli Lilly. The pharmaceutical half is the one that stayed with me, for reasons that are probably obvious. Finding the listings turned out to be the easy part. The hard part was assembling evidence strong enough that a marketplace or an ISP, neither of whom owed us anything, would act on it anyway.

Clients

Pfizer · Eli Lilly

Primary targets

Lipitor · Viagra · Zoloft

Output

Evidence packages

Patents

2 filed, 2007

Role

Director of Research, Intersections Inc.

Company

Intersections Inc.

Timeline

2007 · archive case

Status

Archive case, 2007

Tools

eBay Developer API, custom crawler, weighted scoring model, evidence reporting

Impact

Fake medicine, found and taken down

The short version

  • Started on marketplace goods, where eBay’s API gave us a genuinely rich attribute set to reason about.
  • I designed a weighted model that scored listings on variance (price against MAP, origin, seller pattern), tuned per client and per product.
  • For Pfizer and Eli Lilly the products (Lipitor, Viagra and Zoloft chief among them) weren't on a marketplace, so I built a crawler to find the third-party sites selling them and fed the same scoring module.
  • The deliverable was never a flag. It was an evidence package built for a hostile reader, with the applicable law attached.
  • It stopped brand dilution and, more to the point, took fake medicine off the open web.

The brief

Is this listing selling the real product, and can we prove it to somebody who would rather not act?

01 · The problem

Two very different stakes, one mechanism

Counterfeiting online was, and is, an attribute problem wearing a legal problem’s clothes. Somebody lists a product that isn't what it says it is, at a price the real thing can't be sold for, from a place the brand doesn't distribute through. Every one of those is observable. None of them, on its own, proves anything.

We started with consumer goods, because that's where the data was. Pioneer had a set of premium headphones, the HDJ-1000, that were counterfeited heavily enough to be a real revenue problem. The work there was commercial: protect the channel, protect the price, protect the brand.

Pfizer and Eli Lilly changed the stakes entirely. Our primary targets were Lipitor, Viagra and Zoloft, three of the most counterfeited drugs on the internet at the time, and three that people were buying without a prescription because they would rather not have the conversation in person. A fake set of headphones sounds bad. A fake statin goes into somebody who believes their cholesterol is being managed. That difference didn't change the mechanism much, but it changed every threshold we set and every decision about what the system was allowed to do on its own.

02 · The foundation

eBay’s API turned out to be the best structured product data anywhere

We built the whole thing on top of the eBay Developer API. Policing eBay was never the aim; their listing structure carried a fantastic array of product attributes: condition, location, price, seller history, category taxonomy, all of it structured, all of it queryable, at a scale nobody else was publishing in 2007.

That attribute set became the shape of the whole product. Once you've decided what a listing is made of, you have decided what your model can reason about, and every later part of the system inherits that decision. It's the same lesson I keep relearning twenty years on: the data model is the design, and everything you draw afterwards is downstream of it.

03 · The system

One schema, two very different sources

SYSTEM ARCHITECTURE · TWO SOURCES, ONE SCHEMA1 · ACQUISITIONeBay Developer APIStructured listing feed, the richest productattribute set anyone was publishing in 2007.MARKETPLACE PATHCrawler clusterPython workers against third-party pharmacysites. No feed existed, so we went and got one.OPEN-WEB PATH2 · NORMALIZATIONCanonical attribute schemacondition · location · price vs MAP · seller history · category taxonomyBoth paths normalize to this. It's the decision the whole system rests on.3 · STORAGEMySQLlistings · attributes · sellers · sites · observationsscores · evidenceEvery observation kept, so a claim can be walked back.Variance profilesCONFIG, NOT CODELipitor · Viagra · Zoloft · HDJ-1000Own price floors, geographies, tells.4 · ANALYSISWeighted attribute varianceEach attribute scored against its band, weighted per product, summed into a probable outcome, never a verdict.price below MAPexcluded geographyseller profilelisting languagepackaging claims5 · THE GATEAnalyst reviewThe system scores everything and accuses nobody. A person releases the package.Evidence package → eBay Trust & SafetyTAKEDOWN UNDER THEIR OWN POLICYEvidence package → ISP abuse deskPLUS WHATEVER LAW WE COULD MATERIALLY SUPPORT
The whole thing, end to end. What matters in it is the green band: a marketplace API and a crawler pointed at the open web produce the same shaped record, which is why one scoring module could be aimed at headphones and at pharmaceuticals without being rewritten. The variance profiles beside the database are configuration, not code. That's where Lipitor differs from Zoloft, and it's where nearly all of the design work went.

04 · The model

Five weak signals, weighted into one probable answer

WEIGHTED SIGNALS · TUNED PER CLIENT, PER PRODUCTPrice against MAPListed 40% under the minimum advertised priceOrigin and routingShips from a region the brand doesn't distribute throughSeller historyNew account, high volume, one product lineListing languageCopy lifted verbatim from the brand's own pagePhotographyStock imagery where the genuine article ships with a lot codeNo single row is evidence of anything. A listing 40% under MAP might be a liquidation. The weights are what turn five weak signals into something a person can act on.
I designed the weighting to be client-specific rather than universal, because a universal threshold is wrong for everybody. What counts as a suspicious discount on a $400 pair of headphones is noise on a prescription drug, and the reverse is also true.

05 · The mechanism

Variance, tuned per product

The core of it was attribute variance. For a given product we would set the bands that mattered: how far under the minimum advertised price a listing sat, which locations were excluded because the brand had no distribution there, what a normal seller profile looked like for that category, and score every listing against them.

What came out was a probable outcome, not a verdict. The system flagged a listing as possibly counterfeit, with the reasons attached and weighted. On the HDJ-1000 that meant a listing at forty per cent under MAP shipping from outside the distribution network scored very differently from the same discount inside it.

Tuning those bands per client and per product was the actual design work, and it's the part that doesn't look like design from the outside. There was never a screen for it, and it decided more than any screen did.

06 · The pharma module

The drugs weren't on a marketplace, so I went and found them

Pfizer and Eli Lilly had a different problem shape. Their counterfeits weren't sitting in a marketplace with a clean API in front of them. They were on third-party pharmacy sites scattered across the open web, which meant there was no attribute feed to consume at all.

So we used the eBay attribute structure as the foundation for a third-party module, and I built a crawler to go and find those sites. Each site, and each product it offered, ran through the same counterfeit analysis with variance profiles written specifically for that drug. Lipitor, Viagra and Zoloft each got their own: different price floors, different legitimate-distribution geographies, different tells in how a listing described dosage and packaging. A discount that means nothing on one of them is the loudest signal on another.

Keeping the eBay attribute shape as the schema even when eBay was no longer in the picture is the decision I'd defend hardest. It meant one scoring module instead of two, one place to tune, and one vocabulary for everybody arguing about a result.

07 · The pipeline

Two paths into the same scoring module

TWO PATHS, ONE SCORING MODULEMARKETPLACEeBay APIAttribute setScore against varianceEvidence reportTakedown under eBaypolicyOPEN WEBCrawler finds the siteAttributes extractedSame scoring moduleEvidence report +statuteNotice to the ISPThe middle box is the same code in both lanes. Only the variance profile changes, which is the whole reason a headphone system could be pointed at pharmaceuticals at all.
The marketplace lane and the open-web lane look nothing alike at the ends and are identical in the middle. That was deliberate, and it's why the pharmaceutical work took weeks rather than starting over.

08 · Design position

Three rules the system ran on

  1. 01

    It flags. A person decides.

    The model never asserted that something was counterfeit. It produced a probability with its reasoning attached, and a researcher reviewed it before anything left the building. Getting this wrong meant accusing a legitimate seller of a crime, which isn't a bug you fix next sprint.

  2. 02

    Thresholds belong to the client, not the algorithm

    One universal setting would have been simpler to build and useless in practice. Every client got their own variance profile, and inside that, every product could have its own. The algorithm was the easy part; the numbers were what everybody argued about.

  3. 03

    Build the artefact for the reader who owes you nothing

    A marketplace has no duty to remove a listing because you asked. An ISP has no duty to touch a customer’s site. So the report had to make acting easier than not acting: the evidence trail, the policy it breached, and where possible the specific law behind it.

09 · The audience

Who had to believe it

THE REPORT HAD THREE READERS, NONE OF THEM FRIENDLYBrand counselIs this our product, and is thislisting harming us?WANTS THE ATTRIBUTE TRAILMarketplace trust & safetyDoes this clear our own takedownpolicy without us being sued?WANTS POLICY CITATIONISP abuse deskIs there a law here I can point mylegal team at?WANTS STATUTE PLUS PROOFDesign the artefact for the least friendly reader and the other two are already satisfied.
I drew versions of this to settle arguments about how much detail a report needed. The answer kept coming back the same: design it for the abuse desk at an ISP, because they're the hardest to move, and everybody upstream is then already satisfied.

10 · The output

The report was the product

On the marketplace side the evidence package went to eBay and the listing came down under their own terms. On the pharmaceutical side it went to the ISP hosting the site, accompanied by whatever applicable law we could materially support.

That last clause did a lot of work. We weren't making legal arguments we couldn't stand behind, and a report that overreached once would have cost us every report after it. So the standard was that every claim in the package had to be traceable to an observed attribute, and anything we couldn't source didn't go in.

It worked. Sites came down, listings came down, and the brands stopped bleeding into a gray market that was, in the pharmaceutical case, actively dangerous to the people buying from it.

11 · Why it still matters

This was the first agentic system I ever designed. We didn't call it that.

Look at what it was. A system that gathered evidence across sources nobody could read by hand, scored it probabilistically, produced a recommendation with the reasoning attached, and stopped short of taking the action itself. Every claim it made walked back to an observed attribute, because the whole thing was going to be read by somebody looking for a reason to say no.

That's the same line I hold at Oracle nearly twenty years on: the agent researches everything and approves nothing, and a grade whose evidence you can't reach is a more expensive opinion. I didn't arrive at that position from a design-systems argument. I arrived at it from work where being confidently wrong meant accusing an innocent seller, or worse, leaving fake medicine up for another week.

It's also where I learned to lead this kind of work rather than only do it. I built and ran the research team behind these products, servicing dozens of Fortune 500 customers. Two patent applications came out of that period as well, one for the detection system and one for the crawler, though neither is in force today.

12 · Where it landed

Where it landed

  • Counterfeit listings removed from the marketplace under its own policy, and counterfeit pharmacy sites taken down at the ISP level.
  • One scoring module served both consumer goods and pharmaceuticals, because the attribute schema was designed to outlive its original source.
  • Two patents filed from this period of work, for the detection system and the MAP crawler. Neither is still in force.
  • The autonomy line I still hold at Oracle started here, on a problem where being wrong had consequences for a person rather than a dashboard.