Dumb question: is there an insurance service to ensure a company against errors made by their own software developers?
And if you're contracting you'd better make sure you have indemnity insurance yourself: it's something software engineers who start freelancing often (always?) overlook. But you can bet that if - for example - some security breach was pinpointed to code that you had written as a freelancer that your client will come after you.