Most smaller automatic burners (ie hotwater service, stove top etc) all use ionisation detectors. A flame is conductive, and you will see the small wire in the flames path (not the ignitor). They are cheap, reliable and easily installed. UV Optical sensors tend to be used on much bigger burners, at distance to avoid over heating.
No unattended burner system should be without a failsafe. A friend lost his garage as the PC controlling the burner gas supply valve did not close when the PC crashed.
I always recommend a basic automatic burner control unit (lookup SIT Controls Model 537) It provides failsafe gas control, pilot control, over temp, flame sense, flame failure, re-fire, and flame present output. Control it with the RPI.
..the only thing worse than a stupid question is a question not asked.