Better safe than sorry: Risky function exploitation through safe optimization