Basically Whistleblowing laws are in a tough spot with regards to classified info (remember, such laws also protect people calling out corruption etc that have no classified info). IANAL nor am I an expert on whistleblowing law, however, it is my understanding that such laws as they relate to classified are generally meant to allow individuals to go talk to congress and let congress know that their agency has gone off the rails.

Obviously this protects the government from a rogue piece of itself more than it protects the people from a rogue government. However, I am disinclined to take the fully cynical view of this since I have yet to concoct or hear a plan which was capable of a) maintaining a legally enforceable classification system, b) permitting ethically and patriotically motivated unilateral public disclosure of unconstitutional activities. Perhaps this is a failure of my imagination (I suspect that if there is an answer it relies in finding a way around needing the second requirement).

I think that the current best solution to the problem is where we are currently (I said best, not good). That is to hope that in the event of sufficiently egregious abuses an individual will set aside personal risk and expose said programs. In the ideal Disney version we as a society recognize that they did this in service to the constitution and fulfillment of their oath and urge the president to pardon the risk taker. Maybe call it the Jefferson Strategy, after the quote about the tree of liberty needing to be watered with the blood of patriots. Maybe, in order for the republic to stay healthy, we need people brave/stupid enough to be executed or die in jail as the modern equivalent to the rebellion Jefferson was referencing.

This plan has several failure modes. First is a false positive. This is the mode where someone for whatever reason believes that they're being a whistleblower and just dumps a bunch of documents that hurt US foreign policy but don't really expose any wrongdoing. You basically have to believe that all US foreign activity or all secrecy is inherently bad to say that that the Manning dump moved us forward as a democracy. Note, I'm not defending her treatment or sentencing or whatever, but the dump was pretty devoid of any gross U.S. wrongdoing (we can argue about the chopper video elsewhere). This failure mode is dangerous but probably won't end the republic. It is increasingly damaging per occurrence though because someone can take far more documents than they could ever read. This has a negative potential effect on the accountability of the leaker since they can take now and sift later. I wonder if this will lead to a cycle of more "example making" and leakers putting out more docs per dump since they know they'll be made examples of anyways.

The other failure mode is that everyone stays silent, which is also not ideal, but large orgs have issues with secrecy even without relying on self-sacrificing affirmative decisions, so I'm not worried about this one over the very long run.

Edit:

There's no way to shape policy to recognize ahead of time that it's ok to leak illegal programs (such a policy would need to be ok with the existence of legal programs in the first place). It's similar logically to saying that it's OK to torture people who know about terrorist plans. You can't really know ahead of time for sure that they know what you want to know, so making a moral exemption on such a basis is inherently flawed and you should refer back to the general case of "don't torture people" (in this case, the general case is "don't leak classified").

I was primarily directing the "childish" comment towards the idea that we ought to get rid of the classification system entirely. It's a nice utopian ideal, and I can see and even maybe agree with the logical arguments that secrecy in any form in government is an inherently corrupting feature. What I can't see however is how to conduct the business of government (diplomacy, intelligence, and military specifically) in any fashion without it, and I'm left with the impression that a sober view of the situation has to accept secrecy in some instances and look to mitigate its corrosive effects rather than to complain about its existence.