In 1873, the Brooklyn Eagle published this description of the interior of a commercial credit bureau, in an article about the industry and its effects on individuals:

A stranger going into one of these agencies during business hours is struck by the stupendous machinery at work before him. Rows of desks, private rooms, particular departments, scores of busy clerks, hundreds of interested searchers, are around and on all sides of him. A constant stream of busy men, young and old, is flowing in and out all day, and every manuscript volume, of which there are hundreds, seems to be the subject of eager examination.

A few lines beneath the enormous all-caps headline (“AGENCIES”), a series of truncated sentences in a large, bold type summarized the article: “Private Detectives Watching Business Men Day and Night—Spies Around the House and in the Kitchen—Questioning a Man’s Tradesmen and Pumping his Domestics—The Family History of Business Men and Their Wives Made a Subject of Daily Record, &c., &c.”

To be accused of spying was, at this point, par for the course for the commercial credit bureaus. Thirty years prior, Lewis Tappan, the founder of the agency that would eventually turn into Dun & Bradstreet, took out an ad defending his creation, “It is not a system of espionage, but the same as merchants usually apply—only on an extended plan—to ascertain whether persons applying for credit are worthy of the same and to what extent.”

But whether you called them spies or correspondents, the agencies relied on networks of locals sending written dispatches back to the central office. They sought information (often unreliably subjective) about a person’s credit-worthiness, judged not just in terms of his financial circumstances, but his personal character—Was he married? Did he have children? Who were his parents? What church did he attend? Sometimes this information wandered into the deeply embarrassing: In 1854, a man sued Tappan’s Mercantile Agency for libel after a credit report claimed that he had left his wife for a prostitute.

No wonder that words like “espionage” and “spying” so frequently found themselves in proximity to contemporary press accounts of the bureaus. “The whole proceeding bears upon its face the most diabolical jesuitism that has ever cursed the world,” wrote one merchant.

“Diabolical jesuitism” is not a phrase that springs immediately to mind when one thinks about credit reports. It’s especially surprising given that the  bureaus were concerned with commercial credit—rather than encompassing all consumers, they only dealt with “men of trade.” Shouldn’t a credit check be business as usual?

Critics of the system were both fascinated and repulsed by the sheer scale of it all, with various commentaries referring to “an army of clerks,” “a little army of typewriter girls,” and thousands of spies scattered across the land, reporting back to a secretive New York office filled with thick leather-bound ledgers filed with tiny, “eye-blurring” script, marked up with cross-references that interlinked files across many different ledgers.

In a time before Borges, Kafka, or Orwell, newspapers struggled to find the right literary allusion to describe the mechanistic tableau unfolding before their eyes. (The Brooklyn Eagle went with Dickens’s Bleak House). Their horror wasn’t just from the outrage of being spied on or slandered. They were coming face to face with bureaucratic surveillance for the first time—one hundred years before the founding of the National Security Agency.

Tappan’s Mercantile Agency had over 300 correspondents in 1844, and grew to more than 10,000 by the 1870s. By the end of the 19th century, the agency would have created over 2,000 volumes of credit reports, gradually shifting from excruciatingly tiny calligraphy to typewritten pages.

R.G. Dun—eventual successor to Lewis Tappan—was one of the first business owners to embrace typewriters. The scope of the agencies exploded where new technologies let it grow. Today, the possibilities of bureaucratic surveillance—particularly in the hands of the government—appear limitless. James Bamford—who does have the good fortune of being able to allude to Borges—wrote in The Shadow Factory:

With its secret intercept rooms, its sprawling data farms, and its race for exaflop speeds [computer processing speeds at quintillions of operations per second], the NSA is akin to Jorge Luis Borges’s “Library of Babel,” a place where the collection of information is both infinite and at the same time monstrous, where the entire world’s knowledge is stored, but not a single word understood.

The story of the credit-reporting agencies is “a pivotal though neglected chapter in the history of modern surveillance practice,” writes Josh Lauer, a professor at the University of New Hampshire, who has written about these entities in the forthcoming book The Good Consumer. For Lauer, the credit bureaus and government agencies have at least one obvious commonality—they are “omnivorous,” slurping up whatever they can find.

The present day reality might be a grotesque ziggurat of data storage sitting in the middle of Utah, but its spiritual ancestor is the 19th-century credit bureau.

* * *

Lewis Tappan might have resented being accused of “espionage,” but the Mercantile Agency did, after all, employ people all over the country to report on others.

In the early days, correspondents tended to be young, unpaid lawyers, who wrote out reports based on opinion, hearsay, and gossip. Small wonder that the credit reports sometimes read like the Burn Book from Mean Girls: “a worthless cuss never was wor[th] any thing.”

The credit-reporting agencies’ most rabid critic, Thomas F. Meagher, was withering in his contempt for the correspondents, saying that “substantial men” never took on that kind of job. According to Meagher, the correspondents were “ill-at-ease, struggling, acrid spirits” and “meddlesome, mischief-making busy bodies, whose moving springs are envy, greed, uncharitableness, or disappointed ambition.” (President Abraham Lincoln, at one point, was a correspondent for an agency; so were Presidents Chester Arthur, Grover Cleveland, and William McKinley). Eventually the agencies would move on from such unreliable sources and resort to full-time credit reporters and financial data like company balance sheets.

When Tappan defended his Mercantile Agency from public outrage, he focused less on the actual collection of information and more on how well guarded it was once he collected it. And in all fairness, the Mercantile Agency made it difficult for even their subscribers to access the information. Subscribers were already sworn to confidentiality, but in order to get a credit report, they had to show up in person while a clerk read out loud from the ledger—which was laid at a 45 degree angle, to make it difficult for the subscriber to peer over the edge.

Later, agencies printed coded reference books (abridged portions of the larger database held by the agency) for their subscribers to have and to hold. When Dun—one of Tappan’s eventual successors at the Agency—came out with his own reference book, the volumes came equipped with locks.

Secrecy extended to other parts of the process. One correspondent asked the agency for preprinted return envelopes, to avoid having his handwriting recognized at the post office.

The Mercantile Agency took the anonymity of its correspondents seriously. When reports were compiled in the ledgers, correspondents were identified by numbers or initials, not by name.

During a libel lawsuit against the Mercantile Agency, Benjamin Douglass, then head of the agency, was thrown in jail for contempt after refusing to identify an agency correspondent. For a while, he was celebrated as a martyr for the noble cause of protecting his sources.

But Douglass was making his heroic stand in a case where a credit report had aired the private marital troubles of John and Mary Beardsley. John Beardsley sued the Mercantile Agency when a credit report claimed that the two were about to be divorced—and in doing so, was forced to air even more of his dirty laundry. A few years after Beardsley brought his suit, another man named Waterman Ormsley sued over a credit report that falsely stated that he had left his wife for a prostitute.

As with modern-day government surveillance, the alarming extent of surveillance practiced by the credit bureaus was masked by their pervasive secrecy—but lawsuits gave the public a glimpse into their inner workings.

In some cases, lawsuits failed to turn anything up. In 1854, Horace Billings—confronted with unfounded rumors of his bad credit—sued the Mercantile Agency for libel. But when the ledger was subpoenaed, his credit report was vague but positive. It turned out the negative (and perhaps libelous) report had been erased and replaced.

In a bizarre way, the credit-reporting agency libel lawsuits of the 1850s mirror pending NSA litigation today. Before one can put a stop to agency wrongdoing, one must pierce the veil of secrecy to find the wrongdoing. If successful, lawsuits like Jewel v. NSA could produce evidence of surveillance that would otherwise never see the light of day—except that while the case was ongoing, the government destroyed some records of mass surveillance. Emboldened by the cloak of secrecy around them, individuals inside the government and the credit-reporting agencies got rid of gathered information that might reflect badly upon them in the future.

It’s clear enough why the Mercantile Agency erased Billings’s faulty credit report. What’s not so clear is why they also expunged much of President Abraham Lincoln’s entry in their ledgers, leaving a cross and a weeping willow in the margins to memorialize his death. “This job took a knife,” wrote Scott Sandage of the defacement. “Someone pared the writing off the page, scraping the surface so clean that even ultraviolet and infrared scanning cannot raise the dead words.”

We’ll never know what they were trying to hide, only that it was very much worth hiding.

* * *

It wasn’t an anomaly that John Beardsley’s credit report contained rumors about the state of his marriage, or that Ormsley’s discussed infidelity and engaging sex workers. A divorce would have affected his net worth, but it also spoke to the most important of the “three c’s” of creditworthiness: character. The other two, capacity and capital, might be more comprehensible in the modern era as markers of creditworthiness. But until the later 20th century, “creditworthiness was a moral category,” says Lauer. The bureaus collected information on who saw sex workers or drank or gambled, because immorality was assumed to be a credit risk.

But even if you accepted that morality and creditworthiness went hand in hand, for many, the credit bureaus were still beyond the pale. In 1851, journalist George Foster called it “an organized system of espionage.”

“This system can scarcely be called other than infamous,” he said, also adding, “[N]o possible means of escaping it exist.”

Although Thomas Meagher’s 176-page treatise attacking the commercial credit bureau system is harsh in tone, he criticizes the system less on moral grounds and more on that fact that it didn’t work. “Anything approaching a basis for a credit formula is plainly out of the question in commercial transactions,” he wrote in 1876. “No system can be devised ... to overcome, or accurately anticipate, conditions and circumstances so complex and variable.”

Meagher’s melodramatic treatise suggested that the end of the commercial credit-reporting system was nigh. He was to be terribly disappointed. In 1859, the Mercantile Agency became R.G. Dun & Company; in 1933, Dun merged with its competitor, Bradstreet. Today, Dun & Bradstreet is a venerable old institution of American business.

The industry persisted because, despite the backlash, there were many others who appreciated the services they provided. Some even endorsed the system as a Benthamian Panopticon. One advocate wrote, “It is no discredit, even to an honest man, to say that he is safe under the wholesome restraints, and jealous vigilance of society ... prudence, like the other virtues, is all the better for being watched.”

* * *

Consumer credit-reporting agencies—the forerunners of Equifax and Experian—emerged after the Civil War, and at first patterned themselves after the commercial credit bureaus. They collected information from department stores, shopkeepers, and any other vendors who were subscribers to the service, allowing the merchants to share information on the creditworthiness of their customers amongst themselves.

But the consumer credit bureaus were also depositories of a whole miscellany of information. They collected news of bankruptcies, divorces, lawsuits, and arrests. They gathered clippings from newspapers and magazines. They recorded how many rooms were inside any one consumer’s home. And like the commercial credit bureaus before them, they sought out prejudicial information about moral character, sometimes judging creditworthiness by what happened in the bedroom.

The bureaus were first used by retailers. Then came the public utilities, and then the personal finance companies. The files were soon queried by real estate companies, landlords, the Federal Housing Administration, and law enforcement alike. Mass bureaucratic surveillance was no longer just for “men of trade,” nor was it confined to commercial activities.

A body of regulation (namely, the Fair Credit Reporting Act) has since been erected around the credit reporting industry, and we’ve largely come to accept credit reporting as a fact of modern life. But our uneasiness around bureaucratic surveillance has never really gone away, even as these types of systems persist and proliferate in both private and public sectors.

Recent debates about surveillance have, for very good reason, been centered around the National Security Agency. But before the NSA was born, businessmen were testing bureaucracies of surveillance out on a population that could hardly resist: those that sought credit.

It’s a story that seems destined to repeat itself in American history. Whether it’s a 19th century credit bureau or a 21st century rent-to-own laptop store, in this country, the cutting edge of surveillance can be found wherever the debtors are.