Earlier quoted context omitted.
How? The printer only ever retrieves G code for individual parts without any knowledge of what they are going to be assembled into. There is no viable way to solve this classification problem on this kind of incomplete data, is there?
It’s not nearly that hard of a problem. There are n gun files on internet, so validate the hash of those n files (g code whatever). These people aren’t cadding their own designs.
And the printer doesn't really know what the model is. It would have to reverse the gcode instructions back into a model somehow. The printer isn't really the place to detect and prevent this sort of thing imo. Especially with how cheap some 3d printers are getting, they often don't really have much compute power in them. They just move things around as instructed by the g-code. If the g-code is malformed it can even break the printer in some instances, or at least really screw up your print.
There are even scripts that modify the gcode to do weird things the printer really isn't designed for, like print something and then have the printer move in such a way to crash into and push the printed object off the plate, and then start over and print another print. The printer will just follow these instructions blindly.