Costolo said Twitter found itself in an invidious position in the case of Malcolm Harris, an Occupy Wall Street protester whose tweets were sought by prosecutors in New York.
Speaking at the Online News Association's annual conference in San Francisco, Costolo said: "We strongly believe it's important for us to defend our users' right to protest the forced publication of their private information."
He said the company had spent a large amount of its money and the time of its top in house legal resources to fight the Harris case. Earlier this month a court in New York ordered Twitter to turn over three months' worth of Harris's tweets relating to protests on Brooklyn Bridge in New York last year.
The court allowed for the information to be sealed until an appeal is heard. Costolo said Twitter was disappointed that it was forced to hand over the information in advance of the appeal, even in sealed form. "We have been put between a rock and a hard place," he said.
He acknowledged that Twitter faced wrangles over free speech all over the world and it did not have a "one-size-fits-all solution". He said: "There are things you can't say about Attaturk in Turkey because they are illegal but people hop on Twitter and say these things."
Costolo also addressed concerns associated with changes made to Twitter's API in recent months, which have provoked howls of criticism from within the developer community. "We haven't done as good a job of communicating the 'what' and 'why' as we should have done ... I think that has hurt us," he said.
He said Twitter would continue to develop new features, including the ability for users to download all their tweets. That would be available by the end of the year, he said – although he conceded that it was easy for him as CEO to make this promise. The engineer working on the project might have another view, he joked.
guardian.co.uk © Guardian News and Media Limited 2010
image: © West McGowan