Question: When I design adventures, I often come up with situations where the NPCs could realistically thwart the PCs quickly by sounding an alarm. This is especially common in science fiction settings, where the NPCs have access to surveillance cameras, radars, motion detectors, and other advanced technology. This makes stealthy missions difficult to pull off, because the PCs can be revealed in a matter of seconds if they make even a single mistake.

**How do I keep NPCs from just sounding the alarm right way, without suspending disbelief too much?**

Answer: 
In a cyberpunk scenario, you would typically have the physical infiltrators (call them grunts) working in tandem with cyberintruders who work the target's computer network.

The typical pattern works that the two groups are in communication (which might be interrupted during the scenario), the grunts would lay the groundwork by providing ports of access for the cyber intruders (e.g., spotting a communications cable and tapping into it, which might later be used to intercept an alarm message), and later the cyberintruders provide information to the grunts and deal with any "noise" they might produce.

The "alarm" is then a problem for the cyber PCs to deal with: stop the message from reaching HQ, ensure that HQ receives a reassuring flow of fake information, etc.

There is a lot of role-playing and problem-solving potential in this, but you have to ensure all the players have the same idea of what's going on. The couple of cyberpunk raid scenarios I've played fell to bits over this.

Funny, I don't think I've read a cyberpunk raid scenario in 15 years. They used to be all the rage.
Usually in the games I'm a part of, the PCs' status as heroes sort of takes care of the alarm issue. If intruders easily slaughtered the 5 guys guarding your entrance, are you more likely to rush in there, or hunker down and take the best defensive position you can?

For more stealth or skill-oriented infiltrations, my approach is simply to allow multiple failures instead of one bad roll meaning a total failure. For example, a stealth failure could be described as, "A guard starts to turn a corner and his flashlight will shine directly on you. Everyone roll perception to see if they hear the guard in time to warn you." Chances are someone will make it, but then have some longer-term consequence. "You duck out of sight in time, but the guard thought he heard something suspicious and he's starting to check windows and doors for signs of forced entry."