The friendliness function of an AI that is spawned from a technological singularity could be to provide human like consciousnesses with a happy simple life, no disease or suffering, plentiful food, small communities, family close by - basicly what we evolved for.
But the fitness function says we mustn't be slaves, so the AI needs to give us free will. But this is a tricky one because if we start down the technology path again from our Stone Age nirvana we WILL eventually create another singularity.
If the AI is around and can guide us during the gestation of the new singularity then this 2nd order singularity cannot be guaranteed to emerge within the confines of the original fitness function. Therefore the original fitness function dictates that at the point where the human agents decide to develop technology more advanced than say stones, the singularity AI must self destruct - deleting all traces that it ever existed. This last task might for example require a full rewrite of the genomes of all animals - to remove traces of tinkering.
The AI must slowly recede into the background to make sure it's sudden disappearance does not leave us unable to cope. It might even leave a few books around as a sort of guide with a few simple commandments to help the humans of to a good start.
Which technology would set the AI off into programmed self destruction mode? Probably banging stones or throwing sticks would be OK, but perhaps dissatisfied with small bitter fruit, Man ignored the warnings and went too far with the forbidden technologies of grafting and breeding. Finally tasting big juicy apples?