Michael Mann had his actors train with real-life undercover law enforcement officers. Both Jamie Foxx and Colin Farrell observed undercover operations from a safe distance. Colin Farrell was told he'd learned so much, he was welcome to participate in a real sting operation.
During the operation (caught on video, excerpts of which are shown in the DVD extra), guns were drawn and the officers identities questioned. Farrell reports being scared for his life. He spontaneously ripped open his shirt to demonstrate he wasn't wearing a wire, an act the agent-in-charge later commended for being realistic, quick-witted improvisation.
After suffering anxiety and insomnia that night, Farrell contacted the agent-in-charge and was told that the sting operation was staged and that Farrell was never in any danger; he was to be told the next morning during a debrief.