A thermodynamic perspective of immune capabilities