Recalled to Russia in 1811 and briefly dismissed from the service, in 1812 he was appointed ambassador to Sardinia in Turin, where he remained until 1816. During the brief peace between France and Russia after the signing of the Treaties of Tilsit in 1807, Kozlovsky helped a group of French officers escape English captivity, for which he was awarded the Cross of the Légion d'honneur by the Emperor Napoleon Bonaparte. He was closely involved in the negotiations on the demarcation of the frontiers between Switzerland, France, and the Kingdom of Sardinia and was also a minor member of the Russian delegation to the Congress of Vienna (1814–1815).