Agent authentication and code cleanup.