Both - but only unknowingly
Luv and other mishaps
Joi is a known Wallace Corp. product, Luv even mentions
I hope the product is to your satisfaction
when Joi's ringtone alerts K in the Wallace Corp. headquarters.
It is evident also, that Luv was using Joi's trackers to keep tabs on K and the progress of his mission. However, there's no evidence that Joi was aware of this happening or aiding it in any way. In fact, before the pair set off to Las Vegas, Joi mentions to K that he needs to remove the antenna and have her fully contained within the 'Emanator' (also removing her backups from the wall unit) in order to not be tracked.
I believe in this case, Joi was telling the truth as Luv displays obvious frustration as soon as the signal is lost and she checks the wall unit.
Mariette or Marionette?
Now in the case of Mariette and the 'Resistance', Joi still cannot be complicit as she shows no signs thereof. Mariette and the other 'Doxies' were told to approach K in the market by Freysa:
Go to the man in the green jacket, he's the one who killed [Sapper] Morton. Find out what he knows
Joi just happened to be listening to K and Mariette's conversation and picked up on the vibes between them. That was the reason she called in Mariette specifically for their 'date night'. It was a pure coincidence that worked out well for the Resistance.
You're such a good Joe
Look, no matter how strange this may seem, I believe that Joi truly did 'love' K. In her own way. In fact, that's what she was programmed to do. She wasn't a reconnaissance or sabotage agent, she was a purely 'pleasure' device built to give her 'owner' a sense of love, affection and loyalty. Yes, there are potentially tons of the 'Joi' programs out there, but that doesn't make her any less real; to K.
Luv was able to track Joi because she seemed like she was an accomplished hacker. She was able to walk into the LAPD, steal a corpse, kill a person and escape; then return later to kill another person. She was able to hack into whatever orbital system it was that she used to 'save' K near the orphanage in the
now do your fucking job
scene.
The part where K tragically realises that Joi is a simple AI machine designed to tell him everything he wants to hear, including his suggested name "Joe" is another impetus for him to believe that nothing in his life is real. That's what makes him do the only real thing left to do: to sacrifice himself for a 'cause'. To finally be human. In fact, he was
more human than human