I don't believe Guilty Spark was necessarily going against its prime task. As best as I can tell, AIs were also programmed to obey Reclaimers to some degree, and they almost always answered questions they were asked. As such, Guilty Spark shows them how to turn off the Halo, but warns them against it repeatedly, and takes no specific action to do so.
From the transcript of the Halo 2 level The Great Journey, found at Halo Nations:
Tartarus: "Come, human, it is easy." (He tries to get Miranda to insert the Index) "Take the Icon in your hands... (growls impatiently) And do as you are told!" (He slams the Index on the console, which flashes red lights)
343 Guilty Spark: "Please, use caution! This Reclaimer is delicate."
Here Spark appears to only be concerned that Keyes will be damaged before fulfilling the activation of the ring.
Thel 'Vadam: (to Guilty Spark) "The Sacred Rings, what are they?"
343 Guilty Spark: "Weapons of last resort, built by the Forerunners to eliminate potential Flood hosts, thereby rendering the parasite harmless."
Thel 'Vadam: "And those who made the rings? What happened to the Forerunners?"
343 Guilty Spark: "After exhausting every other strategic option, my creators activated the rings. They and all additional sentient life within three radii of the galactic center, died, as planned."
Here, he specifically tells them what the rings do, but does not make a recommendation as to what Vadam and the others should do.
343 Guilty Spark: "Charging sequence initiated. Primary generators coming online."
Commander Keyes: "Well, shut them down!"
343 Guilty Spark: "Apology. Protocol does not allow me to interfere with any aspect of this sequence."
Commander Keyes: "Then how do I stop it?"
343 Guilty Spark: "Well, it will take some time to go over the proper procedures, I—"
Commander Keyes: "Quit stalling!"
343 Guilty Spark: "Under more controlled circumstances, I would suggest the Reclaimer simply remove the Index."
343 Guilty Spark: "Secondary generators charging. All systems are performing well within operational parameters."
Commander Keyes: "You're telling me that you cannot stop the sequence?"
343 Guilty Spark: "Reclaimer, please understand that interrupting the wave generation process will severely damage this installation."
Commander Keyes: "Give me a direct answer!"
343 Guilty Spark: "I am but a Monitor. The Reclaimer can do as it likes."
343 Guilty Spark: "Power generation phase complete. The installation is ready to fire. Starting final countdown."
Sergeant Johnson: "Come on, Arbiter! Kick that guy's ass!"
343 Guilty Spark: "Firing sequence initiated. And may I say, Reclaimers, it has been a pleasure to serve you both. Goodbye."
And for this, the remaining portion of the battle, he gives (only somewhat) helpful tips, and seems gleeful in reporting the process of the ring's activation. Again, he does not make any steps to stop the ring himself, and even tries to stall in giving an answer until he is pressed further. It does not appear that 343 Guilty Spark acted against the wishes of the Forerunners in this instance.