There is actually some historical precedent.
In 18th century London, a man named Jonathan Wild set up a thieves guild, where he would return stolen property to the rightful owner for a fee.
This quote from a book published in 1878
In the republic of the thieves' guild Jonathan Wild became as it were a dictator; but like many of the great Jonathan Wild men ...
Privateers were, in reality, government approved thieves, at least to the time of Queen Elizabeth. If the terms of the question permit the theft of another nation's shipping, cargoes, and payment.
So in literature, you may be looking at (checks date) arrr, pirate tales, me hearties!
Robinson Crusoe (1719) would probably NOT count, as a solitary shipwrecked ...
Consider Mark Twain's The Prince and the Pauper of 1881/2.
In medieval London, Twain has one of his main protagonists learn a lot from meeting a well-organised bunch of thieves, whether or not they're specifically named as a "guild."
Specifically "earliest" I know not, though.
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? ...