The present invention relates to compounds of formula I or formula Ia or pharmaceutically acceptable salts thereof, that inhibit serine protease activity, particularly the activity of hepatitis C virus NS3-NS4A protease. As such, they act by interfering with the life cycle of the hepatitis C virus and are useful as antiviral agents. The invention further relates to pharmaceutically acceptable compositions comprising said compounds either for ex vivo use or for administration to a patient suffering from HCV infection and processes for preparing the compounds. The invention also relates to methods of treating an HCV infection in a patient by administering a pharmaceutical composition comprising a compound of this invention.