Imagine you’re sitting at home with your partner on a Tuesday night. He’s looking more tense than usual. After dinner he tells you he has something on his mind and begins as follows:“There is something that I have been meaning to tell you. I think it is important that I be honest with you. I hope that you can understand what I have to tell you.

You’re correct in sensing that this is not a good start. He goes on:As you know, last week I went on a business trip to Chicago. While there I spent a lot of time with one of my co-workers that I have always been very close with. I have always had a connection with her. At this point, we have purely an emotional connection, nothing physical at all, but… I think I’m falling in love with her. I’ve talked with her at length and we’ve both decided it would be better to end our relationship entirely. I care about you very much and I hope that you can forgive me so that we can work through this.

If your stomach turns reading this scenario, you’re not alone. This is a (lightly edited) narrative read by a large group of people who participated in a research study on sexual and emotional infidelity. Here, it’s pretty clear that lines were crossed and the damage is done. In many cases, however, there’s quite a gray zone in what does and does not constitute emotional cheating.

How close is too close? Where is the line between harmless banter and intimate indulgence? How do you know if you are in a special friendship or an emotional affair? It can be hard to tell where the line is until after you’ve crossed it. I’ve always had a simple rule for the couples that I’ve worked with and, for that matter, in my own life: If you think you’ve done something wrong, you probably have.

What Counts—and What Doesn’t Count—as Emotional CheatingDr. Shirely Glass was a pioneering psychologist in the study of infidelity, and in her book, “NOT ‘Just Friends,’ ” she discusses how close friendships can gradually evolve into emotional affairs, relationships in which emotional boundaries are blurred and deception is used to keep one’s partner at bay. Emotional affairs, according to Glass, can relatively easily evolve into physical affairs as well.

Glass developed an emotional affair questionnaire that you take online. You can score your responses, then use Glass’s guide at the bottom of the page to see where you stand.

The questions that strike me as most important are the ones that ask if you would feel comfortable if your partner saw (with, say, a video recording) or overheard your conversations with the person in question. In other words, if your behavior was reflected back to you, would it be OK?One of the things Glass makes clear in her book is that simply feeling attracted to someone does not constitute cheating or an affair; it means you’re alive and feeling vital. Importantly, being attracted to someone else does not mean you have chosen the wrong partner and should, therefore, act on your attraction.

Prevent an Affair From DevelopingGlass outlines three important points about stopping yourself at the door of an emotional affair. First, she notes that most affairs begin as fantasies and she cautions people against fantasizing about themselves with the other person. Don’t savor your time with that person. Let the feelings pass and don’t “feed the fire” of your attraction by daydreaming of the other person.

Second, Glass urges people not to flirt and notes that flirting is a sign of availability. Don’t invite more attention from this other person. This is easier said than done, especially when you’re not feeling super positive about things on the home front. When you’re serious about your relationship, you need to choose, very consciously, not to engage in behaviors that put your relationship in danger.

Let’s face it, sometimes a bit of flirting is harmless fun and it makes you feel good about yourself. Harmless flirting is a bit like playing with fireworks. Very few people get injured with a sparkler; if you play with anything more serious, though, there’s a pretty good chance you’ll blow your hand off!Finally, Glass also instructs us to avoid risky situations. Don’t strategically sit yourself near this other person at an office party where there will be alcohol. Don’t end up alone with this person at Starbucks on a Saturday afternoon. Don’t send any texts that are not work related (see the point above about flirting—texting about personal stuff is most certainly flirting). You get the idea. Your relationship is only as vulnerable as you let it become.

The End of the (Emotional) AffairThese recommendations are great for avoiding a problem before things heat up, but what if you’ve just taken the quiz and found yourself already involved in an emotional affair? First question: Can you stop? If yes, do so now before things evolve (or, as the case may be, devolve) further.

If you feel you can’t stop the affair—like you’re a speeding car going down a highway and missing all the exits—then you should talk with a close friend or professional about what’s going on. What relationship do you want? What’s the problem with your primary relationship? Why were you vulnerable to the affair and can that vulnerability be fixed—be it within you or within your relationship?Couples can overcome an affair, and I’ve written about this possibility in a prior column. The healing process begins with asking yourself what you want most, then figuring out why and how you got to where you are.

MORE: How to Deal When His Best Friend Is a Woman