A bond or deposit shall not be required of the commonwealth or any officer or employee thereof represented by the attorney general, or of a county, city, town or other municipal corporation, or of a board, officer or employee thereof represented by the city solicitor, town counsel or other officer having similar duties, or of a political subdivision, or of a party who has given bond according to l