We have entered an era when human beings pose a greater threat than nature to the earth's future. This started with the invention of nuclear weapons. Robert McNamara, US defence secretary during the 1962 Cuban missile crisis, later said: "We came within a hair's-breadth of nuclear war without realising it. It's no credit to us that we escaped - [Nikita] Khrushchev and [John F] Kennedy were lucky, as well as wise."
The threat of global nuclear annihilation involving tens of thousands of bombs has been in abeyance since the end of the cold war. But, in future decades, a global political realignment could lead to a stand-off between new superpowers which could be handled less well or less luckily than the Cuban crisis was. In the meantime, there is more risk than ever that smaller nuclear arsenals will be used in a regional context, or even by terrorists.
But other threats loom larger. Devastation could arise insidiously rather than suddenly, through unsustainable pressure on energy supplies, food, water and other natural resources. The world's population is projected to reach nine billion by 2050. The bigger the population becomes, the greater these pressures will be - especially if the developing world narrows the gap between itself and the developed world in its per-capita consumption.
Whether the rise continues beyond 2050 or is reversed will depend on what people who are now in their teens and twenties decide about the number and spacing of their children. Hundreds of millions of women are denied such a choice. Enhancing the life chances of the world's poorest people - by providing them with clean water, primary education and other basics - should be a humanitarian imperative. But it seems also a precondition for achieving the demographic transition.
Humankind's collective footprint is growing. It may irreversibly degrade our environment as our numbers grow and we each consume more. Advanced technology threatens us with other vulnerabilities.
Global society depends precariously on elaborate networks - electricity grids, air-traffic control, international finance, just-in-time delivery, and so forth. Unless these are highly resilient, their manifest benefits could be outweighed by catastrophic (albeit rare) breakdowns, cascading through the system. And concern about cyber attack, by criminals or by hostile nations, is rising sharply.
Simultaneous advances in genetics offer huge potential for medicine and agriculture, yet there is a downside. Already, the genomes for some viruses - polio, Spanish flu and severe acute respiratory syndrome (Sars) - have been synthesised. Expertise in such techniques will become widespread, posing a risk of "bio-error" or "bio-terror" that could have global impact.
We are kidding ourselves if we think that those with technical expertise will all be balanced and rational. Expertise can be allied with fanaticism - not just the fundamentalism that we're so mindful of today but that exemplified by some "New Age" cults, extreme eco-freaks, violent animal-rights campaigners and the like.
The concern is with low-probability, high-consequence events - real-world analogues of unforeseen crashes in the financial system. The discoveries of 21st-century science can't be predicted but we can make one firm forecast: there will be a widening gulf between what science enables us to do and what applications it is prudent or ethical to pursue.
Before long, new cognition-enhancing drugs, genetics and "cyborg" techniques may alter human beings. That is something qualitatively new in recorded history - and disquieting, because it could portend more fundamental forms of inequality, if these options were open only to a privileged few.
Will computers take over? Even back in the 1990s, IBM's Deep Blue beat the world chess champion Garry Kasparov. But robots can't yet recognise and move the pieces on a real chessboard as adeptly as a child can. Later this century, however, their more advanced successors may relate to their surroundings (and to people) as adeptly as we do using our sense organs. Moral questions will then arise.
We accept an obligation to ensure that other human beings can fulfil their "natural" potential; we even feel the same about some animal species. What, however, is our obligation towards sophisticated robots, our own creations? Should we feel guilty about exploiting them? Should we fret if they are underemployed, frustrated or bored?
Despite these concerns, I'm not a doomster, but an optimist - at least, a techno-optimist. Over the past decade, our lives have been enriched by consumer electronics and web-based services that we would willingly pay far more for and which surpass any expectations we had a decade ago.
The impact on the developing world has been startling. There are far more mobile phones than toilets in India. And they have penetrated Africa, assisting rural farmers by providing market information that helps them avoid getting ripped off by traders, as well as enabling money transfers.
There seems to be no scientific impediment to achieving a sustainable world beyond 2050, in which the developing countries have narrowed the gap with the developed and all people benefit from further advances that could have as great and benign an impact on society as information technology. But the intractable politics and sociology - the gap between what could be and what really happens - engender pessimism.
Will richer countries recognise that it is in their interests that the developing world should prosper? Can nations sustain effective but non-repressive governance in the face of threats from small groups with hi-tech expertise? And can our institutions prioritise projects that are long-term in political perspective, if a mere instant in the history of our planet?
These concerns are not new. In 1959, the great biologist Peter Medawar gave the BBC's Reith Lectures on "the future of man". He speculated on future trends in biology and genetics - and his tone was optimistic, even though he was aware of the risks they entailed. His concluding sentence is one that should be reiterated today with greater urgency.
“The bells which toll for mankind, are - most of them, anyway - like the bells on Alpine cattle; they are attached to our own necks and it must be our fault if they do not make a cheerful and harmonious sound."
Martin Rees is professor of cosmology and astrophysics, Master of Trinity College, Cambridge, and Astronomer Royal