The first rule of street & military intelligence: Know who your (potential) allies are. You flunk this rule, and innocent allies die in "Friendly Fire."
Yup, undercover work is extremely dangerous and you take the job knowing these things. A case of poor threat assesment. However the reverse could be said about being careful who you wave a gun at.