A friend-or-foe identifier, sometimes known as a "friend-or-foe" identifier, was a piece of technology used by the Trade Federation. The identifier carried information on the identity and socio-political status of the supposed holder, that could be easily accessed by the battle droids composing the Trade Federation Droid Army, even if the identifier was not readily visible.
The battle droids were programmed to not actively attack any individual wearing a friend-or-foe identifier, not even if that person was hampering the efforts of the droids or directly attacking the droids. They could only ask the wearer to move or, in the later case, ask a superior entity (Such as a Lucrehulk-class Droid Control Ship) for confirmation.
The identifier did not carry information about the wearer's mission. As such, if the droid's mission was calculated as more important than the wearer's general activity, the droids might decide to not actively protect the person — although they would still not fire at the wearer.