I read this science-fiction story probably about a decade ago. I vaguely remember the cover featuring a pink cube.
Plot points:
There's a sort of environmental threat of weird never-fully-explained cubes and threads that are attracted to sentient beings and entangle/kill people.
The phenomenon is exacerbated by people paying attention to it and observation.
It's particularly dangerous to AI's since if they observe it too closely it somehow slips into their virtual spaces and kills them there.
Earth is ruled by a big central AI.
Humans on Earth are dosed with some kind of drug which makes them more inclined towards helping each other and being selfless. This is shown as very dystopian, for example, when an area is being evacuated in advance of being zapped to contain a thread infestation someone fleeing sees thread outside the containment zone and starts carrying it back, sobbing, because he isn't really getting much choice about doing the selfless thing.
Nano-tech is a large part of the background of the story with wastelands where self replicating robots search out any metal (but otherwise harmless) they can find, stuck in a loop where they can't find enough within some radius to complete some construction project and keep getting half way through forming some shape before collapsing and going in search of metal again.
The story ends with the main characters realizing that the threat is some kind of mechanism to discourage sentient beings clumping together too much or excessive surveillance systems or AI or something along those lines and all of earths infrastructure is deconstructed (nanotech again) and turned into ships that split up earths population to all go their own way.