But of course! The President of the United States would never lie to us!
That's not easy. One must "make the opportunity to commit the crime" available, but not entrap. So if the bad guys contact a UC officer or informant, and they ask to buy a nuke (or automatic weapons, or lots of other things), then one can, as you suggest, prosecute.
However, if the terrorists are a closed cell, the process doesn't work. Unfortunately, they frequently know each other quite well...
To do the job, one would need to recruit covert informants who would then become devout moslems. They would attend the mosques, befriend the members, and get in the loop that way. But keep in mind, you're looking for a very special kind of CI....one who is willing and able to function undercover for 24 hours a day, 7 days a week. One willing to avoid all family contacts, or willing to put their family on the line...because you can expect that the bad guys will want to meet the new convert in his home before they really start talking about criminal acts.
It's one thing to let a few dopers get away. But quite another to let a terrorist hurt and kill a great many innocent people. And for that reason, I do believe that some of the constitutional guarantees we have enjoyed will need to be set aside for the duration. And no, I don't like it any better than you do.
He is detained because he is an enemy soldier who is functioning as a sabotuer during a time of armed conflict.
What is the problem with attacking the enemy? Or does he enemy obtain 'safe harbor' should he reach our border?
Just because these people do not wear uniforms like in the civil war, or take orders from a gov't like in WWII does not make it any less of a war. It is not a war in a common conception, but it is a real war.