How to make a spawned AI not attack the one who spawned it?

how are you calling the spawn event? i imagine it wouldnt take too much to pass along who the player was that initialted the call for spawn event. as for the not attacking part well thats pretty simple add in a check does current target = who spawned me if yes do nothing or find another target. without knowing your code and how your implementing things its hard to give exact answers. for example are you using behavior trees?