But those agencies cannot do anything if an elected/named official decides to work for an adversary, since those agencies are under command of the elected/name official.
That's why democracy is beyond the scope of those agencies.
Those agencies are "fences" to protect a teenager from doing mistakes. But it cannot protect the teenager from setting himself on fire.
In my view, democracy was always vulnerable if the people or elected official can be convinced of whatever.
My understanding was that they routinely do their work far outside of the law. Because such agencies have demonstrated a willingness to violate the constitution of the US, lie to both congress and the president, overthrow the democratically elected leaders of sovereign nations, perform acts of torture, rape, human experimentation, assassination, etc. it seems odd that they'd suddenly shy away from taking any action now.
"Supporting democracy" in Latin America always meant anti-communism, even to the extent of ending free elections.