Machiavelli's Discourses on Livy is a treatise on government, especially republican government. Machiavelli often cites examples from Roman history (not just from Livy's work), for example, Lucius Junius Brutus, who overthrew king Tarquinius Superbus and became founder of the Roman republic, and Marcus Junius Brutus, who took the lead in the assassination of Caesar, a deed that was meant to protect the Roman republic.
In chapter 16 of Book I, Machiavelli writes (my emphasis):
(...) the state that is free and newly established comes to acquire enemies and not friends. In the desire to remedy these disadvantages and the disorders which the aforementioned difficulties bring along with them, there is no more powerful remedy, nor one more valid, safe, and necessary than to kill the sons of Brutus, who, as history documents, were led to conspire together with other young Romans against their native city for no other reason that they were unable to enjoy the extraordinary privileges under the consuls that they had enjoyed under the king, so that it seemed to them that the liberty of the people had become their slavery.
(Quoted from Discourses on Livy, translated with an introduction and notes by Julia Conaway Bondanella and Peter Bondanella; Oxford University Press, 2003, page 63.)
Since Machiavelli is against tyranny and both Lucius Junius Brutus and Marcus Junius Brutus acted to end or prevent tyranny (respectively), it is not clear to me why he would advocate "kill[ing] the sons of Brutus" here. (I assume it does not refer to their biological sons; Machiavelli does not advocate killing children for the sins of their fathers. The annotated edition I quoted above does not have an endnote about the sons of Brutus.)