Embedded software has transcended the realm of safety-critical systems to that of consumer devices, which are substantially improving quality of life: PDAs, smart phones, GPS navigation, game consoles, set-top boxes, cameras, etc. The embedded software in consumer devices face three important challenges: operating reliably in spite of bugs, debugging based on automatically generated failure reports, and updating software in devices that are operated by non- expert users. Our project develops a self-healing mechanism to address these challenges. Called failure immunity, our technique enables embedded software to learn from past failures: it dynamically detects previously unseen failures, saves a signature of the faulty execution, and subsequently prevents the system from retracing the same steps. Embedded systems with failure immunity gain increased autonomy in the face of failures.