Keep a counter on each shopkeeper representing the number of times a pet has picked up a shop-owned item in their shop (or a shop-owned item inside containers they are carrying). Every time this increments, use it as an increasing chance that the shopkeeper will become aggressive towards pets picking up their wares, with messages like “Kabalebo shouts “Hey! Drop that!” at Fluffy. Fluffy drops [item].” Once they are past that point, you can’t use pets to take their items anymore.

The point on the counter at which the shopkeeper stops playing nice should be roughly some fraction of the area of the shop, to strike a balance between large shopkeepers being more lenient and not allowing you to clean out all the tiny shops in Minetown. A rumor could be added for this: “They say that mom-and-pop stores have lower tolerance for thieves.”

Unspecified whether the counter should increment when a non-pet picks up an item in the shop. Probably not, since this is a fairly rare case.