There is the rub. Mr. Karp is eloquent on the subject of Palantir saving lives, but it is in business to make money — as are its eager investors. It actively seeks corporate contracts worth tens of millions, and is getting bigger by the day. People familiar with the company say it has big deals with insurers, health care companies and media corporations, among others. Its advisers include James Carville, the Democratic strategist; Condoleezza Rice, the former secretary of state; George J. Tenet, the former C.I.A. director; and Michael Ovitz, the former head of Disney Studios and Hollywood superagent.

Palantir is growing by selling software to private companies. Whether those companies will properly use its privacy safeguards, which were designed for the government, is entirely up to those customers. Palantir has worked to recover from its own ethical lapses, but Mr. Karp acknowledges that it cannot control the ethics of its customers.

Still, Palantir stands out in the tech industry. Near Mr. Karp’s office are books that employees are encouraged to read on subjects like database structures, critical histories of the C.I.A. and improvisational theater. The company caps salaries at $137,000 a year and bonuses at $15,000; it allows internal stock sales, but only up $300,000 a year. Given the current Valley gold rush, where mundane work can make people millionaires before 30, a place where engineers settle for a “mere” total of $450,000 seems extraordinary.

Instead of selling stock to the public, Mr. Karp and other executives are toying with the idea of creating new kinds of financial instruments, like a bond that pays off on future earnings, to unlock a bit of Palantir’s value.

“You may not get rich” working at Palantir, Mr. Karp said, but “you live like the prince of a small municipality.” That means not just the usual free food, drinks and foosball that are expected in Palo Alto companies, but also “interesting work that matters.”

Ideals vs. Commerce

Palantir is not the first company dealing with big data that has been conflicted between ideals and commerce. As graduate students at Stanford, Sergey Brin and Larry Page wrote that “advertising-funded search engines will be inherently biased toward the advertisers.” Then they started Google, which makes money from advertising. Mark Zuckerberg of Facebook used to talk about a society of complete openness, while mining people’s lives to sell ads.