A former software engineer at a prominent California law firm was sentenced Wednesday to two years in prison for insider trading by a Manhattan judge who noted that he should have realized the dangers of his actions when one of his firm’s lawyers was arrested on the same charges in a separate prosecution.

Dimitry Braverman, 42, of San Mateo, California, was sentenced after pleading guilty to securities fraud last November. Prosecutors say he earned more than $300,000 illegally from September 2010 through December 2013.