A logic bomb is a piece of code intentionally inserted into a software system that will set off a malicious function when specified conditions are met. For example, a programmer may hide a piece of code that starts deleting files, should they ever be terminated from the company.

Often, software and other threats that are intentionally malicious contain logic bombs that are triggered when a certain payload or another pre-defined condition is met but to be considered a logic bomb the payload needs to be unwanted and unknown to the user.