The first thing I think of is that this constrains your Point of View [POV] as an author. To be satisfying to the reader, the author must not lie to them. Thus you cannot write from an omniscient point of view (the narrator of the tale knows everything), and you cannot write from the POV of that character (meaning the narrator knows their thoughts and feelings and motivations). You could write from multiple the POV of multiple characters, just not the traitor's POV, because then you would be effectively lying to your reader by concealing their true motivations, and in the end of the story when the traitor was revealed, the reader would feel like you cheated them.
Secondly, you must make sure that your traitor always has a good excuse or good alibi for any action taken that might help the enemy. The 'big mistake' they made that finally reveals their identity must be something the traitor could not have anticipated: for example, Stranger X is somebody the traitor does not know at all. Stranger X is a professional involved in spy craft and on a mission, he happens to see the traitor interacting with Miss Y in an unusual, secretive way, perhaps even an intimate way (e.g. a long hug or kiss). At the time Stranger X thought nothing of that, or thought perhaps a man was with his girlfriend (but why in a gritty alley?). But Stranger X is in the habit of remembering all unusual encounters he may witness during a mission, and this one stuck.
We follow Stranger X once in a while, and a few years later in the normal course of his job he joins the team with the traitor. He recognizes the traitor, the traitor does not recognize him, and then here comes the issue of Miss Y: Finally uncovered as a possible manager of assets in the enemy ranks.
Our traitor pretends he doesn't know her at all, but Stranger X knows he is lying. He hugged her! She manages their informants! The lie raises his suspicions. He starts to keep an eye on the lying traitor. A week later Miss Y turns up dead, and Stranger X realizes he IS the traitor sabotaging the team's efforts, making sure no information could be extracted from Miss Y.
You would have to bring Stranger X into the story in the first Act (I'd say in the first 15% of the story, when readers accept most anything), so this does not appear to be a deus ex machina.
There are other plot mechanisms to get this done, that is just one example. The basic idea is to ensure it is very plausible the traitor could not have known he made any mistakes. The reason for that is again what readers find most satisfying: They do not like villains that get caught because they made stupid mistakes they could have prevented.
In my toss away, the traitor does not know the discovery of Miss Y and her subsequent death has revealed him to Stranger X, and he thinks he got away with eliminating that threat. The traitor relies on his alibis and framing of criminals and the benefit of the doubt from his friends to evade detection. He makes sure there is always somebody else to blame, somebody more plausible, including for the sudden death of Miss Y. So he made NO mistake in eliminating this threat, but was revealed because of a minor mistake a few years before: A romantic liaison with Miss Y, his handler, perhaps even his recruiter (many informants are recruited using sex), and a hug he gave her when they separated.