A method and system for preventing undesired behaviors by executable code
modules in a peer-to-peer computer system are provided. When a code
module is received, an assembly inspection module queries a blacklist for
the received code module. When the received code module is found on the
blacklist, the computer system prevents execution of the received code
module. Each peer includes an assembly inspection module. When the
received code module is not found on the blacklist, the assembly
inspection module inspects the received executable code module, prior to
execution, to determine whether the code module can perform any undesired
behaviors. If so, the received code module is added to the blacklist and
prevented from executing.