Allow me to advance a radical thesis: Today’s outbreaks of nasty online behavior are directly linked to the history of the counterculture in America, and in particular to the war on drugs.

In order to build a bridge over what might at first seem like a huge distance, I’ll need to go over some background. It is widely perceived that the problem of uncivil conduct online has reached epidemic proportions. Michael Kinsley, a pioneer of confrontational political debate on cable television, recently wrote in Slate, “When you write for the Web, you open yourself up to breathtakingly vicious vitriol. People wish things on your mother, simply for bearing you, that you wouldn’t wish on Hitler.” David Pogue echoed this sentiment in The New York Times: “The deeper we sail into the new online world of communications, the sadder I get about its future....What’s really stunning is how hostile ordinary people are to each other online these days.”

But it’s not true that people are universally nasty online. Behavior actually varies considerably from site to site. There are many reasonable theories about what brings out the best or worst online behaviors; demographics, economics, child-rearing trends, perhaps even the average time of day of usage could very well play a role. My opinion, however, is that certain details in the design of the user experience of a Web site are the most important factors.

People who can spontaneously invent a pseudonym in order to post a comment on a blog or on YouTube are often remarkably mean. Buyers and sellers on eBay are usually civil, despite occasional annoyances like fraud. Based on those data you could propose that transient anonymity coupled with a lack of consequences is what brings out online idiocy. With more data, the hypothesis can be refined. Participants in Second Life (a virtual online world) are not as mean to each other as people posting comments to Slashdot (a popular technology news site) or engaging in edit wars on Wikipedia, even though all use persistent pseudonyms. I think the difference is that on Second Life the pseudonymous personality itself is highly valuable and requires a lot of work to create. So a better portrait of the culprit is effortless,­ consequence-free, transient anonymity in the service of a goal, like promoting a point of view, that stands entirely apart from one’s identity or personality. Call it drive-by anonymity.

Anonymity certainly has a place, but that place needs to be designed carefully. Voting and peer review are pre-Internet examples of beneficial anonymity. Sometimes it is desirable for people to be free of fear of reprisal or stigma in order to invoke honest opinions. But, as I have argued (in my November 2006 column), anonymous groups of people should be given only specific questions to answer, questions no more complicated than voting yes or no or setting a price for a product. To have a substantial exchange, you need to be fully present. That is why facing one’s accuser is a fundamental right of the accused.

Drive-by anonymity scares me because people connected over the Internet have significant power. That power can be beneficial, as when customers band together to force companies to act more ethically or when bystanders document bad behavior on YouTube. Unfortunately, scary outbreaks of online mob behavior also occur. Recently, a series of “Scarlet Letter” postings in China have incited online throngs to hunt down accused adulterers, to the point that some ­individuals have had to barricade themselves in their homes. It’s not crazy to worry that, with millions of people connected through a medium that sometimes brings out their worst tendencies, massive, fascist-style mobs could rise up suddenly.

This new style of anonymity has actually been incubating for awhile. Before the Web, there were other types of online connections, of which Usenet was probably the most influential. Usenet was an online directory of topics where anyone could post comments, drive-by style. One portion of Usenet, called “alt,” was reserved for nonacademic topics, including those that were oddball, pornographic, illegal, or offensive. A lot of the alt material was wonderful, such as information about obscure musical instruments, while some of it was sickening, such as tutorials on cannibalism.

To get online in those days you usually had to have an academic, corporate, or military connection, so the Usenet population was mostly adult and educated. That didn’t help. Users still turned into mean idiots online. That is one piece of evidence that it’s the design, not the demographic, that concentrates bad behavior. Since there were so few people online, though, bad “netiquette” was then more of a curiosity than a problem.

Why was drive-by anonymity supported by Usenet? You could argue that it was the easiest design to implement at the time, but I’m not sure that’s true. All those academic, corporate, and military users belonged to large, well-structured organizations, so the hooks were immediately available to create a nonanonymous design. If that had happened, today’s Web sites might not have inherited the drive-by design aesthetic.

So if it wasn’t laziness that promoted online anonymity, what did? Here’s where I think the war on drugs has left us with an unfortunate legacy.

The Internet’s foundational design (going all the way back to its 1960s origins as the Defense Department’s Arpanet) was initially motivated by the cold war. A decentralized communications network was supposed to have better odds of surviving a massive nuclear weapons attack. The next layers of code built on top of that base, including Usenet, were created mostly in the countercultural climate of the 1970s and 1980s, and particularly in the San Francisco Bay Area, which includes Silicon Valley. For that generation of digital designers, fears of a foreign attack were supplanted by fears of an overly intrusive government at home.

I often found myself a little out of step with my peers in those pre-Web days. One notable example occurred at a lunch with a few of my Net-philic buddies in San Francisco in the early 1990s. This lunch turned out to have been the founding event for an admirable organization called the Electronic Frontier Foundation (EFF)—and I declined to become one of the founders. The hot issue of that moment was encryption. The EFF’s initial top goal was to ensure that everyone would be able to use what was then thought of as “military-grade” encryption to communicate. I couldn’t sign up for that mission. The thought of everyone communicating in absolute secrecy seemed lonely and scary to me.

Well, I had never been worried about being arrested in America! I suspect that all the others at the table had experienced that worry, though. Experimentation with illegal, mind-altering drugs was the rule, not the exception, in computer culture at the time. For some reason I was never interested in drugs, so that fear wasn’t something I knew directly. Many influential engineers were also a few years older than I was, the right age to have faced the draft to fight in Vietnam.

My worries weren’t entirely different; they just weren’t prioritized in the same order. I was more afraid of what ordinary folks like us were capable of than of the police. The notion in the air those days was that the good, enlightened people would use digital networks to evade the bad enforcers, who answered only to an evil elite that was trying to oppress everyone else. I was more concerned that “the people” could suddenly get nasty. (My mother was sent to a concentration camp when she was only a little girl by a society that went mad en masse within a remarkably short period of time.)

It’s strange to think of all those brilliant engineers, who understood they were building the greatest source of new wealth in a generation, worrying about getting busted. It’s even stranger to think of China’s self-appointed antiadultery militias being enabled by the same privacy-seeking behaviors of America’s old hippies. This all comes down to a question of balance: Techniques that help repel the power of one mob can become the source of excessive power for a different mob.

The idea that freedom meant protecting the privacy of bands of bad boys was not just part of the character of coastal, liberal America—it swept the whole country. In the 1970s there was widespread discontent in the heartland with the newly imposed 55-mile-per-hour speed limit. A populist outlaw culture rose up around a media technology, and that technology was CB radio. Truckers and those who idolized them would make up untraceable names, or handles, and warn each other about where the police were on the freeway, waiting to issue speeding tickets. In short, the CB craze was another source of the allure of instant easy anonymity. Today’s anonymous screen names and e-mail addresses even resemble those old CB handles.

Now that most of America, and much of the world, has Internet access, it really matters if online design is bringing out mean and irresponsible aspects of people’s personalities. At the same time, the fears of the EFF types are still worth considering. If anonymity were banished today, would some company or agency compile a dossier on what each person had said or downloaded online, simply by watching? That information would be so valuable that it would probably be collected.Then we would have to deal with record companies suing over each song a kid downloaded improperly, marketers targeting each of us with enough accuracy to be more than annoying, and perhaps nightmare scenarios of instant witch hunts and roundups.

Computers have an unfortunate tendency to present us with binary choices at every level, not just at the lowest one, where the bits are switching. It is easy to be anonymous or fully revealed, but hard to be revealed just enough. Still, that does happen, to varying degrees. Sites like eBay and Second Life are more valuable than their stock prices will ever indicate because they give hints about how design can promote the essential middle path—one that balances online privacy with online civility.