To dream of being undercover indicates an unwillingness to reveal everything about your self in a current friendship. Be true to your feelings as there may be a reason you are holding back.
[1]If you dream of being an undercover cop, you are feeling guilty about your past actions.
[2]