Peter Thiel's surveillance company Palantir is reportedly finalizing the digital framework for a potential mass deportation operation, should President Donald Trump decide to go that route.

The company is putting the last touches on an intelligence database called Investigative Case Management (ICM), according to The Intercept. The system won't be polished until September, but it's already used by Immigration and Customs Enforcement (ICE), the agency known for carrying out deportations.

Palantir is cofounded by Thiel, who has become Trump's go-to man for all things technology. The company apparently has a $41 million contract to construct and keep up the Investigative Case Management system, which has been deemed so vital to ICE that The Intercept reports the agency doesn't believe it can work without it.

The system gives ICE agents the ability to track down information on anyone they're watching. It collects data from other federal agencies and drops it into a central system, allowing ICE to mine it for a person's relationships, places of work, criminal records, when the person has been in and out of the country, and much more.

The branch of ICE best known for deportations — the Enforcement and Removal Office — uses Palantir's system to gather information for cases in criminal and civil court. Mashable has reached out to Palantir and ICE for comment.

This system isn't the only way ICE may be bolstered under Trump.

This system isn't the only way ICE may be bolstered under Trump. The president has also directed the agency to hire 10,000 additional officers, a number that would greatly aid any mass deportation effort.

Though Thiel's relationship with Trump is cozy, Palantir has had government surveillance contracts long before the Trump administration was a glimmer in our collective eyes. And though Palantir's website extols the wonders of privacy, it helped construct a surveillance system for the NSA called XKeyscore, which the NSA itself has called its most invasive system. XKeyscore maps out a jumble of personal data that allows federal agents to better understand a person's social and ideological connections.

Just think what an agent could do with a combination of XKeyScore and Investigative Case Management, if ever the two should meet.