Amina du Jean has never shared her real identity online. Yet somehow, the Metropolitan Police who recently turned up on her doorstep knew her full name and university. They hadn’t come to arrest du Jean – as an independent sex worker, they’d have no grounds to – but rather to perform a “welfare check”. “They said they were concerned that I was a victim of trafficking”, she tells me.

What they were really saying was that they were watching her.

Du Jean can’t be sure of how the police identified her, but she can guess. As a sex worker and former J-Pop idol, her face is all over the internet.

A decade ago, being “face out” might have been a bold statement for sex workers. Recently, it’s become a serious liability. As Gracie Bradley, policy and campaigns manager for human rights organisation Liberty put it at a recent event, police use of facial recognition technology is “turning us all into walking ID cards”.

Technology had until recently made sex workers safer, allowing them to share client references and GPS locations. Yet developments in machine learning, compounded by governments’ slowness to protect citizens’ data, has made the internet an ever-more hostile environment.

The algorithmic dot-joining that advertises you baby clothes before you even know you’re pregnant might be creepy to most people, but can have life-threatening consequences for sex workers. In 2017, for example, Facebook began suggesting a Californian sex worker’s clients to her as “People You May Know”. What if they’d suggested her to them, too?

At the same time, the migration of sex work to online platforms has made it possible for states to survey workers on an industrial scale – often, as in du Jean’s case, under the guise of sex trafficking crackdowns. Days after the US’s Department of Homeland Security seized the adult listings site Eros in 2017, dozens of sex workers with profiles on the site were detained and deported at the US border.

“We got too comfortable on the internet,” sex worker and PhD researcher Camille Melissa tells me in an interview, “and forgot who was looking at us.”

Yet Melissa isn’t just complaining about surveillance. She wants to rally fellow workers to do something about it. Two weeks ago, Melissa, Bradley and du Jean appeared together on a panel as part of the Sex Worker Advocacy and Resistance Movement (SWARM)’s 10th anniversary “festival of resistance”, A Decriminalised Future. The two-day conference, held at the Brady Arts Centre in Whitechapel, convened sex workers and their allies from around the world to discuss all manner of issues facing the industry, including technological surveillance.

Of course, this is an issue for everybody, not just sex workers themselves. It’s just that, as Bradley puts it, “state surveillance is never deployed evenly”. Marginalised people – sex workers, migrants, people of colour—are always the first to be targeted. It’s only once the net widens that the problem penetrates public consciousness.

Last week a British office worker, represented by Liberty’s lawyers, brought the first ever legal challenge to the British police’s use of facial recognition (they have been using the technology since 2015). Across the Atlantic, a fightback is mounting against Amazon’s Rekognition software. The software, which civil rights campaigners have called “perhaps the most dangerous surveillance technology ever developed", allows its users to identify people in photos or videos by comparing them with a repository of images.

The belatedness of broader civic resistance to new forms of technological surveillance is forcing sex workers to take matters into their own hands; though for obvious reasons, they are reluctant to get too technical about how. Bradley suggests three methods as a minimum: Virtual Private Networks, or VPNs, which make it difficult to geolocate internet activity; private browsers, which keep your browsing history and web cache confidential; and encryption, which ensures your data can’t be intercepted between devices. Bradley says counter-surveillance has to be collective in order to work: unless everyone does it, those who do will be marked as suspicious.

It’s surprising, then, that Liara Roux, a sex worker and organiser based in New York, is happy to use Twitter’s direct messaging service and WhatsApp calls. Roux notes that technical workarounds are prone to human error. “It’s like a condom. If you use it perfectly every time, it has 99 per cent success rate. But if you occasionally slip up, you've defeated the point.” Roux extends the metaphor to user experience: “A VPN slows you down online. It doesn't work as well, doesn't feel as nice.”

I suggest extending it even further: condoms aren’t universally accessible, nor is encryption (which takes time) or VPNs (which cost money). Du Jean agrees: surveillance has entrenched the economic divide between online and street sex work, she says, as staying safe online requires even more resources than it once did.

Juno Mac, a sex worker and co-author of Revolting Prostitutes, suggests that as digital spaces become increasingly unsafe, physical ones feel safer in comparison.

“Resistance now means moving back to cultivating real-life connections,” she says – like the ones made at this conference. If there is a silver lining to SESTA/FOSTA – the US legislation which forced many sex workers offline, often into more precarious street work – this is it. Since the law came into force last year, sex worker meet-ups have proliferated.

Again, Roux warns against naivety. “Unless every single person is leaving their phone at home – at least covering their microphone and cameras and turning location services off – even meeting in person isn’t fool proof.

“Unless you’re taking extreme measures – and even then, they can run facial recognition on traffic cameras – there's nowhere to hide.” That is, from the state at least. One precaution Roux takes is to keep their address and legal name separate. “Obviously it’s not going to keep me safe from the government,” but it might from stalkers.

In an immediate sense, these are who sex workers are most worried about – creeps were using facial recognition to doxx them long before governments were. It’s certainly clients that concern Roux – though they acknowledge this could be because their American citizenship carries high currency at global borders.

When their phone stopped ringing in the summer of 2015, Roux got suspicious. A friend investigated and discovered someone had been diverting their calls to a fraudulent Google Voice account. That’s when it clicked. “I’d had a client who was a Google security researcher,” says Roux. “While I was seeing him, I wasn’t showing my face online. He’d continuously ask for selfies, but I knew where he worked, so didn’t buy it. Then I fired him and he went into overdrive. He used facial recognition to find my dating profile, then my LinkedIn, then my number.”

But stalkers, states and Silicon Valley are often motivated by the same prurient fascination with their subjects. “Men hunt out information about sex workers,” says Melissa. “They can't help it. They need to know everything about you." Worse still, they’re often the same people: Melissa tells me about a stalker who transpired to be a serving Metropolitan Police officer. Sex workers are ripe for surveillance because stalkers not only act as, but often are, the foot soldiers of big government and big tech.

The internet, says Melissa, “has back-flipped on us”. If it once offered sex workers anonymity, it is now making it ever easier to be outed; Melissa doesn’t know any sex workers that haven’t been. Of all people, it’s Roux who is “optimistic” about this. The same technology that “is killing people right now” could in the long-term trigger a culture shift.

As Melissa puts it, the perceived edginess of sex workers’ “otherness” is a prime motivation for surveilling them. Yet as workers are forced into the open by increasingly sophisticated surveillance technologies, the fact of their existence becomes banal, and the motivation for monitoring them disappears. In the end, Roux hopes, surveillance may be paradoxically self-defeating.

Rivkah Brown is a freelance journalist who writes for the Economist, Financial Times and London Review of Books. She tweets @RivkahBrown