Shadow is an engineered hedgehog — described in the games as the Ultimate Life Form, created aboard a space station. Rouge is a bat, and a professional treasure hunter who works for whoever pays.
Both started out on Dr. Eggman's side of things. In more recent games, that's shifted: they're aligned with GUN, the military organisation, and have drifted into something closer to hero territory. Rouge in particular has always been self-interested rather than malicious.
The cleanest way to describe either of them is neutral. They act on their own terms, and which side that puts them on changes from game to game. That flexibility is what makes them interesting — you never quite know whose interests they're serving this time.