There is nothing in the film that establishes that Shockwave is working for Megatron/Sentinel Prime or is even a Decepticon at all. He attacks Prime and NEST in Chernobyl, which conflicts with the Decepticons plan for the Autobots to revive Sentinel Prime. In the Chicago battle, Shockwave appears to be a loner and has no back up from any other Decepticons. He never gets involved with the plan to bring Cybertron to Earth or the invasion. It seems like he has his own agenda. We don't know what it is, which adds to his mystery.