Basic agent registration.
Handle version 2 of the agent API.