There's an easy out to the assassin. She always uses her blade first to daze someone. If you intentionally leave that person dazed, she'll always grab them and teleport out AFAIK.
There is kind of a trick to the assassin. You have to back away, position your guys close together but not so close more than 2 can be hit by an AoE, and just keep backing off. The camera perfectly tracks her movements even out of sight, so just wait till she's close, then blow up her cover (shredding her armor) and pounce on her with everyone. The problem is that in her first reveal, since you won't have a specialist with 4 heals + revive, your squad won't be resistant enough to wait for the opportune moment. So like you said, its very luck based.
Edit: Alright so this was the outcome:
Skirmisher fired for 6 damage, turns out they only had one shot so a kill was even less likely than I thought. Grenadier hit for 5 but it wasn't a crit so no kill. Specialist bled out, then the assassin used harbor wave to hit BOTH my soldiers. Then she extracted knowledge from the grenadier and fled the scene. There was nothing left, not even faceless, so we won instantly and both my grenadiers survived albeit with wounds.
The caimpaign seems... pretty OK? I pursued a build focused on getting covert ops up as fast as possible. So less than one day after the mission this happened
So now my roster looks like this
Overall I'd say that everything has gone about according to plan. No missions failed, 3 deaths total, still have more than a full squad for next mission. Sadly I decided to rush sectoid research forgetting that its another whole research to get psionics, so that's an oopsie. In a month or two I'm going to get some crystals from an exposed power coil anyway, so maybe I can do it then. The main question left in my head is when to go for magnetic rifles. My fear is how I'm going to survive the power dip between conventional and mag weapons. Is it still mandatory to rush mag weapons? My current plan is to do minor researches now, THEN get psi, THEN get mag rifles. But that feels like it could be wayyyyy too long. I'm also considering building and manning an early lab for the, what is it, 50% research speed boost? 33%? I'm trying to experiment with builds here since I know legendary can get real hard.