The point isn't whether he's guilty or not, the point is whether the actions of law enforcement are useful. If they create the crime they then prevent, did they really prevent a crime?
The answer is "just barely". Sure, real terrorists could have recruited this guy and given him a bomb, but then the real threat is still those terrorist who already have a bomb and not this guy.
The traditional crime triangle is motive, method, and opportunity.
If you find someone who has nothing more than motive, and you supply him with both method and the illusion of opportunity, you have done little more than to prove that he had motive.
That is, you are prosecuting him on the basis of his opinions and beliefs. Thought crime.
Undercover policing only works when the crime to be prevented would have definitely occurred in the absence of the undercover cop. What they can do effectively is take an potential opportunity and convert it into the illusion of opportunity.
So rather than supplying the guy with bomb parts, wait until he has actual bomb parts, and replace them with nonfunctional replicas. Then you wait for him to press the button. That way, there is no doubt as to the origin of the criminal intent. You stopped a real crime instead of abetting a fake one.
You can't just target someone with motive and trick him into acting on it. That's like putting a "live grenade dispenser" next to the number ticket roll at the DMV. Everyone walking in that door has daydreamed about enacting some form of violence against the state clerks, especially when the wait is long and none of the people behind the desk seem to be actually working. But no one actually tosses grenades at the DMV. They just wish someone would. Or for those who would, they have the foresight to not bring their grenades with them when renewing their license, to avoid the temptation. But if you stand there and give out free grenades to people waiting in line, a few of them will have their pins pulled. If they spit out a puff of confetti instead of flaming death, you haven't really prevented any crime. You just proved that some people hate the DMV. You could have accomplished the same thing by circulating a petition to lawfully dismantle the bureaucracy.
So I disagree that the answer is "just barely". I think it is "absolutely not".
I understand what you're saying and there is merit to your point of view. But, I want the people who pulled the pins on the fake grenades in jail for life. They attempted mass murder. I don't want them on the street when the only thing preventing them from murdering people is a temporary lack of convenience.
So how would you deal with the people passing out fake grenades while telling everyone they are real? Would it be any different if they passed out real grenades and said they were fake?
Would you support preemptively testing everyone in similar ways, and imprisoning all those who failed? If you described the hypothetical on a paper, and asked people to rate their likelihood of pulling the pin on the imaginary grenade in the imaginary DMV, on a scale from 0 (never) to 10 (always), what numbers would they have to choose to remain free?
I, for one, am completely uncomfortable imprisoning people based solely on their psychological profile rather than as punishment for actual harm inflicted in the real world. Some undercover investigations do seem eerily similar to selecting someone based on a profile and then continually testing him until he fails to meet the "stay out of jail" threshold. It just doesn't seem like ethical policing to me.
Nor do I, but in reflection about my own youth and developmental years, I also am sensitive to the influence that others can have. No noose ties itself.