I'm not absolutely sure but I think you can't. What you could do, of course, would be to put a firewall in place that disables external access to the IM ports. Newer firewalls are able to recognize IM traffic even if it goes over common ports like 80 and 443, and can stop it even then. That's what I do.
Of course, one irritating little "feature" is that the same protocol for Yahoo! messenger seems to be used for authentication for signing into Yahoo! webmail, so if I kill one (at least with my firewall) I kill both. . .
