Barred from employment with the federal government. Considered mentally ill by the psychiatric profession. Seen as criminals under state laws. Subjected to invasive surveillance and targeting by the FBI.

This hostile backdrop of the “Lavender Scare” in the 1950s gave rise to some of the earliest organized advocacy efforts on behalf of LGBTQ equality.

J. Edgar Hoover’s FBI and its “Sex Deviate” program worked feverishly to ruin the lives of untold numbers of gay men and lesbians and to intimidate members of groups like the Mattachine Society, which dared to agitate for the basic dignity of gay people.

A half-century later, this history has not been lost on the nation’s leading LGBTQ equality organizations, which yesterday joined allies in the civil liberties and human rights community in sending a letter to President Barack Obama, raising serious concerns over revelations that the FBI targeted leaders of the Muslim community for yearslong secret surveillance.

The letter notes that this appears to fit a disturbing pattern, both past and present, of the government engaging in discriminatory and abusive surveillance against individuals, based not on what they have done but what they believe or who they are.

We know from history and experience that discriminatory surveillance and profiling by law enforcement agencies has had a disproportionately negative impact on LGBTQ people, particularly people of color. The largest national survey of transgender people to date found 22 percent of respondents who have interacted with police reported experiencing bias-based harassment, with substantially higher rates reported by respondents of color.

Remember the police raids and harassment that led to the eruption of a rebellion at the Stonewall Inn 45 years ago? How about the unlawful sting operations targeting gay and bisexual men and the profiling of transgender women as sex workers from our own decade? The harms of ineffective and un-American profiling—regardless of the communities it is directed against—are of clear concern and importance to the LGBTQ community.

So what can be done? The most important step that the government can take to curb abusive surveillance and profiling is to update existing guidance banning racial profiling by federal law-enforcement agencies. The guidance must be amended to explicitly ban profiling on the basis of religion, sexual orientation, gender identity, or national origin, as well as close existing loopholes that permit all forms of racial profiling in the national security and border contexts.

We must learn from past abuses. Minority communities cannot enjoy the equality and dignity afforded them by the Constitution when they can be routinely subjected to discriminatory profiling for things like “driving while black,” “praying while brown,” or “walking while trans.” As a country, we can and must do better.