LPS-30341 Change AgentSerializable to use protected field for easier testing