No one knows what Palantir—named after a magical rock in Lord of The Rings that granted remote vision—exactly does. But we know enough to know it's not just another California startup. The secretive data-mining company works directly with the American government, has a product named "Prism," and some very close ties to Facebook, one of the NSA's top targets.

Palantir says it sells "software that allows organizations to make sense of massive amounts of disparate data," for purposes including "combating terrorism," and offers to bring "Silicon Valley to your doorstep." It's enjoyed early investments from the CIA, which might have something to do with its current napkin-valuation of around $5 billion, and now employs former top spooks like Michael Leiter. Palantir also happens to sell software called "Prism," which shares its namesake with an NSA spy program that also aims to bring Silicon Valley to snoop doorsteps around the Beltway. Palantir's Prism, according to a handy user manual published on TPM, "is a software component that lets you quickly integrate external databases"—exactly the kind of action that the NSA allegedly makes use of to suck up your Facebook browsing, Gmail inbox, and Google searches in realtime.

Coincidentally (!), the government loves Palantir, and spends millions to use its software, according to federal contract data. The Department of Defense—which operates the NSA—has been pumping money into Palantir from 2009 to as recently as spring of this year. It's also something of an eyebrow-moving coincidence that 2009 marked the first year of Facebook's alleged participation in the NSA data-mill. Facebook and Palantir know each other.

Facebook was once a neighbor—directly across the street—of Palantir, at 156 University Avenue in Palo Alto. Peter Thiel, who sits on Facebook's board of directors and has mentored Mark Zuckerberg for close to a decade, is a co-founder of Palantir—though that detail is omitted from his bio on the board's website. Sean Parker, Facebook's notorious first president and another earlier investor, created the VC firm Founder's Fund along with Thiel—and yes, it invests in Palantir. As Facebook has spread into the brains of a billion users and completely saturated the United States, it's become one of the NSA's top targets via PRISM: Federal spies have “continued exponential growth in [surveillance] tasking to Facebook," says the Washington Post, and federal intel analysts enjoy "extensive search and surveillance capabilities against the variety of online social networking services.”

It'd make sense for the Feds to outsource a sinister program like PRISM to a relatively unknown entity like Palantir. Private sector contracts are cheaper than building your own from scratch. Paying Palantir would also give every single PR rep in tech an easy out: No, we don't work with the government [because we work with Palantir].

So of course, Facebook denies any governmental conspiring, because, what else would it possibly say? It's not like any of the people in a position to talk to press would even have been briefed on something so ostensibly nefarious. It goes without saying that Palantir won't say anything either—nor do these dots connect to anything definitive. But when the biggest social network is accused of lazing in bed with the NSA, we shouldn't be entirely surprised: Facebook, the largest social network in the history of such things, is already friendly with one of the most sophisticated, shadowy private spying efforts in the history of the world.

Maybe Prism isn't PRISM. But Facebook's high council is A-OK with spies—and the company that does it best is right in their backyard.

Update: Palantir says its Prism is not the NSA's PRISM.