When I was on active duty, I had taken the Commissioning Oath for officers a few times. I was also required to sign NDA paperwork several times which detailed what I was required and forbidden to do regarding protecting classified information.
Apparently, just taking an oath doesn't make one legally responsible should they compromise or disclose national security secrets, be it from intentional or negligent actions.
Maybe we need a written agreement/responsibilities list for each government official to sign that not only spells out all their duties, but also the penalties should they fail to execute those duties. Within that document would of course be the "protect and defend the Constitution/s" promises the current oath of office entails.
In today's lawyer-run government, nothing short of a signed and witnessed original document can effectively make sure the officials understand what their oath involves and requires of them.
Think about it. If the US Congress has such an agreement that included you can't keep your job if you've facilitated foreign spying, Feinstein and Swalwell would have been gone years ago. I think Debbie Wasserman Schultz would be in the same boat.
Yet, they remain in office.