Making safety guarantees in smart environments