Standardized agent adding code.