Section 2. If the title of the commonwealth is founded on a forfeiture for breach of a condition in a grant or conveyance by the commonwealth or by the province or colony of Massachusetts bay, no action for the recovery thereof shall be commenced unless by direction of the governor, with the advice and consent of the council; but in all other cases the attorney general or district attorney may prosecute an action therefor if he believes that the claim of the commonwealth can be established.