It often is.
The exception to that principle is that, sometimes, the foreign actor may anticipate—even desire and benefit from—the public disclosure of their operation. For example, if Russia is conducting an influence operation that is publicly exposed, and that public exposure actually creates a lot more societal anxiety, fear and distrust than the initial influence operation itself, it could be considered a win for Russia.
That's one of the complications government needs to consider.