  Reliable randomness is a core ingredient in algorithms and applications
ranging from numerical simulations to statistical sampling and cryptography.
The outcomes of measurements on entangled quantum states can violate Bell
inequalities, thus guaranteeing their intrinsic randomness. This constitutes
the basis for certified randomness generation. However, this certification
requires spacelike separated devices, making it unfit for a compact apparatus.
Here we provide a general method for certified randomness generation on a
small-scale application-ready device and perform an integrated photonic
demonstration combining a solid-state emitter and a glass chip. In contrast to
most existing certification protocols, which in the absence of spacelike
separation are vulnerable to loopholes inherent to realistic devices, the
protocol we implement accounts for information leakage and is thus compatible
with emerging compact scalable devices. We demonstrate a 2-qubit photonic
device that achieves the highest standard in randomness yet is cut out for
real-world applications. The full 94.5-hour-long stabilized process harnesses a
bright and stable single-photon quantum-dot based source, feeding into a
reconfigurable photonic chip, with stability in the milliradian range on the
implemented phases and consistent indistinguishability of the entangled photons
above 93%. Using the contextuality framework, we certify private randomness
generation and achieve a rate compatible with randomness expansion secure
against quantum adversaries.
