Biomaterials, such as hydrogels, can be mechanically secured to electrodes of an implantable device, such as electrodes made of noble metals. The hydrogel can be mechanically secured via anchoring features of the electrode. Anchoring features can include apertures, voids, textures, or other patterns created in or on the electrode. The hydrogel can incorporate into the anchoring features to mechanically hold the hydrogel against the electrode. The anchoring features, by being located in or on the electrode, can further increase the surface area of the electrode that is exposed to the hydrogel, which can facilitate the conduction of electrical signals between the electrode and surrounding biological tissue. The substrate supporting the electrode can include additional anchoring features that further assist in mechanically securing the hydrogel.