Unlike conventional generators, inverter-based generation do not possess any rotational inertia. While grid-forming inverters can synthesize small (virtual) inertia via advanced feedback control loops, additional control mechanisms are needed to ensure safety and security of the power grid during transients. In this paper, we propose novel real-time safety-constrained feedback controllers ("safety filters") for droop-based (gridforming) inverters to ensure transient security of the grid. The safety filter acts as a buffer between the network operational layer and the inverter-control layer, and only lets those dispatch control signals pass to the inverter droop-controller, which are guaranteed to not violate the safety specifications (frequency, voltage, current limits). Using a distributed barrier certificates method, we construct state-inclusive bounds on the allowable control inputs, which guarantee the satisfaction of transient safety specifications. Sum-of-square programming is used to synthesize the safety filters. Numerical simulation results are provided to illustrate the performance of the proposed filter in inverter-based microgrids.