A safeword is a codeword or series of codewords that are sometimes used in BDSM to mean that a bottom or submissive is reaching a limit or for the Top/Dom to stop the sceneplay. Safewords are agreed upon before playing a scene by all participants. Many organized BDSM groups have standard safewords that all members agree to use to avoid confusion at organized play events.
This is generally used so that the bottom can scream "no, stop", etc. as much as s/he wants without really meaning it, and still have a way of indicating a serious desire that the scene stops. Accordingly, a safeword is usually a word that the person would not ordinarily say during sex, such as red, tree, anomaly, or even safeword.
Some partners have different gradations of safeword, such as yellow to mean "that hurts" or "stop doing that" without stopping the scene, and red to mean "let's stop the scene". In other circumstances the safeword may not be a "word" at all, but a signal like dropping a ball or similar, or making three clear and rhythmic grunts or vigorous motions in the case of a person who is gagged or bound. A common convention of tops putting a finger in the bottom's hand is used if the bottom has become non-verbal, such as may happen as they reach subspace. In this scenario the bottom squeezes a pre-determined number of times to indicate OK.
A common request from the top to the bottom, to check on their status, is to ask "What is your color?" In addition to red and yellow, green is a common safe word used to indicate, "I'm fine."
While many in the BDSM community consider safewords an essential part of safe play, there is a significant contingent that does not have any such term in their relationships or their play. Some of these people simply use the word Stop. Others rely on the top to monitor the condition of the bottom and stop if necessary, at their discretion. In such circumstances the bottom or submissive must have consented not to have control over the duration of the scene in advance.
Interestingly some of those who recommend safewords do not, themselves, use them though this is not often discussed in public. There is an undercurrent assumption that play without safewords is an "advanced" technique and should not be advocated in the hearing of novices. BDSM activity without a safeword is regarded by many as inadvisable and dangerous.
If used, the safeword should be respected unconditionally. After the bottom uses the safeword, the activity or entire scene is over, inflicting pain or any physical forcing should be stopped and all restraints should be removed immediately. Ignoring safewords is considered dishonorable and a deeply immoral practice in the BDSM community and can lead to criminal charges. (The "yellow safeword" mentioned above is however not obligatory.)