Spies are special infantries that are only found through Mystery Crates. Players obtaining a spy crate will change into a random infantry class from their opposite faction (ex. A GDI player might become a Nod Flame Trooper). While the spy has all the stats of the newly acquired infantry, they will also be detected as friendly from the enemy's base defenses, both small ones and their main defensive buildings; therefore, automated base defenses will not fire upon the spy.
However, veteran players will see the message broadcasted that warns them of the presence of a spy and they will be on guard and fire upon their teammates as well, while also keeping an eye on the radar, since the spy will appear on the minimap as a dot akin to a player on the same team; for example, if there is a dot inside the opponent base just moving around and not disappearing, chances are that player is the spy. Lastly, a spy will not display their nickname to their enemies, thereby, a smart player will not be fooled and it will either fire on the spy or pretend to ignore them at first before firing.
It is advisable for a spy to hide from enemy eyes, since the message will not tell which kind of infantry the spy possesses; thus increasing the chances of a potential infiltration in the enemy base. In matches with plenty of people, the spy can also remain in base and wait for their opponents to forget about their presence.
Notably, a GDI player who obtains a Stealth Black Hand spy differs from others because of it is stealth capabilities: they will be able to tour unhindered by Nod defenses, so they would be able to gather intelligence on enemy operations, considering Nod patrols are unlikely be sweeping around their base with automatic fire, knowing that chances of getting a Stealth Black Hand spy are about 1/14, and if the spy has not been spotted yet. Some might also try to place an Ion Cannon Beacon in a cunning spot such as inside the lights on the runway of the Airstrip or in the Tiberium Refinery docking bay, when most of the Nod players are out in the field.