The president is not the state. That's been established multiple times in cases like Nixon, and unfortunately recently regressed with the Trump SCOTUS decision.

But in theory all these organizations swear an oath to the constitution, not to any branch of government, and especially not their leadership.

If any of the leadership issues illegal orders or does work to undermine the constitution or the country, according to the oath sworn by CIA agents, they should be doing everything they can to work against this leadership.

Even the military expects soldiers to reject illegal orders to commit gencode.

The peak of the "the president is not the state" was when the SCOTUS approved of the special counsel law in the 80s. After the Clinton fiasco the SCOTUS has pretty much adopted Scalia's dissent in that case.