Tufts University engineers have created programmable silk-based materials with embedded, pre-designed functions for biological, chemical and optical roles. This paves way for many new medical applications as in a surgical pin that changes color upon reaching mechanical limits and is about to fail.