Integrating Learning into Safety