Blue
Ravenous Bugblatter Beast of Traal
There is a milking rule. I don't have my copy of the DMG at work with me, but look under "poison" (in the index) for the page reference. From memory, it's a DC 20 Nature check to successfully gather poison from a target creature. If the check is failed by 4 or less, the attempt fails. If the check fails by 5 or more, the "milker" is exposed to the venom.
Thanks! I had missed that.
If I was DM'ing the warlock above, I'd maybe allow the "milking" check to be rolled with Advantage (assuming the imp was co-operative...), but I doubt I'd forgo it altogether. I'd also make sure the imp grows to resent being used in the purpose. After a few successful attempts, it begins laying plans to make the warlock suffer...
Why? Does the Beastmaster Ranger's companion get upset for being put into dangerous situations and turn on the ranger? The extended familiar is a class feature, what other class gets betrayed for using a class feature?
If you don't want it milked, don't pretend it's okay and then twist it. Just say no upfront, don't pretend it's okay to the player. Here's a reason you could use: "Sorry, it's a summoned familiar, the poison dissipates quickly after leaving the body, just like the body dissipates if it 'dies' so you can bring it back."
Players shouldn't get intentionally misinformed about the mechanics of their class. NPCs and the rest of the world, go for it. But be upfront with players about their character.