Hurricane Gustav has come and gone, and New Orleans is still standing. The levees held. This is a great relief for the city's evacuated residents, not to mention people around the world who watched with dread as a deadly hurricane bore down on the Louisiana coastline just three years after Hurricane Katrina.

Katrina was a good teacher. Government agencies at all levels learned from the debacle that ensued when the levees broke in 2005 and tens of thousands of New Orleans' poorest residents were trapped in the city for days, many without food and water. This time, a near-total evacuation took place. The New Orleans city government worked with the state and federal counterparts to assemble a fleet of buses that got most of those without transportation out of the city. It declined to open the Superdome as a "shelter of last resort", forcing residents to choose between evacuation or risking their lives. Fema pre-positioned more supplies and response teams close to the affected area. The levees, only partially rebuilt and restored post-Katrina, were closely monitored for potential breaches.

But luck also played a large role here. Neither agencies nor flood-protection structures were tested with a truly catastrophic situation, in which plans can easily go awry. Gustav, once a powerful Category 4 storm, weakened to Category 2 by landfall, and it passed far enough to the west to deliver the New Orleans area only a glancing blow, generating nothing near the awesome strength of Katrina's storm surge.

That's why there's a real danger now that confidence born of the successful response to Gustav could turn to overconfidence. The fact is, being better prepared than in 2005 isn't saying all that much. Take Fema. An April report by the inspector general for the US department of homeland security, of which Fema is a part, said the agency had a long way to go and was still plagued by "budget shortfalls, reorganisations, inadequate information technology systems and confusing or limited authorities" over the areas it's supposed to run. That suggests in a true national emergency, Fema might break down just as it did before.

The New Orleans levees, meanwhile, are only midway through an upgrade due to be completed in 2011. Even then, though, it still won't protect against flooding from a direct hit by a big storm. And the fact that the city's largest canal nearly overflowed during Gustav, which turned out to be a relatively mild storm, isn't good news either. Already, another three storms are queuing up in the Atlantic, some or all of which may hit the US coast over the next two weeks. It's no time to breathe easy.

The fact is, due to feedback from human activities, nature has begun to change faster than US government institutions can keep up. There's a healthy scientific debate over the potential role of global warming in hurricane activity. Some scientists believe a warming atmosphere will lead to more powerful storms. Others say the effects will be minimal. But most everyone agrees that hurricane activity in the Atlantic is in a dangerous, possibly decades-long upswing.

If it is indeed amplified by global warming, we're going to see some storms unlike any in the past in the coming years. Meanwhile, the lure of living on the coast (and along riverbanks) has put many millions more people in the path of danger, along with their valuable properties, increasing the risk of huge, Katrina-scale losses that will test the insurance industry and the federal government's budgetary limits.

Is there any way to head this off? Both John McCain and Barack Obama have pledged bigger, better levees for New Orleans and sharper emergency response in general. That's to the good. But it's not just a matter of building new structures and appointing competent people (though it would be a good start). If he wants to avoid future Katrinas - and more generally, to meet the challenges posed by global warming - the next president should work to change the way government institutions operate.

Currently, for example, decisions on infrastructure, including flood protection, are made by congressional committees. In other words, those decisions are almost wholly, arbitrarily political. There's no easy way to change that, but the president ought to set some national priorities on what to build where, and push them hard, so the public expects changes - not just more pork for local districts.

On a deeper level, though, the government needs to become less reactive, more nimble. Institutions that do the work of fortifying the country against disaster - including the army corps of engineers, in charge of building levees - are notoriously traditional and slow-moving. They're designed for an era that's already over. If they're shaken up and redesigned from the top down, perhaps the US can get out in front of these looming problems.