Generally, if you were appointed by the President you serve at his whim. He made you and he can break you.
There is the category of Senior Executive Service. These can be either career or appointed positions in the senior spaces to provide a professional buffer between the worker bees and the policy makers. POTUS can appoint 10% of these positions. The rest are career - and some positions are reserved for career.
If one is a ‘career’ SES then the Presidential whim doesn’t necessarily apply and civil service rules may apply. However, getting the POTUS pissed off enough to want to can your ass isn’t a good thing career-wise regardless of whatever protections you might theoretically enjoy.