Beginning in 1821, he was an adherent of the Carboneria; later he joined the Giovane Italia of Giuseppe Mazzini in 1831, and actively participated in the revolutions of 1848, of 1859 and of 1870. He was named captain of the "Stato Maggiore" by Giuseppe Garibaldi during the Second Roman Republic, as shown by two letters from Garibaldi himself (29 February and 29 March 1849), of whom he became a close friend. After the fall of the Republic, Rosi was captured by the authorities and remained for three years in jail. He was later imprisoned again, after his new involvement in the activism for the Italian unification. He was with Garibaldi again in 1867, and after the capture of Rome in 1870 he finally moved to Rome, where he lived until his death.