The OSA was updated in 1989 and came into force in 1990. It doesn't talk about enemies, merely disclosure that would harm UK interests. And there is a defence in the Act that talks about not knowing that disclosure would be detrimental to UK interests.
It's complex, and it's late. Read the
Act.
Strikes me that there's a bit of media shorthand going on. Spies and enemies are easy to describe.