Maturin was involved in wartime espionage and there is a strong suggestion that O'Brian's notorious secrecy derived from his own experience working for the Political Intelligence Department during the Second World War, supplying 'black' propaganda to undermine German morale.
BBC: Patrick O'Brian: Master of the seafaring saga