The question is difficult to answer due to its terms of reference. Usually it’s not possible to tell exactly where a given story lies on the continuum from “full endorsement” to “begrudging acceptance”. Governments are made up of many people, some of whom may be complicit with the thieves and some not. Did Tammany Hall “fully endorse” the gangs of New York? Did the Kingdom of Naples “fully endorse” the mafia of Sicily? Pratchett can have Vetinari endorse the Thieves’ Guild of Ankh-Morpork because he’s writing a satire and exaggeration is a satirical technique, but in other contexts we wouldn’t expect to see anything so explicit.
So what I’m going to do is change the terms of reference and look instead at the history of the phrase “Thieves’ Guild” and how it became popularized in fantasy fiction so that Pratchett found it a suitable target of satire. The “thieves’ guilds” of Ankh-Morpork are first mentioned in The Colour of Magic (1983), so we have to look for sources before that date.
I think the idea of an official or quasi-official “Thieves’ Guild” in fantastic settings was popularized by the Advanced Dungeons & Dragons role-playing game. A “Thieves’ Guild” was mentioned in the 1978 Players’ Handbook and the concept was expanded in later manuals.
The Thieves Guild is an accepted part of communal society, and so long as they contain their activities to cutting purses, picking pockets, burglarizing homes, waylaying late-night revelers, all is well.
Gary Gygax (1978). Players’ Handbook, p. 30. Random House.
Thieves occasionally form guilds, especially in major cities and places with a strong sense of law and order. In many cases, they are forced to cooperate merely to survive. Influential thieves see guilds as a way to increase their own profits and grant them the image of respectability. They become dons and crimelords, directing operations without ever having to dirty their hands.
At the same time, the membership of a thieves' guild is by definition composed of liars, cheats, swindlers, and dangerously violent men and women, Thus, such guilds are hotbeds of deceit, treachery, and back-stabbing (literally). Only the most cunning and powerful rise to the top.
Gary Gygax (1989). Dungeon Master Guide, 2nd edition,† p. 19. Random House.
† The 2nd edition is too late to have influenced Pratchett, but there may have been similar wording in the first edition (1979). Let me know if you have a copy and can confirm or deny!
Gygax took inspiration from various works of fantasy literature, for example the magic system comes in large part from the story ‘Mazirian the Magician’ (1950) by Jack Vance. Another of his influences was the ‘Lankhmar’ series of fantasy stories by Fritz Leiber (the influence is explicit, for example the 1980 Deities and Demigods supplement includes the fictional pantheon from Leiber’s series). The Thieves’ Guild is mentioned briefly in Leiber’s story ‘The Two Best Thieves in Lankhmar’ (1968):
[…] the intersection of Silver Street with the Street of the Gods, a crossing-point where there habitually foregathered the junior executives and star operatives of the Thieves Guild; also meeting there were the few free-lance thieves bold and resourceful enough to defy the Guild and the few thieves of aristocratic birth, sometimes most brilliant amateurs, whom the Guild tolerated and even toadied to, on account of their noble ancestry, which dignified a very old but most disreputable profession.
Fritz Leiber (1968). ‘The Two Best Thieves in Lankhmar’. In Swords Against Wizardry, p. 79. New York: Ace.
The guild becomes an important plot element in the story ‘Ill Met in Lankhmar’ (1970).
Almost the first law of the Thieves’ Guild was never kill the hen that laid brown eggs with a ruby in the yolk, or white eggs with a diamond in the white.
Fritz Leiber (1970). ‘Ill Met in Lankhmar’. In Swords and Deviltry, p. 170. New York: Ace.
In The Colour of Magic, Pratchett acknowledged his debt to Leiber, by parodying the latter’s heroes (Fafhrd and the Gray Mouser) as “Bravd and the Weasel”, and he also gave a nod to Dungeons & Dragons by having Bravd “fumble the initiative” when he first appears. (In Dungeons & Dragons, “initiative” is the privilege of moving first in a round of combat, and to “fumble” is to roll a low number with humorous or disastrous consequences.) The biographer Marc Burrows says that Pratchett was familiar with the game prior to The Colour of Magic:
Pratchett was no stranger to Dungeons and Dragons and played locally with friends, often acting as dungeon master. The game excited him, and he considered it to be an entirely new artform: here was a way to make fiction interactive and turn narrative into competition. Among the familiar gorgons, ogres and magic spells he would create his own characters and settings […] One of his inventions was called the Luggage
Marc Burrows (2020). The Magic of Terry Pratchett, p. 89. White Owl.
So if Pratchett got “Thieves’ Guild” from Gygax and Leiber, and Gygax got it from Leiber too, where did Leiber get it from? Well, there seem to be two sources in English. First, from Luke Owen Pike’s history of the remarkable Jonathan Wild:
In the republic of the thieves’ guild Jonathan Wild became as it were a dictator; but like many of the great men of the middle ages, he owed his greatness to double-dealing. From small beginnings he became, in London at least, the receiver-in-chief of all stolen goods. He acquired and maintained this position by the persistent application of two simple principles; he did his best to aid the law in convicting all those mis-doers who would not recognise his authority, and he did his best to repair the losses of all who had been plundered and who took him into their confidence. By degrees he set up an office for the recovery of missing property, at which the government must, for a time, have connived. Here the robbed sought an audience of the only man who could promise them restitution; here the robbers congregated like workmen at a workshop, to receive the pay for the work they had done.
Luke Owen Pike (1873). A History of Crime in England, p. 256. London: Smith, Elder.
“Thieves’ guild” seems to have been Pike’s coinage and not used by Wild and his contemporaries, but the term was copied from Pike into subsequent works on criminology, for example:
Jonathan Wild is an interesting example of a criminal of great practical ability, a man whose genius for organisation would have made him equal to any position in which he might have been placed. “In the republic of the thieves’ guild”—I quote Mr. Pike’s excellent summary of his career—“Jonathan Wild became as it were a dictator”
Havelock Ellis (1890). The Criminal, p. 136. London: Walter Scott.
The second source for the term, and the more likely route for Leiber to have picked it up, comes from descriptions of organized crime in China:
Almost every large village, certainly every town, has its Thieves’ Guild, the members of which are generally known, and are always on good terms with the police.
North China Herald (24 August 1883), p. 223.
[…] the approach of the annual feast of the Thieves’ Guild, which takes place about this time. The place of meeting is not public but it is always well-known some time before. And did the Inspector of Police wish to arrest he could do so. He will probably not make any arrests until his annual fee has been paid him by the Guild.
North China Herald (15 January 1897), p. 59.
This made its way into China-set literature in the early 20th century:
“Rich?” Tang smiled bitterly. “Nine times these past two years have I been taxed for this business; five bags of silver have I given to the militarists. I work as hard as does any coolie. I pay a large squeeze to the Thieves’ Guild, and another to that of the beggars, that their members may let me alone.”
Elizabeth Foreman Lewis (1932). Young Fu of the Upper Yangtze, p. 182. Philadelphia: John C. Winston.
For the river ships were full of professional thieves. When they became so great a pest that business was lessened because of them, the owners of the vessels paid the thieves’ guild a certain sum of money to stay off the ships for a while.
Pearl S. Buck (1936). Fighting Angel, p. 125. New York: Reynal & Hitchcock.
An early occurrence in science fiction is in a 1961 story by Cordwainer Smith, who had served in China in the war.
Bozart was not trained against deception by a technician; it never occurred to the Thieves’ Guild back on Viola Siderea that it would be necessary for their own people to resist deceivers.
Cordwainer Smith (1961). ‘Mother Hitton’s Littul Kittons’. In Galaxy, June 1961, p. 107.
Another early adopter was Andre Norton:
If a man could raise the price to buy into the Thieves’ Guild and so open a door out of this rat hole, Stowar was the negotiator.
Andre Norton (1964). Night of Masks, p. 12. New York: Harcourt, Brace & World.