"As many of you know, the SSDA's recalcitrant," Karp, using a Palantir codename for the CIA, said in the August 2015 meeting. "And we've walked away, or they walked away from us, at the NSA. Either way, I'm happy about that."

As of summer 2015, the Central Intelligence Agency, a signature client, was "recalcitrant" and didn't "like us," while Palantir's relationship with the National Security Agency had ended, Palantir CEO Alex Karp told staff in an internal video that was obtained by BuzzFeed News. The private remarks, made during a staff meeting, are at odds with a carefully crafted public image that has helped Palantir secure a $20 billion valuation and win business from a long list of corporations, nonprofits, and governments around the world.

Palantir Technologies , the Silicon Valley data company co-founded by billionaire investor Peter Thiel, has developed an almost mythical reputation for its work building tools for the U.S. intelligence community. But Palantir has had a far rockier relationship with the nation's top spy agencies than its image would let on, BuzzFeed News has learned.

The CIA, he said, "may not like us. Well, when the whole world is using Palantir they can still not like us. They'll have no choice." Suggesting that the Federal Bureau of Investigation had also had friction with Palantir, he continued, "That's de facto how we got the FBI, and every other recalcitrant place."

Palantir's data-mining software has become ingrained at the CIA, according to people familiar with the company and the agency. But the relationship has also been marked by tension and even hostility, three people with direct knowledge of the matter said. One source of the tension, these people said, has been Palantir's failure to quash persistent publicity about its CIA business and about its supposed role in helping to track down Osama bin Laden.

More from BuzzFeed News:

Video shows Palantir CEO ridiculing Trump and slamming his immigration rhetoric

50 Big US companies have $1.6 trillion hoarded in offshore tax havens, report says

The IRS has hired a debt collector that is being sued by the government

Palantir was never so critical to the NSA, despite media reports over the years linking the two. Palantir performed some pilot work for the NSA, but this did not turn into a full-fledged contract, according to two people with knowledge of the matter. The NSA has plenty of its own computer talent, and Palantir's particular expertise fit awkwardly with the agency's mission of intercepting communications and electronic signals, the people said.

A Palantir spokesperson said the company couldn't comment on its relationships with intelligence agencies. Spokespeople for the CIA and the NSA declined to comment.

Palantir, founded in 2004, has authentic ties to the intelligence community. It got an early $2 million investment from the CIA's venture capital arm, called In-Q-Tel, which helped the young startup develop data-crunching software that was well suited to the CIA's brand of spycraft. Later, Palantir won significant business from the FBI and the Defense Intelligence Agency, as well as the Department of Homeland Security, the military's Special Operations Command, and other federal agencies, according to company documents. (Don't ask what "SSDA" stands for; even many Palantir insiders have forgotten the origin of the company's nickname for the CIA.)

Palantir has expanded into corporate work — Karp said in the video that it had a total of 400 "deployments," or jobs around the world — but it still relies on the federal government for a significant portion of its revenue. And it now has a significant connection to the White House. Thiel, its co-founder and chairman, prominently supported President Donald Trump's campaign and became an adviser to the President after the election. Karp, however, supported Hillary Clinton for president and said in the 2015 staff meeting that "it would be hard to make up someone I find less appealing" than Trump.

In a June 2016 lawsuit that it filed against the Army in an effort to be considered for a lucrative contract, Palantir said its government clients had "overwhelmingly praised" its software.

But in the August 2015 meeting, Karp described the relationship with the federal government as colder, while discussing Palantir's business more broadly. "I think France may be the country where they just like us — as opposed to the U.S. government, where they tolerate us because nothing else works," he said.

Palantir's relationship with the NSA, for one, has been limited, though it seems to loom large in the public imagination. A February report in The Intercept said Palantir had worked in the past to "facilitate, augment, and accelerate" an NSA tool called XKeyscore. In early 2015, TechCrunch reported that potential investors were circulating a document from two years earlier that listed the NSA as using Palantir software. TechCrunch didn't say whether that information originated from Palantir or from an outside broker — or whether it was still true.

The Palantir software, built with the CIA in mind, works better for managing HUMINT, or intelligence from human sources, than SIGINT, or intelligence from signals, which is the NSA's bread and butter, people familiar with it say. Even Palantir insiders say it's not surprising that the NSA relationship never took off.

The report that Palantir had a role in the bin Laden mission, though unconfirmed, has been repeated in numerous articles, sometimes as a "rumor," and always in nonspecific terms. The truth of the matter is a government secret and could not be determined.