This question came up during public records training at a public organization in Washington state, but I am interested in the general case. That said, I've provided the specific hypothetical about public records at the end in case it is useful for understanding the question.
Suppose you are an employee of a state-run organization (but not a police officer), and your superiors instruct you to perform activity X. Performing X is a routine activity that your organization is legally required to perform, but suppose that in the specific instance of this activity you realize that one of the steps in performing X is likely itself illegal. However, you are not a lawyer, so you are not certain whether the law compels you to perform X or compels you not to perform X. For the sake of argument, let us suppose that your superiors (who themselves may or may not know whether X is legal) are aware of the problem but refuse to provide instructions more specific than that you must both obey the law.
In such a situation, are your superiors acting lawfully? If you act in good faith, is there a way to know if you are liable, or is this strictly dependent on the specifics of X (and if so, what is important to know about X)?
(I'm interested in the general case for this question, not the specific laws about public records, which may have a specific carve-out regarding liability. But in case it help to understand the abstractions: the question involved a hypothetical where a public records were stored on a private server by a past employee, and a public records request now requires you to produce them; your superiors tell you that the records are legally responsive and that producing them is part of your job, which is probably all true, but they won't specifically tell you to get them or not to get them, and you suspect that getting them would be illegal.)