The openness and anonymity of Twitter Inc. that rocketed the short-messaging service to global fame are now landing it in trouble.

As Congress and others scrutinize Russia’s alleged use of social media to influence the U.S. presidential election, one focal point is the prevalence on Twitter of bots, or automated accounts, that can be used to disseminate manipulative information.