How to be invisible to AI

In my project, I have AI that will patrol a set area and when the player character enters the AI field of view the AI will chase after the player until the player is caught or has lost sight.

What I have been trying to find out is how to have it when In change the player’s material by an input it will make the AI unable to see the player will that material is set.