The former adviser to Boris Johnson said that he and the then-prime minister were told about a breach in 2020.