Detection
I believe the key point is to understand what a gaslighting is and what kind of traits are frequent among people that use this technique.
Wikipedia notes on gaslighting (emphasis mine):
Gaslighting is a form of psychological manipulation in which a person or a group covertly sows seeds of doubt in a targeted individual or group, making them question their own memory, perception, or judgment. [...] The goal of gaslighting is to gradually undermine the victim's confidence in their own ability to distinguish truth from falsehood, right from wrong, or reality from delusion, thereby rendering the individual or group pathologically dependent on the gaslighter for their thinking and feelings.
As cited the overall goal is to render the individual dependent on the gaslighter. This goal resonates with narcissistic personality traits (in the DSM sense, "a pervasive pattern of grandiosity, need for admiration, and lack of empathy"); which is why it's frequently used by people suffering this disorder. Healthline points gaslighting as a possible symptom. Psychology today additionally notes frequent traits among them:
- Frequent Lies and Exaggerations
- Rarely Admit Flaws and Are Highly Aggressive When Criticized
- False Image Projection (Both narcissists and gaslighters tend to project false, idealized images of themselves to the world)
- Rule Breaking and Boundary Violation
- Emotional Invalidation and Coercion
- Manipulation: The Use or Control of Others as an Extension of Oneself
Another article point out signs to look for, not in the other person, but on your own behavior and feelings that could indicate you are being under the influence of a gaslighter.
- You are constantly second-guessing yourself.
- You ask yourself, "Am I too sensitive?" a dozen times a day.
- You often feel confused and even crazy at work.
- You're always apologizing to your mother, father, boyfriend, boss.
- You can't understand why, with so many apparently good things in your life, you aren't happier.
- You frequently make excuses for your partner's behavior to friends and family.
- You find yourself withholding information from friends and family so you don't have to explain or make excuses.
- You know something is terribly wrong, but you can never quite express what it is, even to yourself.
- You start lying to avoid the put downs and reality twists.
- You have trouble making simple decisions.
- You have the sense that you used to be a very different person — more confident, more fun-loving, more relaxed.
- You feel hopeless and joyless.
- You feel as though you can't do anything right.
- You wonder if you are a "good enough" girlfriend/wife/employee/ friend/daughter.
- You find yourself withholding information from friends and family so you don't have to explain or make excuses.
Protecting oneself from it
Another article on Psychology today notes techniques to avoid being gaslit. The key principle is to build trust in your own perception, to understand you're being gaslit and react accordingly.
This could be necessary to get help to do so, as noted by Berkley's science review
Once you're confident you're being gaslit, confronting by saying you recall things differently is safer than pointing out certainty the other person is lying, as this conflicts with their need for admiration. I infer from the article it could spark violent responses.
In my own experience, as having been through gaslighting by a relative, I personally favor sticking to my vision but offering no feedback; switching subject, or waiting it ends saying nothing. My intended goal is to shorten exchanges of what's true or not, and additionally to avoid providing encouraging feedback or guidance on how to abuse other people, and this has worked well in diminishing the amount of gaslighting I did receive from that person.