Agent X is the codename of Shayde, a villain from the Shadow Dimension. The agent worked for Doctor Robotnik, the tyrant believing that Johnny Lightfoot had defected from the Freedom Fighters and turned traitor. With this in mind, Robotnik sent Agent X to kill the Freedom Fighters, all the time making sure "Johnny" kept a visible presence from time to time.
Several months before Agent X revealed himself, a creature called Shayde somehow made contact with Mobius and switched places with Johnny, assuming his identity. The creature then went to Robotnik, presumably stating that he no longer wanted to fight for freedom and would instead work for him.
Agent X's missions were often unrelated to his identity and usually saw Agent X just try to kill his old friends. He was first ordered to plant the Doom Seed, a plant that would eventually grow to cover the entire Metropolis Zone with weeds. Narrowly evading capture by Sonic the Hedgehog, Agent X was later sent to Trituna. After an initial encounter with Trouty, X was easily able to convince Sharka Khan to take a potion that would grant him and his citizens the ability to breathe on land. Agent X then quickly visited the Sun Valley Zone where he worked with Windy Wallis to defeat Tails. With the cover of Wallis' fog machine, the agent attempted to shoot the fox but disappeared when Wallis' plan was revealed.
With Robotnik permanently defeated after the events of Robotnik Reigns Supreme, the Freedom Fighters decided to storm Flickies' Island to rid the island of Robotnik's influence. X, present at the meeting as Johnny, volunteered to stay and guard the Emerald Hill Zone but teleported himself to Flickies' Island straight after. There, he managed to gain control of possibly every Badnik on the planet (albeit the older models) and sent them to intercept the invading heroes. The Badniks severely outnumbered Sonic and the gang and brought their captives to Flickies' Island. Agent X still did not reveal his identity until seemingly blasting Sonic into nothing. With the hedgehog out of the way, Agent X revealed himself to be Shayde, but was quickly captured by Shortfuse the Cybernik.
When the real Johnny returned to Mobius, a punch from the rabbit sent Agent X back to his own dimension, one in the process of bring destroyed.