Mueller's principles
In 2004, while Attorney General John Ashcroft was in the hospital, President George W. Bush authorized the warrantless interception of domestic communications over the objections of the Justice Department. Standing on principle, Mueller, along with Deputy Attorney General James Comey, threatened to resign if the program's legal issues were not addressed.
Bush altered the program and Mueller continued on as FBI director. Mueller reportedly said about it: "There are days that go by, but not many, that you're not balancing national security against civil liberties."
Mueller threatened to resign again in 2006 after the FBI seized the records of Congressman William Jefferson, who was involved in a corruption scandal. Under intense congressional pressure, President Bush ordered the FBI to return the papers. Mueller resisted with a threat of resignation, again on principle – the FBI had seized the records with a valid judge-issued warrant. Bush relented, and Mueller stayed on as FBI director.
https://election2016.psu.edu/2017/05/22/muellers-threats-to-resign-reveal-his-character/