We propose and experimentally demonstrate an optical self-interference cancellation system to realize full-duplex spectrum sensing in cognitive radios. The optical system is an analog radio-frequency front-end module, which cancels in-band self-interference, enabling a radio to simultaneously transmit and receive signals. The system achieves 83 dB of narrowband interference cancellation, and 60 dB of cancellation of a 50 MHz frequency-modulated signal. The center frequency of the optical canceler is freely tunable across the radio frequency spectrum, limited only by the bandwidth of the photodetector and the electro-optic modulators to 10 GHz. The system is modulation-format independent and requires only one piece of hardware to operate across a wide radio-frequency bandwidth. By reducing self-interference to acceptably low powers, a cognitive radio can continuously sense its radio-frequency environment to detect the presence of a licensed user or scan for spectrum white spaces even while transmitting simultaneously.