We propose a technique for synthesizing switching guards for hybrid systems to satisfy a given statebased
safety constraint. Using techniques from sum of squares (SOS) optimization, we design guards defined
by semialgebraic sets that trigger mode switches, and we guarantee that the synthesized switching
policy does not allow Zeno executions. We demonstrate our approach on an example of switched affine
systems and on an application to traffic ramp metering.