Tanzania, a country that has long been upheld by Washington as an example of transparency and governance in Africa, is on the verge of enacting some of the most draconian laws on data sharing in the region. And it’s being done largely in secret. The U.S. government, as well as development agencies such as the World Bank, do Tanzanians a disservice by failing to condemn laws that could severely harm media freedom.

In March, Tanzania’s parliament rushed through two bills that contain language that journalists and activists decry as a threat to free expression and to journalism. The first bill, the Cybercrime Act, which the government has said is necessary to cut down on cybersecurity threats to the country, was passed in the middle of the night and contains harsh punitive measures such as fines and at least six months of jail time for sending unsolicited messages via computer.

In other words, in Tanzania one could be sent to prison for sending spam to a friend.

The newly passed Statistics Act is also disturbing. Under certain clauses in the bill, “any communication media, (magazines, newspapers, websites, or radio, for example) which publishes false or misleading statistical information” could be punished with a fine of “not less than 10 million shillings [about $5000] or to imprisonment of not less than twelve months, or both.” Furthermore, any person who dares publish statistics that may lead to what the government deems as a “distortion of facts” and without the authorization of the National Statistics Bureau can be punished with at least a year in prison.

That’s not quite the behavior you’d want from a country Secretary of State John Kerry recently claimed is a “model in the region for good governance, democratic ideals, and individual freedoms.”

The statistics bill threatens to criminalize those journalists and whistleblowers reporting on government corruption, for example. It could punish nongovernmental agencies that conduct their own statistical research or challenge official government statistics.

“The first victims of this is the media,” said Maria Sarungi Tsehai, a media activist and commentator in Tanzania. “They are the ones publishing statistics to the much broader public. These two bills are a definite sign of a very worrying trend. What has become evident is that there has been an indefinite shutdown of newspapers, using archaic laws.”

Mike Mckee, co-founder of Jamii  Forums, one of Tanzania’s largest online platforms, said in an interview, “You can imagine traditional media wouldn’t publish on issues like water, or education, because they will be afraid to be penalized. They would be afraid to be taken down.”

President Jakaya Kikwete is expected to sign the bills into law. But few know what the final versions of the bills even look like, which is troubling. And there may be deeper reasons as to why the government has rushed these pieces of legislation outside of the eye of the public.

The ruling party of Kikwete, the Chama Cha Mapinduzi (CCM), is facing national elections this year. And the CCM, which has been in power for 50 years, is facing significant challenges from the opposition. Now more than ever, the use of mobile phones and social media in Tanzania makes information sharing much easier. The hurried passing of these bills serves to stifle criticism and dissent ahead of October’s national polls and speaks of a government uncomfortable with the new realities of online media and data flows. What better way to control the narrative about the country’s development than by controlling statistics and information sharing?

The international donor community has a hand in this mess, too. According to publicly available documents, the World Bank is in the stages of implementing a $100 million loan to Tanzania to support Open Government and Public Financial Management (OGPFM) in the country. The OGPFM project is closely linked to a parallel program in which the bank has been working with Tanzania’s Statistics Bureau to build the country’s statistics capacity. The project costs $30 million to implement. (Disclosure: I temporarily consulted for the World Bank two years ago.)

And what is one of the indicators of the World Bank statistics project? An operational statistics act, with a completion target date of June 30.

“We are very aware of the statistics bill, and indeed we do share concerns about some clauses of the bill. We have made these concerns clear to the government,” said Philippe Dongier, the World Bank’s country director for Tanzania. Dongier said he had not seen the latest version of the bill that is awaiting Kilwete’s signature. He also did not comment specifically on if he knew whether the government would address the parts of the bill that threaten to crack down on the media for publishing independent statistics.

Ah, the familiar and convenient expression of “concern” from donors and country partners when a recipient government is behaving badly. But what Tanzanians need from the U.S. government, from the U.S. Millennium Challenge Corp. (which pumped nearly $700 million into Tanzania in 2008, the largest grant in the program’s history) and from the World Bank is much more than concern behind closed-door lunch meetings. What the international donor community and partner governments owe Tanzanians (as well as the citizens of other donor-dependent countries) are strong public statements denouncing the increasing crackdowns on freedoms and the conditioning of further aid to demonstrable improvements in the country’s treatment of journalists and opposition viewpoints. Donor agencies need to ensure what they deem as merely a project deliverable to tick off the box, (such as the World Bank’s statistics act) doesn’t actually harm the people they are supposed to be serving.

Ironically, next week, Tanzania, as part of President Obama’s Open Government Partnership Initiative, is hosting the Africa regional meeting on open governance. Kikwete must take this opportunity to publicly drop the portions of these laws that stand to punish journalists and researchers for doing their jobs. And the World Bank, the United States and other donor entities need to stop ignoring Tanzania’s increasing repression and speak out — strongly.