Sort:  

A very good question.

It depends on the type of nanobot. But future advances are seeking to make them degradable; which, after they've completed their specified function, would be dissolved. Most of these are still in experimental stage though.