The Chinese government has detained more than a million Uighurs, Kazakhs and other ethnic minorities for what it calls voluntary job training.
But a newly revealed classified blueprint shows that the camps Beijing runs in China's far west are instead secret centres for forced ideological and behavioural re-education.
The confidential documents, leaked to a consortium of international journalists, lay out the Chinese government's deliberate strategy to lock up minorities, most of whom are Muslims, to rewire their thoughts and even the language they speak.
The documents stipulate watch towers, double-locked doors and blanket video surveillance "to prevent escapes".
They describe an elaborate scoring system that grades detainees on how well they speak the dominant Mandarin language, memorise ideology and adhere to strict rules on everything down to bathing and using the toilet.
They also show how Beijing is pioneering a new form of social control using data and artificial intelligence.
With the help of mass surveillance technology, computers issued the names of tens of thousands of people for interrogation or detention in just one week, including university students and party officials who would not need vocational training.
Taken as a whole, the documents give the most significant description yet of how the mass detention camps work in the words of the Chinese government itself.
Experts say they spell out a vast system that targets, surveils and grades entire ethnicities to forcibly assimilate them – especially Uighurs, a Turkic minority of about 10 million with its own language and culture.
"They confirm that this is a form of cultural genocide," said Adrian Zenz, a leading security expert in the far western region of Xinjiang, where many Uighurs live.
"It really shows that from the onset, the Chinese government had a plan."
Mr Zenz said the documents echo the aim of the camps as outlined in a 2017 report from a local branch of the Xinjiang Ministry of Justice: To "wash brains, cleanse hearts, support the right, remove the wrong."
China has struggled for decades to control Xinjiang, where hundreds, both Uighurs and Han Chinese, have died in terror attacks, reprisals and race riots.
In 2014, Chinese President Xi Jinping launched what he called a People's War on Terror in response to terror attacks carried out by radical Uighur militants.
In late 2016, the crackdown intensified dramatically when Mr Xi named Chen Quanguo, a hardline official transferred from Tibet, as Xinjiang's new head. Most of the documents were issued in 2017.
"Since the measures have been taken, there's no single terrorist incident in the past three years," said a written response from the Chinese Embassy in the UK.
"Xinjiang is much safer....The so-called leaked documents are fabrication and fake news."
The statement said that religious freedom and the personal freedom of detainees was "fully respected" in Xinjiang.
The documents came from an anonymous source, and the International Consortium of Investigative Journalists verified them by consulting experts, cross-checking content and comparing signatures.
They consist of a notice with guidelines for the camps, four bulletins on how to use technology to target people, and a court case sentencing a local Uighur party official to 10 years in prison for telling colleagues not to say dirty words, watch porn or eat without praying.
Issued to rank-and-file officials by the powerful Xinjiang Communist Party Political and Legal Affairs Commission, the documents confirm what is known about the camps from the testimony of Uighurs and Kazakhs, satellite imagery and highly restricted visits by journalists to the region.
Independent experts on Chinese law say the detentions are a clear violation of China's own laws.