Encapsulating human stem-cell-derived beta cells in microcapsules made with an immune-cell-repelling protein restored glucose metabolism in diabetic mice and protected the cells from immune system attack, preventing the buildup of fibrotic tissue that has plagued previous trials of encapsulated beta cells.