The financial and political might of ComStar is enough to protect their compounds during the Succession Wars. Inside the inner sphere, whatever on-world garrison would also logically defend the HPG compound as a vital strategic planetary asset in the event of a pirate raid. And in the event of a House-backed action, noone would mess with ComStar for fear of what they could do elsewhere in response. The TRO:3026 fluff for the Pike describes that ComStar was the only major power to invest in the new tank, but it describes posting such tanks in the periphery. Needing some of their own security on hand in the rough and tumble part of the universe doesn't contradict this, and indirectly even supports it.
As for the bulk of their compounds (inside the Inner Sphere), ComStar surely had ROM for security and defense. Possibly even fixed defenses like walls and turrets if relations with the local garrison didn't guarantee military protection from pirates. Literally no need for ComGuards to be posted outside of Terra at this point, with or without 'Mechs. Again, excepting the rare Periphery cases like described in the Pike fluff.