There is no credible evidence or reporting that blue cities or states are debating policies directing police to detain mask-wearing ICE agents or arrest them if undocumented.
Blue cities and states are reportedly debating new policies that would direct the police to detain any mask-wearing ICE agents, and, if they're undocumented as trained agents, they'll be arrested.

FactVerify
Source: factverify.com
What the Evidence Shows
The claim states that blue cities and states are debating new policies that would direct police to detain any mask-wearing ICE agents and arrest them if they are undocumented as trained agents. Upon reviewing the search results, none provide any credible or direct evidence supporting this claim. The sources related to blue cities and states mostly discuss broader topics such as sanctuary policies, criminal justice reforms, and conflicts between red and blue jurisdictions regarding immigration enforcement.
For example, articles from NPR, Washington Examiner, Axios, CNN, and CBS News discuss sanctuary jurisdictions and political conflicts over immigration enforcement but do not mention any policy targeting mask-wearing ICE agents for detention or arrest by local police. The mention of mask-wearing ICE agents and undocumented status as trained agents appears to be fabricated or a misinterpretation of existing sanctuary policies, which typically limit cooperation with federal immigration enforcement but do not mandate detaining ICE agents based on mask usage or undocumented status.
Given the absence of any corroborating evidence or official policy discussions in credible mainstream news sources, the claim is false and appears to be misinformation or a distorted narrative.