in cauda venenum
When the party first meets Shadow, he seems like your standard mercenary and assassin -- he'll do just about anything for just about anyone, so long as the pay is good. However, by the time your party is on its way to assassin, Shadow is no longer your client -- he is working for the Empire. This is not altogether too surprising, because after all, Shadow does not care who works for -- what difference does it make if he's working for the Empire? I'm sure they promised him a pretty penny, too. General Leo mentions that he hired Shadow after spotting him in town, so the Empire went about hiring Shadow in the same way as your party. At any rate, Shadow tells your party that he won't "garrote" them, and the group departs to Thamasa.
So what exactly is Shadow doing for the Empire? While General Leo introduces Shadow, he does not explain what his purpose is -- it is not until everyone arrives in Thamasa that the truth comes out. Shadow is supposed to be searching for the espers, and once he hears Strago's description of the espers and the mountain to the west, he sets off to find the truth on his own.
However, things do not end well for Shadow. It isn't explained what exactly happened, but my guess is that the Empire realizes that Shadow is useless -- they can simply follow Locke and Terra to find the espers and the statues. Rather than paying Shadow for his services, they decided to try to kill him. Your party finds Shadow near death on the Floating Continent, and he tells you the following:
Shadow: Down with the Empire. Once I outlived my usefulness, they tried to off me!
At this point, Shadow ceases to be neutral -- rather than performing jobs just for money, he now has a purpose. The Empire has angered enough that he is willing to fight with the party for free, just to get a chance at revenge. While he falters at one point and feels as if he is unworthy to fight alongside the party, he eventually comes back and rescues the party, thus throwing a wrench in Kefka's plans. Shadow's association with the Empire may have been brief, but it was distasteful enough to make him permanently opposed to the Empire and everything associated with it (namely Kefka).