A coded letter from 1809, sent under the orders of Napoleon Bonaparte to one of his senior generals, has been decrypted using artificial intelligence after more than two centuries of remaining a mystery. The letter, written by Eugène de Beauharnais, Napoleon’s stepson, was addressed to General Auguste de Marmont, who was stationed in the region of modern-day Croatia during the lead-up to conflict between France and the Austrian Habsburg Empire.

The message, which had been indecipherable due to the loss of its original cipher key, contains approximately 1,300 characters including symbols representing letters and archaic terms. The letter was intercepted before the outbreak of the war between France and Austria and provides detailed intelligence on troop deployments, strength estimates, and strategic advice.

Carter Church, an AI engineer at cybersecurity firm SentinelOne, reported successfully using OpenAI’s advanced model GPT-6 Astra to unlock the contents of the letter. The AI system worked for six hours, drawing on partial progress made by earlier cryptographers who had identified 33 of the characters. The decryption employed a computational technique known as simulated annealing, which involves iterative trial and error to test potential word combinations. The AI’s approach also involved comparing the decoded text with other writings by Eugène de Beauharnais to improve accuracy.

The letter urged General Marmont not to be deterred by minor enemy forces, stating that Austria was vulnerable to coordinated attacks on multiple fronts. One passage reads: “Austria will be attacked at once on every side. She is consequently hastening towards her ruin.” Marmont’s forces were encouraged to prepare to march promptly in support of the French campaign. Ultimately, Marmont’s army broke out of Croatia and played a significant role in Napoleon’s victory at the Battle of Wagram, after which Marmont was promoted to the rank of marshal.

Church noted that while the decryption process could theoretically have been done by hand, it would have been a painstaking effort that had eluded cryptographers for over 200 years. He was inspired by previous AI work, including the decryption of an unsolved 1941 German Enigma message by a different developer using the same AI platform.

The successful application of GPT-6 Astra to historical cryptography highlights the growing capabilities of artificial intelligence in decoding complex codes and solving mathematical challenges, tasks that traditionally require labor-intensive human effort. This breakthrough also opens new avenues for historians attempting to unlock historically significant but inaccessible documents.