In a nutshell, Fritz Leiber invented the Thieves’ Guild, and D&D pilfered it. As for where Leiber got the inspiration, we can certainly speculate.
The OG Thieves’ Guild is located in the city of Lankhmar, where Fafhrd and the Gray Mouser (the OG fantasy rogue) operate. It’s first mentioned in the short story “Thieves’ House” (1943), which was later republished in the collections Two Sought Adventure (1957) and Swords Against Death (1970). Ankh-Morpork and its own Thieves’ Guild (which hilariously operates like a proper historical guild, recognised and regulated by the state) is inspired by Lankhmar, too.
“The house had a bad reputation. People said it was the den in which the thieves of Lankhmar gathered to plot and palaver and settle their private bickerings, the headquarters from which Krovas, the reputed Master Thief, issued his orders—in short, the home of the formidable Thieves’ Guild of Lankhmar.”
The Guild is powerful, merchants pay tribute to it, and Krovas the guildmaster just hates it when independent thieves attempt to make a buck, too. In the story, said independent thieves are our (anti-)heroes, Fafhrd and the Gray Mouser. And that notion of a trade monopoly obviously comes from historical guilds, whose entire point was that no one was allowed to practice a trade unless they were members of the relevant guild.
So where did Fritz Leiber get the idea of a Thieves’ Guild? We can’t know for sure, but his parents were Shakespearean actors and he was into Elizabethan theatre, and do you know the book The Rogues and Vagabonds of Shakespeare’s Youth? If Leiber did, he knew rogue literature, and that explains both Thieves’ Guilds (not the term, just the content, the term is all his) and Thieves’ Cant.
English rogue literature is an early modern (rather than anything medieval) and largely urban genre, which appears around 1600 with pamphlets describing the wicked ways and language of beggars, thieves, and conmen, all out to get the upstanding, respectable, and all too gullible good people of (usually) London. Around 1700, the first cant dictionaries appear, and Daniel Defoe’s Moll Flanders (1722) is probably the first novel of the genre. Meanwhile, there are a lot of plays that are at least inspired or informed by it, from Shakespeare himself to John Gay’s The Beggars’ Opera.
Now, if we take the early Elizabethan pamphlets at face value (and we should NOT, since all our sources were outsiders who aimed to shock – and titillate! – their law-abiding audience), thieves and beggars were organised in associations or fraternities with strict hierarchies. There were ranks and offices, and elaborate initiation rites and oaths to the devil, and codes of conduct and chains of command, and even kings of thieves with prima nocta privileges. And lots and lots of greed.
Most of that is bullshit, it’s made up or wildly exaggerated. Some of it makes a lot of sense, though, if you take out the fanciful stuff. A certain level of organisation is necessary for urban crime to work. After all, thieves need fences and beggars need real estate (I mean, they need to call dibs on their spots and somehow ensure that other beggars will respect that). And we should keep in mind that rogues (people without masters) and vagabonds (people without homes) were a world apart from respectable society: not only did they not enjoy whatever protections the state extended to its subjects, but they were considered criminal elements merely for existing without masters and without homes. So their only recourse was each other. A fraternity where all the thieves of London somehow worked together is mere fancy, but there was certainly a lot of mutual aid (if you were lucky) and internal exploitation (if you weren’t).
As we move on to the 1700s, London’s criminal underworld booms as much as the city itself, and the pamphlets (and now the newspapers!) have plenty of material to talk about. And for a hot second, there arguably is a thieves’ guild, run by a sinister guildmaster, a criminal mastermind who controls the thieves of London with one hand – and with the other, serves law-abiding people and retrieves their stolen property for but a small fee. His name is Jonathan Wild, and like Lankhmar’s Krovas, he hates it when independent thieves try to make a living in his city. And also he’s an utter bastard.
The infamous Thief-Taker General and his elaborate organisation may have been an inspiration for Fritz Leiber’s Thieves’ Guild, or perhaps it was second-hand from Professor Moriarty, who was also partly inspired by Jonathan Wild.
The Court of Miracles
In 1939, four years before “Thieves’ House” was published, a very important film came out: The Hunchback of Notre Dame. It included a colourful depiction of the Court of Miracles “where the scoundrels of Paris collect in a lair”, to quote another version. That must have been an influence, so let’s see what it was about.
The Court of Miracles really existed in Paris, and it wasn’t just one, there was a whole mess of them in the general vicinity – except that all this was happening in the 17th century and Victor Hugo took some liberties and projected it back to the 14th. And what he described was a heavily mythologised version of the real thing.
The real thing was, more or less, a collection of slums. It’s where the excess of people went in a city whose population had just exploded. Paris had become a sprawling metropolis again, coming back from the disasters of plague and war, and attracting people from all over. So where will all the rejected and marginalised go? It’s quite simple: if there’s no housing they’ll make a shanty-town and shack up there, and if there’s no jobs they’ll resort to begging and petty crime. What else are they supposed to do? Meekly starve? Fuck you, they won’t.
Out of that reality, we got a mythologised literary version of the Court of Miracles, much like the rogues of England were treated in the pamphlets. Again we read about complex hierarchies, a Prince of Thieves and a King of Beggars, elaborate initiation rites, and a secret thieves’ cant – the argot. And crucially, this underworld has a space of its own: a lair, a den, a headquarters. This feature doesn’t appear in English rogue literature, but Leiber’s Thieves’ Guild has it (it’s in the title!), and so does any D&D-related or inspired thieves’ guild, so I think it’s not a stretch to attribute it directly to the Court of Miracles.
The 1939 film, inheriting Victor Hugo’s anachronisms and liberties, portrays the Court of Miracles as a single, fixed, and secret place in the middle of medieval Paris (which had abruptly become the largest city in western Europe in the 1300s, but then the Black Death hit). The portrayal is stunning and memorable. The scene where the hapless Gringoire is asked to demonstrate his thieving skills by balancing on one leg on a stool and pickpocketing a mannequin full of little bells is iconic. This is the stuff that inspires whole genres, and I believe it did exactly that. The roguish side of Sword & Sorcery and Dungeons & Dragons owes a lot to English rogues and vagabonds, but we shouldn’t overlook their enormous debt to The Hunchback of Notre Dame.
Meanwhile, in 17th century Istanbul, the Thieves’ Guild (“the corporation of thieves and footpads who… pay tribute to the two chief officers of the police”) and the Beggars’ Guild (which had a “sheikh”, i.e. a leader, a guildmaster) once joined a very official procession of the guilds on the city streets. Or at least, that’s what The Book of Travels says. But all the research I’ve read about Ottoman guilds considers this passage uncovincing. There certainly may have been thieves and beggars in the procession, but they didn’t have a legally recognised guild – an esnaf.
Spanish picaresque novels had been around since the mid-16th century, and Cervantes describes something like a thieves’ guild in Seville. A French jargon of thieves, along with assorted poetry and literature, is attested from the 15th century. Rogue characters/anti-heroes appear in Arabic literature from the 9th century, and the early emergence of big cities in the Islamic world leads to various associations of thieves and beggars in places like Cairo and Baghdad. A loose co-fraternity of rogues, the Banu Sasan, pops up in every corner of the Arabic world, from al-Andalus to India.
There’s a lot of material out there, and I barely scraped the surface. Our earth is big and rogues are the salt of the earth, and wherever there’s property there’s also thieves, and whenever a city raises domes and spires to the heavens, that city’s outcasts will converge to its underbelly and mingle and, well, associate. It’s only natural. If you decide to include a Thieves’ Guild in your D&D setting, your character backstory, or your worldbuilding, you can draw inspiration from anywhere, as long as you know where to look and are willing to do a bit of digging.
However, I don’t think Leiber or Gygax were too familiar with… most of that. So as far as the D&D origins of Thieves’ Guilds are concerned, I believe we should stick to Fritz Leiber, English rogue literature, the Court of Miracles, and whatever kernel of historical truth lies behind them. And there you have it.