Deep in the South Atlantic, a vast industrial operation is underway that Brazil's leaders say will turn their country into an oil power by the end of this decade. If the ambitious plans of Petrobras, the national oil company, come to fruition, by 2020 Brazil will be producing 5 million barrels per day, much of it from new offshore fields. That might make Brazil a top-five source of oil.

Managed wisely, this boom has the potential to do great good. Brazil's president, Dilma Rousseff, wants to use the oil money to pay for better education, health and infrastructure. She also wants to use the new fields to create a world-beating oil-services industry. But the bonanza also risks feeding some Brazilian vices: a spendthrift and corrupt political system, an overmighty state and overprotected domestic market, and neglect of saving, investment and training.

So it is worrying that there is far more debate in Brazil about how to spend the oil money than about how to develop the fields. If Brazil's economy is to benefit from oil, rather than be dominated by it, a big chunk of the proceeds should be saved offshore and used to offset future recessions. But the more immediate risks lie in how the oil is extracted.

The government has established a complicated legal framework for the fields. It has vested their ownership in Pre-Sal Petroleo, a new state body whose job is merely to collect and spend the oil money. It has granted an operating monopoly to Petrobras (although the company can strike production-sharing agreements with private partners). This glides over the complexity in developing fields that lie as far as 190 miles offshore, beneath 1.25 miles of water and as much as 3 miles of salt and rock.

Too much, too soon

To develop the new fields, and build onshore facilities, including refineries, Petrobras plans to invest $45 billion a year for the next five years, the largest investment program of any oil firm in the world. That is too much, too soon, both for Petrobras and for Brazil -- especially because the government has decreed that a large proportion of the necessary equipment and supplies be produced at home.

By demanding so much local content, the government may in fact be favoring some of the leading foreign oil-service companies. Many would have set up in Brazil anyway. Now, with less price competition from abroad, they will find it easier to charge more than the going rate. Seeking to ramp up production so fast, and relying so heavily on local supplies, also risks starving non-oil businesses of capital and skilled labor (which is in desperately short supply).

With oil, striking the right balance between the state and the private sector, and between national content and foreign expertise, is notoriously tricky. But it can be done.

Norway's example

Norway required foreign suppliers to work closely with local firms and forced Statoil, its national oil company, to bid against rivals to develop fields. Above all, it invested in training the workforce.

Brazilians need only to look at Mexico's Pemex to see the politicized bloat that can follow an oil boom -- or at Venezuela to see how oil can corrupt a country. Petrobras is not Pemex. Thanks to a meritocratic culture, and the discipline of having some of its stock traded, Petrobras is a leader in deep-sea oil. But operating as a monopolist is a poor way to maintain that edge. Happily, too, Brazil is not Venezuela. Its leaders can prove it by changing the rules to be more Norwegian.