I Flirt and Tweet. Follow Me at #Socialbot.

FROM the earliest days of the Internet, robotic programs, or bots, have been trying to pass themselves off as human. Chatbots greet users when they enter an online chat room, for example, or kick them out when they get obnoxious. More insidiously, spambots indiscriminately churn out e-mails advertising miracle stocks and unattended bank accounts in Nigeria. Bimbots deploy photos of gorgeous women to hawk work-from-home job ploys and illegal pharmaceuticals.

Now come socialbots. These automated charlatans are programmed to tweet and retweet. They have quirks, life histories and the gift of gab. Many of them have built-in databases of current events, so they can piece together phrases that seem relevant to their target audience. They have sleep-wake cycles so their fakery is more convincing, making them less prone to repetitive patterns that flag them as mere programs. Some have even been souped up by so-called persona management software, which makes them seem more real by adding matching Facebook, Reddit or Foursquare accounts, giving them an online footprint over time as they amass friends and like-minded followers.

Researchers say this new breed of bots is being designed not just with greater sophistication but also with grander goals: to sway elections, to influence the stock market, to attack governments, even to flirt with people and one another.

“Bots are getting smarter and easier to create, and people are more susceptible to being fooled by them because we’re more inundated with information,” said Filippo Menczer, a professor at Indiana University and one of the principal investigators for Truthy, a research program at Indiana University that tracks bots and Twitter trends.

Socialbots are being circulated around the Web for many purposes. To irritate his adversaries, a software developer from Australia designed a bot that automatically responds to tweets from climate change deniers, sending them counterarguments and links to studies debunking their claims. A security engineer in California programed a bot to scoop up reservations for State Bird Provisions, a trendy restaurant in San Francisco. Mercenary armies of bots can be bought on the Web for as little as $250.

For some, the goal is increasing popularity. Last month, computer scientists from the Federal University of Ouro Preto in Brazil revealed that Carina Santos, a much-followed journalist on Twitter, was actually not a real person but a bot that they had created. Based on the circulation of her tweets, a commonly used ranking site, Twitalyzer, ranked Ms. Santos as having more online “influence” than Oprah Winfrey.

Other bots have more underhanded ambitions. Last year, officials from Mexico’s governing Institutional Revolutionary Party were accused of using bots to sabotage the party’s critics by appropriating some of their hashtags and flooding Twitter with identical posts, designed to trip Twitter’s spam filter. Believing the posts to be spam, Twitter soon began blocking those hashtags entirely, temporarily silencing the critics, which was exactly what the government officials intended.

During a dispute over a Russian parliamentary election in 2011, thousands of Twitter bots, created months before but largely dormant, suddenly began posting hundreds of messages a day targeting anti-Kremlin activists, aiming to drown them out, according to security analysts. Researchers say similar tactics have been used more recently by the government in Syria.

Socialbots are tapping into an ever-expanding universe of social media. Last year, the number of Twitter accounts topped 500 million. Some researchers estimate that only 35 percent of the average Twitter user’s followers are real people. In fact, more than half of Internet traffic already comes from nonhuman sources like bots or other types of algorithms. Within two years, about 10 percent of the activity occurring on social online networks will be masquerading bots, according to technology researchers.

Dating sites provide especially fertile ground for socialbots. Swindlers routinely seek to dupe lonely people into sending money to fictitious suitors or to lure viewers toward pay-for-service pornography pages. Christian Rudder, a co-founder and general manager of OkCupid, said that when his dating site recently bought and redesigned a smaller site, they witnessed not just a sharp decline in bots, but also a sudden 15 percent drop in use of the new site by real people. This decrease in traffic occurred, he maintains, because the flirtatious messages and automated “likes” that bots had been posting to members’ pages had imbued the former site with a false sense of intimacy and activity. “Love was in the air,” Mr. Rudder said. “Robot love.”

Mr. Rudder added that his programmers are seeking to design their own bots that will flirt with invader bots, courting them into a special room, “a purgatory of sorts,” to talk to one another rather than fooling the humans.

In 2010, researchers with Truthy, the Indiana University research group, discovered a number of Twitter accounts sending out duplicate messages and re-tweeting messages from the same few accounts in a closely connected network. Two accounts, for example, sent out 20,000 similar tweets, most of them linking to, or promoting, the Web site of John A. Boehner, then the House minority leader, before the last midterm elections.

Much of the social media remains unregulated by campaign finance and transparency laws. So far, the Federal Election Commission has been reluctant to venture into this realm.

But the bots are likely to venture into ours, said Tim Hwang, chief scientist at the Pacific Social Architecting Corporation, which creates bots and technologies that can shape social behavior. “Our vision is that in the near future automatons will eventually be able to rally crowds, open up bank accounts, write letters,” he said, “all through human surrogates.”

Correction:

An earlier version of this article misstated a finding by computer scientists at the Federal University of Ouro Preto in Brazil who created a bot purporting to be a journalist named Carina Santos. While she ranked higher than Oprah Winfrey on a social-media ranking site, Twitalyzer, she did not also rank higher than Ms. Winfrey on Klout, a similar site.

An investigative reporter for The New York Times.

A version of this article appears in print on , on Page SR5 of the New York edition with the headline: I Flirt and Tweet. Follow Me at #Socialbot.. Order Reprints | Today’s Paper | Subscribe