How to confirm that party member hasn’t been replaced or charmed?

How can my PC confirm that the other PCs haven’t been replaced by a shapechanger such as an incubus or doppelganger, and haven’t been charmed/controlled in some way to work against the party?

One idea is have a password/code to check for shapechangers, but that only goes so far as if a PC is controlled but not replaced they would know the code.

Ideally answers would be methods a Bard could use.