First and foremost, keep your men happy and “inspired”.
After the Iron Curtain came down there were stories of secret police who had switched sides long ago, to spy for the dissidents. In one case, a Czechoslovakian spy-master was secretly running messages from the dissidents and underground chooches to the west, and ensuring the replies got through by using his own government-paid border couriers.
I know, it’s hard. Reality has a way of undermining certain doctrines (eventually).
“Consent of the Governed” has its limits
When the Chernobyl nuclear plant exploded, thousands rounded on the nearest government agent or informant saying “You should investigate those guys” indicating negligent party bosses and similar risk takers. Not only did the secret police realize everyone knew who they were but with the threat of imminent death from radiation, no one was afraid of them. People were begging to be sent to Siberia where the was no threat of radiation. They were thrown out of shops, refused services, and came home to find their locks glued up. The Party was beaten and they knew it.
Keep your enemies close. And always look both ways before crossing the street
There was a dissident in the 1980’s who was being regularly tracked by the secret police. One day he noticed he lost his tail. He doubled back to find that the spy had jaywalked to catch up and had been run over by a car. The dissident got the man to the hospital, paid a bribe for proper care, and contacted his family (since he knew the man’s name). The two men are the best of friends today.
Some dissidents manage to influence even the secret police
In Hungary after the fall of communism one dissident announced a ran for government office. Fifty people showed up the first day to help. Most were former secret police assigned to watch him over the years. They all wanted to help. Some could quote his secret samizdat newsletters by heart!
Obvious, but easy to forget
The greatest thing a dictator must fear is his own men. Once they switch sides it’s all over.