Rosetta was built in a clean room according to COSPAR
rules, but "sterilisation [was] generally not crucial since
comets are usually regarded as objects where you can find
prebiotic molecules, that is, molecules that are precursors
of life, but not living microorganisms", according to
Gerhard Schwehm, Rosetta's project scientist.
See also the Committee on Space Research (COSPAR) Target Categories:
This will be especially true for instruments that are designed to find such compounds. It would be fairly embarrassing to send the probe into space, only to notice that apparently interplanetary space is full of organic compounds no one else has ever seen ...
https://en.wikipedia.org/wiki/Planetary_protection#Target_ca...