The most important phase of his career opened in 1808, when the emperor Alexander I took him with him to the Congress of Erfurt and put him into direct communication with Napoleon, who described him as the only clear head in Russia and at the instance of Alexander had many conversations with him on the question of Russian administrative reform. Speransky's projects of reform envisaged a constitutional system based on a series of dumas, the cantonal assembly (volost) electing the duma of the district, the dumas of the districts electing that of the province or government, and these electing the Duma of the empire. As mediating power between the autocrat and the Duma there was to be a nominated council of state.
This plan, worked out by Speransky in 1809, was for the most part stillborn, only the council of the empire coming into existence in January 1810; but it nonetheless dominated the constitutional history of Russia in the 19th century and the early years of the 20th. The Duma of the empire created in 1905 bears the name suggested by Speransky, and the institution of local self-government (the zemstvo) in 1864 was one of the reforms proposed by him. Speransky's labors also bore fruit in the constitutions granted by Alexander to Finland and Poland.
Alexander was also an idealist, but his ideals were apt to centre in himself; his dislike and distrust of talents that overshadowed his own were disarmed for a while by the singular charm of Speransky's personality, but sooner or later he was bound to discover that he himself was regarded, as but the most potent instrument for the attainment of that ideal end, a regenerated Russia, which was his minister's sole preoccupation. In 1810 and the first half of 1811 Speransky was still in high favor, and was the confidant of the emperor in that secret diplomacy which preceded the breach of Russia with Napoleon.
He had, however, committed one serious mistake. An ardent freemason himself, he conceived in 1809 the idea of reorganizing the order in Russia, with the special object of using it to educate and elevate the Orthodox clergy. The emperor agreed to the first steps being taken, namely the suppression of the existing lodges; but he was naturally suspicious of secret societies, even when ostensibly admitted to their secrets, and Speransky's abortive plan only resulted in adding the clergy to the number of his enemies.
On the eve of the struggle with Napoleon, Alexander, conscious of his unpopularity, conceived the idea of making Speransky his scape-goat, and so conciliating that Old Russian sentiment which would be the strongest support of the autocratic tsar against revolutionary France. Speransky's own indiscretions gave the final impulse. He was surrounded with spies who reported, none too accurately, the ministers somewhat sharp criticisms of the emperor's acts; he had even had the supreme presumption to advise Alexander not to take the chief command in the coming campaign.
A number of persons in the entourage of the emperor, including the grand duchess Catherine, Fessler, Karamzin, Rostopchin and the Swedish general Baron Armfield, intrigued to involve him in a charge of treason. Alexander did not credit the charge, but he made Speransky responsible for the unpopularity incurred by himself in consequence of the hated reforms and the still more hated French policy, and on the 17th-29th of March 1812 dismissed him from office.
Reinstated in the public service in 1816, he was appointed governor-general of Siberia, for which he drew up a new scheme of government, and in 1821 entered the council of state. Under Nicholas I, he was the head of the Second Section of the Imperial Chancellery, engaged in the vital codification of the Russian law (published in 1830 in 65 vols. of some 800 pages each), on which he also wrote some important commentaries. This codification, called the 'Full Collection of Laws' (Polnoje Sobranije Zakonov), was presened to Nicholas I and formed the basis for the 'Collection of Laws of the Russian Empire' (Svod Zakonov Rossiskoj Imperii), the positive law valid for the Russian Empire. Speransky's liberal ideas were subsequently scrutinised and elaborated by Konstantin Kavelin and Boris Chicherin.