US President Barack Obama must talk candidly to President Uhuru Kenyatta

This weekend, President Obama begins a visit to two pivotal African nations: Ethiopia, a semi-authoritarian state, and Kenya, a fragile democracy. Both have rapidly growing economies. Both are battling the virulent Al Shabaab terrorist insurgency.

The visit to Kenya has special significance, however, since the president is finally undertaking the “homecoming” Kenyans have impatiently awaited since 2009. Kenya is also where Mr Obama can make progress on problems that most matter to the United States, and in so doing put a troubled bilateral relationship back on track.

While the president is assured of an enthusiastic popular welcome in Kenya, he will encounter a prickly and defensive Kenyan government. President Uhuru Kenyatta’s supporters bristle when Americans or other Westerners question their government’s policies or performance.

Over the past two years, they have repeatedly accused the United States of trying to undermine, or even overthrow, the Kenyatta government by financing local non-governmental organisations. However far-fetched this rhetoric, Mr Obama will have to take it into account.

Fixing relations with Kenya requires that Mr Obama focus on three key objectives: a reinvigorated economic and development partnership, improved counter-terrorism cooperation and renewed American support for Kenyan civil society and other organisations that are working to safeguard political freedoms and promote more accountable governance.

Capitalising on Kenya’s dramatic economic gains over the last decade is the least problematic of these goals. It is no accident that Mr Obama’s visit coincides with Kenya’s hosting of the sixth Global Entrepreneurship Summit, the first held in sub-Saharan Africa.

Kenya’s fast-growing economy is based on a dynamic private sector, a diversified services sector and high education levels. Kenya’s financial institutions, its health care infrastructure and its universities are among Africa’s best. The country has become a world leader in innovative cellphone technology.

In contrast with previous decades of stalled development and falling living standards, Kenyans now have progress to celebrate, and Mr Obama will no doubt enthusiastically acknowledge it.

Through sponsorship of the Entrepreneurship Summit and other steps such as ‘Power Africa’ - an ambitious rural and urban electrification venture started last year - both Kenyans and Americans hope that more American businesses can be drawn to Kenya. Kenyans would probably welcome that as a counterbalance to China’s growing influence in East Africa.

Rapid growth of the economy as a whole, however, has left many poorer Kenyans behind. The negative side of Kenya’s new development narrative is widening inequality, pervasive violent crime and continuing high-level corruption.

Overhanging all this is Al Shabaab menace. Since the horrific Westgate Mall massacre in 2013, in which 67 died, Al Shabaab fighters - many of them Kenyan - have targeted civilians across the country’s largely Muslim north-east and coastal regions.

Often Al Shabaab singles out Christians, hoping to ignite conflict between Kenya’s Christian and Muslim communities. The worst such atrocity was a methodical hours-long massacre last April of 147 university students in the remote town of Garissa.

The failure of Kenya’s security services to prevent these attacks or even respond to them effectively has alarmed many Kenyans.

Weak leadership, poor coordination among security agencies and pervasive corruption, especially within the Kenyan police force, are fundamental problems. Rather than address those, President Kenyatta’s administration has instead moved to restrict media coverage of terrorist attacks and crack down on businesses, civic organisations and entire communities it charges are sympathetic to the Islamist insurgency.

Thus far, the crackdowns have achieved little except to arouse widespread resentment and anger among local human rights groups and Kenya’s largely peaceful Muslim minority. They have done almost nothing to slow Al Shabaab’s attacks. As a major security partner of Kenya, the United States must help confront a terrorist scourge that threatens not just Kenya, but all of East Africa. But simply pouring more money into equipment and conventional military training is clearly not the answer. Kenya’s security services urgently need reform.

Corruption at high levels must be rooted out. Doctrine must change to prioritise the protection of civilian populations. Less rivalry and better coordination among all agencies — intelligence, police and military — are essential if further tragedies like Westgate and Garissa are to be avoided.

More prosecutors, judges and judicial infrastructure are also urgently required so that Kenya can confront the terrorist threat in a manner that respects the rule of law.

President Obama’s multi-year, multi-nation “Security Governance Initiative” is designed in part to address problems like these in Africa. A credible and substantial offer of assistance under this initiative should be used to extract a commitment from President Kenyatta to order wide-ranging security sector reforms. In the absence of such reforms, it is difficult to see how Kenya will gain the upper hand against Al Shabaab without inflicting unacceptable damage on the rule of law and Kenya’s core democratic principles.

Indeed, many Kenyans fear that if Mr Obama does not challenge the Kenyatta government’s treatment of its critics, the lapse will be interpreted as a green light to continue cracking down in the name of Kenya’s own “war on terror”.

President Obama must tread carefully, but not silently, when addressing fundamental issues of democratic governance.

Kenyans will want to hear his views - an appeal he must answer.

Privately, he should be very direct with Kenya’s leaders, warning that Kenya’s prosperity and its democratic form of government, as well as its historically close relationship with the United States, are best protected by more reform and less scape-goating of doubters and dissenters.