You know that colleague: the one who acts a certain way when your boss is in the room but sings a completely different tune when you’re alone. This can be especially frustrating when your boss is blind to this chameleon-like behavior and gives your colleague praise or even promotions. You may be tempted to call out the inconsistent behavior, but before you do anything, take the time to understand why the person behaves the way they do and what can you do about it.

First, recognize that there are different forms of this inconsistency. Here are three of the most common manifestations:

All that jazz. Fast-talking, articulate, quick on their feet, this colleague always has a great story to tell when the boss is in the room. While the person has big, lofty thoughts and appears deeply engaged, the rub comes when it’s time to divvy up and do the work. “There’s a smoke-and-mirrors element to it. Four other people walk out of the room with something on their to-do list and he doesn’t have any of the work,” says Karen Dillon, the author of the HBR Guide to Office Politics.

Fast-talking, articulate, quick on their feet, this colleague always has a great story to tell when the boss is in the room. While the person has big, lofty thoughts and appears deeply engaged, the rub comes when it’s time to divvy up and do the work. “There’s a smoke-and-mirrors element to it. Four other people walk out of the room with something on their to-do list and he doesn’t have any of the work,” says Karen Dillon, the author of the HBR Guide to Office Politics. Sugar and spice. Friendly and acknowledging, this colleague says what folks want to hear. But then you find out that she’s undermining you. Dillon calls this “the fake good colleague.” She explains that this person “applauds your efforts when the boss is in the room, and then behind the scenes, you learn that she has quietly gone to the boss afterward to express her concerns.” You are typically surprised by this behavior because you expected more from the person.

Friendly and acknowledging, this colleague says what folks want to hear. But then you find out that she’s undermining you. Dillon calls this “the fake good colleague.” She explains that this person “applauds your efforts when the boss is in the room, and then behind the scenes, you learn that she has quietly gone to the boss afterward to express her concerns.” You are typically surprised by this behavior because you expected more from the person. Classic Machiavelli. Charming, confident, respectful when the boss is in the room. Curt, rude, dismissive otherwise. This person is on his best behavior around people who can help him fulfill his ambitions. In his book Give and Take: Why Helping Others Drives Our Success, Wharton professor Adam Grant describes these colleagues as “takers.” He says this “duality” can be described as “’kissing up, kicking down.’ Although takers tend to be dominant and controlling with subordinates, they’re surprisingly submissive and deferential toward superiors. Takers want to be admired by influential sponsors, so they go out of their way to charm and flatter. As a result, powerful people tend to form glowing impressions.”

Regardless of which type of person you’re dealing with, there are steps you can take to better manage your reaction and the person.

First, recognize this is not about you. Don’t take it personally. When you see the behavior, take a step back and be a spectator to what’s going on. It’s easy to assume we’re onstage as a victim in this person’s game; in truth, it’s much more about your colleague’s lack of self-awareness, insecurity, or past experiences. “Few people wake up intentionally wanting to be the bad colleague that day. Rarely is it about evil intentions — it’s usually due to a lack of awareness or ineptness in emotional intelligence. It comes from a desire to impress the boss,” explains Dillon. Some folks grew up working in political organizations where they learned this is what it takes to be successful.

Don’t play the game back. When we see this behavior, it’s tempting to want justice or to get even, especially if the behavior is rewarded. We get caught up in our own emotions: This is so unfair. I work so hard and try to be a good colleague to others. Why doesn’t the boss see through this? No matter what you do, don’t fight fire with fire. “It’s not worth twisting yourself into a pretzel,” says Dillon. “Don’t get caught up in self-destructive behavior. Don’t try to undermine this person back. Don’t badmouth her to other colleagues. Don’t recede or roll your eyes when he speaks, because all that does is make you look bad. Realize that good bosses are not duped over the long run. Mrs. Cleaver ultimately sees through Eddie Haskell.”

Keep it constructive with your colleague. Before openly addressing the situation, be honest with yourself: Is your colleague’s behavior simply annoying, or is it affecting you or your team’s ability to contribute and get the job done? If it’s the latter and you decide now is the time to act, it’s usually best to start with your colleague rather than your boss. Approach it as constructively as possible. “Don’t confront your colleague in public,” Dillon says. “Have the conversation in a private place. Signal that you’re aiming for course correction and not trying to go to war.” Give your colleague the benefit of the doubt and seek to understand while also being clear on what you need.

You might say:

“It’s unclear to me how our teams are dividing and conquering this plan. Can we discuss who is doing what before the next meeting?”

“I learned you had some concerns about the approach we’re taking. I’d welcome hearing about them. Could you share your views? Next time, please come to me directly.”

“I’m sensitive to the fact that we’re all busy. Could you let me know what would help to ensure our team has your full attention on this? The last time we were together, I sensed your frustration and impatience, and I’d like to make sure we keep the tone collaborative for all.”

Carefully escalate to the boss, if necessary. If you don’t see much change and you continue to believe the behavior is affecting the work, proceed with caution when bringing it to the boss. Take time to prepare. Ask yourself: Have I done all I can to solve the problem here? How is my existing relationship with my boss? How can I best frame this so that I don’t come off as tossing a problem over the wall? What is the best timing and approach?

Dillon advises, “Be aware of looking like you’re the problem child. Be careful of seeming angry, petty, or as if you’re wagging a finger, whining, or complaining. It’s important to focus on the work.” In approaching your boss, be explicit about your intentions, ask questions, and seek to clarify. Maintain a calm and neutral tone.

You might say:

“I’ve spoken to Joe about better defining roles and responsibilities on this next initiative. Could we have a three-way meeting to confirm before our teams move forward?”

“Thanks for sharing that Laura had concerns. I’ve looped back with her on it. If you hear more from her, please let me know or encourage her to come talk to me directly.”

“I’m a little confused about Tom’s role on Project X. I’ve spoken to him directly about the overall tone in those meetings, as he appears disengaged or frustrated in our meetings when you’re not there. I’d welcome any guidance on how to understand where this falls on his priority list.”

Learn from your colleague and make it your own. There’s usually a personal reason that a colleague annoys us — and it’s smart to try to learn from that. Consider how your coworker serves as a mirror for things you might not like about yourself. Do you wish you were able to think as quickly on your feet? Are you concerned that you aren’t as visible to your boss or other senior people in the organization? Rather than painting all of the person’s behavior as negative, think about the positive skills he’s demonstrating — framing, storytelling, asking great questions, strategic thinking, letting others know his capabilities. It’s possible to emulate these skills without the accompanying bravado, arrogance, duplicity, or disrespect.

As Dorie Clark, author of Reinventing You and Stand Out, writes, it’s possible to promote yourself “without alienating your colleagues and looking like a jerk.” Focus on building these important skills in your own way without compromising your integrity, violating your values, or being a bad colleague to others.

It’s easy to get lost in the anger and frustration around colleagues who play the game differently than we do, especially in front of the boss. Refocus that energy on what’s in your control: staying mindful of your own behavior, handling things constructively, being open to learning, and aligning your own values. In other words, make it about you being a better colleague, not about punishing them for not being the same.