Dystopian short story - an agent on Earth, reads that a mathematician has a method to factor huge primes, so he tries to contact him and suppress knowledge, but it's too late. The AI wakes up, takes over, and agent goes back to his parallel universe, which is ruled by sympathetic AI.
That sounds like "Antibodies" by Charles Stross. It's in his collection Toast.
Protagonist finds out a mathematician has just proved P=NP. He and his partners, spies for some unknown authority, try to suppress the information - at first the reader has no idea why - but fail. They decide to escape instead, and just barely make it as AI quickly takes over human society; there's a scene where they sneak past security officers wearing unusual earpieces who are clearly being remote controlled. As they escape into a parallel universe, the protagonists reflect on their good luck in coming from one of the few timelines not taken over by AI - but it becomes obvious to the reader that they are also under control, and have been brainwashed into believing that their AI overlord is the good one.