Using the existing systems of sensing/data-exfiltration already used by life. Fireflies produce light, jellyfish glow, plants curl up in darkness, fungi bud, flowers blossom, you blush, you sweat, you get hungry, etc.
Couple those outputs to a similar biological input: sensing DNA damage, presence of particular DNA, small molecules, proteins, sugars, etc., sensing of temperature, magnetic field, particular atom/ion, etc.
Couple them: if cold -> glow; if Iron -> blossom, if low blood sugar -> emit light.
The recent "Chimeric Antigen Receptor" approved by the FDA is exactly one such designed way to act on information within a cell; if cancer-like -> kill cell.
These CRISPR tools are similar; if presence of particular DNA -> change DNA, or cut DNA, or activate response.