We study the scalar mass matrix of general supersymmetric theories with local gauge symmetries, and derive an absolute upper bound on the lightest scalar mass. This bound can be saturated by suitably tuning the superpotential, and its positivity therefore represents a necessary and sufficient condition for the existence of metastable vacua. It is derived by looking at the subspace of all those directions in field space for which an arbitrary supersymmetric mass term is not allowed and scalar masses are controlled by supersymmetry-breaking splitting effects. This subspace includes not only the direction of supersymmetry breaking, but also the directions of gauge symmetry breaking and the lightest scalar is in general a linear combination of fields spanning all these directions. We present explicit results for the simplest case of theories with a single local gauge symmetry. For renormalizable gauge theories, the lightest scalar is a combination of the Goldstino partners and its square mass is always positive. For more general non-linear sigma models, on the other hand, the lightest scalar can involve also the Goldstone partner and its square mass is not always positive.