Custom designed magnetic or photonic nanoparticles can generate heat or light in a highly controllable, precise and efficient manner, across a wide range of length scales. When these nanoparticles are combined with drug carrying macromolecules or catalytic materials, heat or light triggered drug release can be achieved. The nanoparticles can also be used as a contrast agent or tracer for imaging (MRI, MPI) and sensing of biological systems. This technology is used in situations where spatial, temporal and dosage control is required in drug delivery, or where simultaneous drug delivery and medical imaging or sensing is required for effective treatment of disease or injuries.