Also a problem in the UK (Boris Johnson with Lord Lebedev).
Unfortunately I think it does have to sit somewhere on the elected side. A situation where the permanent state can overrule elected representatives unconditionally isn't great. But what really ought to happen is an open court case; you cannot have public policy decisions made on the basis of secret intel in a democracy. That gives you the Iraq war.