Provide clear mandates and then structurally separate organizations that should exist indefinitely from most interference by elected officials. Some of the most effective institutions of the US Government are the ones that were deliberately structured to be self-organizing, the military, the federal reserve system, and (until recently) the postal service.
That said, you raise an important problem - how do you manage poor performers without allowing a bad-faith political official to fire people unfairly?