ed from engaging in by clause (a), or (d) a partner of a state employee who knowingly acts as agent or attorney for anyone other than the commonwealth in connection with any particular matter in which the commonwealth or a state agency is a party or has a direct and substantial interest and in which the state employee participates or has participated as a state employee or which is the subject of