Nanobots are available after beating sector 11. They are earned from being raided or defeating pirates.
If your base successfully defends itself from an attack, you get 10 nanobots. If you lose you get 3. You also get 1 nanobot per ship destroyed.
A pirate fleet that has nanobots will give you 200 nanobots if you can defeat it.
The max storage is infinite, but the temporary storage before they must be claimed is limited to 100 when you first start out. This storage can be upgraded for carbon when the nanobots are claimed, with the first upgrade costing 25000 carbon and adding 100 storage.
Nanobots can be used to upgrade defense towers without activating a cooldown. The carbon cost remains the same but the tower can be upgraded outside of the normal upgrade cooldown other base buildings must wait for. Additionally, nanobots allow upgrades while another building is under construction. The upgrade costs can be found on the Tower Upgrades page.