Initial agent and device code