""
A simulated reality may be programmed to prevent its inhabitants from
discovering its nature. The creators of a simulation would probably add
such defensive programming in order to protect their simulation from spoilage.
Assuming that discovery of the simulation is even possible, the inhabitant
that does so might be subsequently memory-wiped, punished, killed,
or removed from the simulation altogether. The other inhabitants would
therefore have no way of learning about the discovery.
The discovery might even cause the simulation to reboot itself, ending
the lives and goals of all of its inhabitants. Therefore, any investigation
into the question will imperil the continued existence of the entire cosmos.
However, the fact that we're all still alive would seem to bring this theory into question.
from
wikipedia