When did the concept of flagging start?

Seeing another question at UX.SE related to flagging, I realized that flagging is always associated to a negative connotation. I understand that Flags are Used to Convey Messages (such as Naval Flag Signaling or Beach Warning Flags). However, these messages are either negative, positive or neutral.

The negative connotation probably comes from the red flag but what I'd like to know is: when did it start in HCI and why (or how) did it become negative?

Additionally: is there (or was at any point) a flag messaging system with different meanings and connotations?

EDIT: More specifically, I'm talking about the public process in which an user flags something rather than internal processes only available to coders/developers, although answers about this could also lead to the concept of flagging most users know