Goa'uld attempt to destroy Starbase Atlantis

The Goa'uld attempt to destroy Starbase Atlantis was an operation by the Trust in 2380 as part of a campaign by the Goa'uld during the Federation-Wraith war.

Prelude
The System Lord Ba'al sought refuge in Seattle, Earth and took control of the The Trust after the Battle of Dakara. Where Ba'al was discovered hiding on Earth by the newly Free Jaffa Nation, which it leader Gera] set out to capture Ba'al and thereby grip on the hearts and minds of the Jaffa. But in fact it only was a clone of his that was killed. As the real Ba'al along with his clones were still at large. Leading to the Trust (under the control of Ba'al) to conduct a plot to destroy Starbase Atlantis in mist of the Federation-Wraith war to prevent the Wraith from trying to gain access and culling the human worlds of the Milky Way galaxy while Ba'al attempted to take control of the Jaffa High Council to influence control over the new nation.

The attempt
Due to transmissions picked up from members of The Trust, Agent Malcolm Barrett of the NID alerts Stargate Command of a Trust plan to destroy Starbase Atlantis on the next scheduled dial-in through a planted bomb. The SGC manages to make contact with the Daedalus which is on route back to Earth by sending SG-5 to P4M-399 and warns them of the plan so they can relay the message to Atlantis. The Daedalus, pushing its warp drive to the limits, manages to get into range of Starbase Atlantis and warn them just in time of the threat, stopping the dial-in at the last second. The Daedalus is recalled to help with the investigation while the team looks for the operative who they believe to be human as he's supposed to be a low-level member of the Trust. Due to the suspicious activities of Dr. Peter Kavanagh, he becomes the prime suspect in the case. At the same time, the NID raids a Trust compound and finds computers with some further intelligence on the plan. They don't learn much as the data is cryptic, but they do learn that there's no transmitter on Earth to detonate the bomb, that its something on the Atlantis end that will cause the bomb to detonate. Dr. Meredith Rodney McKay discovers that the starbase's Zero Point Module failsafes had been disabled and that dialing Earth would have caused the ZPM to overload and explode. In order to reverse this, the command code of the person responsible is needed. The city's systems have also been programed to help this happen, trying to dial Earth which is unsuccessful due to the Stargate'scontrol crystal being removed while at the same time broadcasting a brief distress message with Atlantis' transmitter to draw two nearby Wraith cruisers in order to force the city to be cloaked to give it another opportunity for an overload.

The Wraith then appeared above Atlantis and the city must be cloaked to avoid detection. However, the inertial dampeners of the starbase suddenly activate which causes the ZPM to overload. Starbase Atlantis will be destroyed in roughly 30 minutes. The senior staff then decides to evacuate the people of Starbase Atlantis to a planet in the same solar system where they found the crash-landed Wraith ship and it is at this point that Dr. Weir authorizes the torture of Kavanagh. While all the preparations are being done for evacuation, Teyla and Beckett conduct the Ring Ceremony for the dead Charin, during which Teyla sings for her.

With no other choice and unable to use the Stargate, the Daedalus and the starbase's Puddle Jumpers take the expedition to the Light Bugs' Planet, the nearest inhabitable planet in the Lantean system. Seeing no other option, Dr. Elizabeth Weir reluctantly agrees to let Ronon Dex torture the information out of Kavanaugh, but he faints before Ronon can start. At the same time, Lieutenant Laura Cadman discovers two deletions in the starbase's records with Colonel Steven Caldwell's command code attached. The team quickly stops Ronon's attempt to torture Kavanaugh and have Hermiod beam Caldwell to Atlantis' conference room to be questioned. Upon being confronted by the evidence, Caldwell reveals that he is actually a host to a Goa'uld Trust agent who is the one doing the sabotage. The Goa'uld refuses to give up the command code so Lieutenant Colonel John Sheppard tasers him, injuring the Goa'uld and allowing Caldwell to regain control of his body at least temporarily. Caldwell, although in a lot of pain from the Taser and his fight for dominance against his Goa'uld, manages to give Sheppard the code he needs and McKay enters it, shutting down the Trust program and reinitializing the failsafes, averting disaster. Hermiod is later able to use the Daedalus beaming technology to remove the Goa'uld from Caldwell and it is presumably killed afterwards. Caldwell survives the extraction and returns to his position as commander of the Daedalus.