A guard is a mechanism or condition used to ensure safety, protection, or control before an action is executed.

  • In programming, a guard is a statement that checks conditions (e.g., guard in Swift ensures certain criteria are met before continuing code execution).
  • In security, it refers to a person or system that protects assets, people, or data.
  • Generally, it means anything that prevents harm or unauthorized access.