This post originally appeared on Quora.

“Did Palantir’s founders consider the ethical implications of their work? Do they have thoughts about the consequences of what they built?”

Yes, we thought a lot about the ethical implications.

Palantir was created to protect the realm — with a warning built into its name.

Hundreds from the US and allied armed services have thanked me in person for Palantir’s system — for reasons such as saving lives against IED’s and other threats, or helping them root out terrorists before they could strike again – and received thanks in return for their service. Others have interrupted talks and protested, or in rare cases even threatened my other activities. What’s the story?

I’m a proud founder of Palantir — the company wouldn’t exist if it weren’t for me, something which is also true for at least a handful of other people. But I haven’t been in charge of the company for about a decade and no longer speak for the company’s board or leaders [although I remain a shareholder / advisor].

In the fantasy realm of Tolkien, the palantir seeing stones were made thousands of years ago by the elves of Valinor in the Uttermost West, and gifted to their friends around the world. These stones could communicate to help see the past and understand the future, and were used to secure the world by overcoming forces of evil. Unfortunately, in future ages, they eventually fall into the wrong hands and are used for corrupt purposes — their images distorted to pervert goals, and their power harnessed to further evil. What might their creators have done to prevent this — and was it still worth creating them?

When we were starting Palantir after 9/11 we were reacting to a world that was full of scary asymmetric threats. Information had become more important than anything else when it came to defense, yet the US had a defense-industrial complex that didn’t understand how to build modern software systems. Studying Computer Science in my youth, we grew up on stories of the NSA and other government projects being years or decades ahead of industry, but it was clear that by the late 1990s the talent in Silicon Valley had gotten way ahead of the industry around DC. The cost-plus contracting and old-fashioned top-down cultures of the east coast were causing major software contracts to go hundreds of millions or billions over budget, and leading to frequent years-long delays.

The large systems created by the giant DC insiders didn’t have the infrastructure to integrate all the data necessary, work at scale, properly protect data and enforce civil liberties. It was the worst of both worlds: they were failing morally on data protection without even getting the bad guys. Had a proper technology infrastructure been in place supporting alert investigators, 9/11 would not have happened. The future of our nation’s security depended on our ability to solve these problems quickly, and it was our duty to take the best and brightest of Silicon Valley and apply early-21st century cutting edge software and data to the IC [intelligence community].

Technology had advanced a lot leading into the 2000s, and the scale of data was staggering — we knew that we were creating something powerful the world had never seen before. We agreed early on to build the system in such a way that it made policy and rules transparent — while those running the system can change the policy as they see fit, we also built warnings into the system. Audit trails would make sure that no matter how Palantir was used, there was clear evidence that could not be deleted so that senior policy makers and leaders could “watch the watchers” and see exactly what had been done. I’m not running the company anymore, but I hope these are still in place. Early on, years before it became popular in the 2010s, Palantir reached out to experts across the board, building a civil liberties group to help governments and companies become experts on how to protect data and make sure they were using and protecting it lawfully. We sought to balance privacy and other concerns to predict and prevent the sorts of issues that are now troubling consumer technology companies that didn’t take these early precautions.

In building Palantir starting in 2004 and applying it to the massive data problems in the defense/IC world of the US and its allies, we were forced to anticipate not only privacy and civil liberties infrastructure but also many of the technological developments that emerged years later in cloud and big data tools. This required us to create different types of federated search and infrastructure for data integration and manipulation at scale, some of which has only recently become available. Many of Palantir’s advancements remain far ahead of the state of the art, just as in prior eras of defense-technology achievement. The amazing technologies created by the mission-driven group of technologists at Palantir over the years is why more than half of its revenues today are tied to its commercial success, where our systems solve some of the hardest problems and enable critical workflows in major corporations around the world. Creating Palantir was a patriotic work of the best and brightest, and it succeeded.

But even more than audit trails and transparent policies and a civil liberties group, we went a step further and agreed to name the company with a warning from its fictional counterpart. We knew this was something important and powerful that was being done that could have both positive and negative impacts — we weighed these inputs, and we created Palantir. The name signifies that even after we are gone, it will be up to our posterity to make sure Palantir is not used for evil. Today, one only has to look as far as China to see how big data could potentially be abused to create a dystopian situation if there aren’t clear rules and boundaries. From what we have seen in international competition and our best understanding, China doesn’t yet have anything like Palantir, but it’s clear they are building in this same vein. Who knows what they will create as some global companies and their own advanced groups at impressive companies like TenCent, etc, contribute to their knowledge and understanding of this area. One can only hope that as their technology gets more powerful, forces for accountability, transparency of government action, and liberty will win out in both countries.

Palantir has done immeasurable good for America and our allies’ defense, saving huge numbers of lives and tens of billions of dollars compared to legacy systems. It has achieved this thanks to a Silicon Valley origin and culture of top technologists complemented by extraordinary persistence, often proving superior technology solutions to those who care about substance with smaller contracts — but then taking years to overcome wasteful, entrenched, crony products that characterize much of the defense industrial complex — before winning major contracts. Making use of what we created for this original context, Palantir has also done a variety of important philanthropic work in areas that impact the least well off here and around the world, and as part of its business solved some of the most important data and business challenges for tens of major corporations.

IMMIGRATION PROTESTS AND PALANTIR

Despite its good work, and perhaps because I’m more public than other co-founders, I’m sometimes protested or featured in online screeds against the company. Most of this is due to one small aspect of what it does — its work with ICE. I didn’t anticipate this — when thinking of the positive achievements and near-term negative possibilities, I expected pushback about allying with more controversial US allies that we were encouraged to help coordinate with the CIA [which made me nervous were they to figure out how to use the system towards ends that are not aligned with our values], or perhaps protests against working with parts of the US IC that use controversial data-collection techniques.

I had already left the company when Palantir contracted with ICE under the Obama Administration, a contract I understand it continues to service at a time that ICE has become more controversial in certain circles.

Alex Karp, my co-founder and Palantir’s CEO, was on TV last week and I thought he made a good point that it shouldn’t be up to a small atypical group of Americans based in the SF Bay Area to impose their values on the rest of the country just because we may be the best technologists. I know he is more on the “intellectual left” than I am but that we share concerns about some of our immigration laws – but to paraphrase, he said the company would work within what democratic societies decide are the rules. I think this is basically correct, within limits.

What is my perspective on immigration, and Palantir’s work?

Personally, I don’t agree with much of the indignity with which we treat visitors to our country. It’s particularly important for our reputation and our economy that we are more respectful to legal visitors who should be honored guests, waiting as little as possible when coming in. I hope you agree — the delays at immigration are bad enough [when are we going to create transparent metrics and accountability for these government departments?]. But making it often slow and hard to bring the best and brightest to America / hard to keep them here, sending them back to build great companies elsewhere instead, is bad policy that hurts the prosperity of every American [and even making our guests deal with rules like H1B’s which echo indentured servitude gives too much power to corporations over these people’s lives and is ethically suboptimal – a topic for another day].

But perhaps even more important on a moral level are those who are here illegally — our progress as a moral people can best be measured by the dignity and respect with which we treat the least well off among us — and few are less well off than the poor migrants seeking opportunity to participate in our great nation. I have heard rumors of unsafe and unsanitary conditions or other mistreatment of migrants and if that is the case, it’s unconscionable – we should be allocating the resources necessary to treat these people with respect as fellow human beings, even if they are being detained or expelled. I don’t agree with breaking the law, but I applaud people who want to come and be part of our country. My ancestors came in similarly humble circumstances, and America will only remain a great nation if we can find ways to respect and help those in need who are eager to live in freedom and work for a better life.

However, a great nation also needs to defend its borders. Our media and politics today are not good at nuance. It’s possible to fight for the dignity of the least well off while also fighting to enforce our laws and to keep bad guys from getting into the country whenever they wish. A nation which cannot enforce its borders and its security is no longer really a nation at all.

The level of political conversation at this point has become a petulant mud-slinging contest between power-hungry cynics who insist on demonizing each other and riling up those who’ve not reached the stage of intellectual maturity that they can keep opposing truths in their mind at the same time. Of course, we must fight for the dignity of every human being. But also of course we must defend our borders, and enforce the laws as they are written. Of course, we must do what we can to go out of the way to treat children well; but of course, we must also be careful not to create incentives for people to traffic or otherwise use children at the border to attempt to get around the rules.

I hope that great leaders will emerge who are willing to compromise and get the law to a place where we can have both respect and security, by focusing on what’s right versus what sounds good in the moment to their political base. But until then, I’m proud to be the founder of a company that efficiently and effectively works with the United States government to enforce our laws. If Palantir refused to work with the US government, ICE wouldn’t go away, and our country would have to spend far more money on another system that was less effective at doing its job — which would also mean a system that was less effective at watching the watchers, less effective enforcing data policies as the alternative does not have advanced civil liberties infrastructure built over years to protect our citizens and our privacy.

Palantir’s government work is far more than a service provider to ICE — it powers the defense and intelligence apparatus behind tens of allied countries, and has been an indispensable system to millions of men and women serving our country and allies and protecting us. Innumerable terrorist murderers have been eliminated thanks to Palantir’s help, and tens of attacks that might otherwise occurred have been stopped — I often wish we would declassify many of these stories; obviously, we can’t expect to stop everything, but the security record of the last decade is extraordinary.

Unfortunately, rather than try to change the law, in this polarized climate some people are so radicalized that instead they attack those willing to help the US enforce the law. I don’t know who is sponsoring these protests, but this is not a sustainable method of change they are attempting / even if they were somehow successful, it would not lead to a healthy democracy. That said, there is a proud tradition of jury nullification and of states pushing back on the federal government, and I applaud civic activists who fight for what they believe is right even and especially when it’s against the law. But given that we need border security and a country where the best and brightest serve our government to help it to overcome its wasteful bureaucratic tendencies, I hope the vast majority of people on both political sides will applaud those Silicon Valley companies like Microsoft, Amazon, HP, Oracle, and Palantir who continue to do their best to navigate DC and serve our nation along with their other work. Our democracy works, and if the majority want to change the laws, we’ll work with the new laws at that point.

I’m not expecting many of the protesters to read or think about any of these things — but Palantir has mostly pursued a strategy of keeping its head down and doing good work, and while I’m proud of the company, I disagree with its decision not to defend itself more in public. Palantir has an extraordinary history of confronting the ethical issues in its sector from its very founding, proactively doing extra work to inculcate appropriate moral values and build infrastructure that protects civil liberties and enforces policy: in other words, grappling with and investing in these decisions in profound ways. Frankly, Palantir is awesome — it’s a national treasure, a rare Silicon Valley company with a top tech culture of the kind that doesn’t exist in our legacy industries but that was created as a mission-driven company to serve America.

I wrote this because I wanted people to know that we are very aware of these dynamics, and that I empathize with the fight for human dignity at a difficult time in our history.

I’m concerned that we continue to ensure that powerful data tools and information infrastructure are watched closely, with crystal clear rules around civil liberties and audit trails built into the core of their operation — with China as an example of an unacceptable big brother state.

But I’m also proud of the work I’ve done and that my former colleagues continue to do to serve and protect our country. Feel free to convince people to change the law and come to a good answer please, and I and others will help your cause if your ideas make sense — but don’t expect us to stop doing our duty.

These days, you know what: if you’re not being demonized by somebody, you’re probably not doing anything particularly useful.