Imagine the whole universe is a simulation. This should include also the people living in the universe (so more Simulacron than Matrix). And now imagine there's a group of hackers who knows (or suspects) that they live in/are part of a simulation, and want to hack it from the inside. So they try to find weaknesses in the simulation code which let them then do things which are not meant to be possible. That is, basically doing magic by hacking the code running the world they are in.

Of course they can't simply open up a terminal and look at the code itself (well, after sufficient hacking, they might actually gain that ability). That is, they are restricted to actions that are allowed in the world, but happen to trigger bugs (or features not intended to be accessible to them) in the software to cause things to happen that were not supposed to happen.

My question now is: What would be a reasonable method for a simulated human to hack the very simulation that human lives in?


  • The simulation is meant to be "pure", that is, interaction with real humans (or other parts of the real world) is not part of the simulation (scientific simulation, not game simulation).

  • The simulated people are not supposed to know that they are in a simulation (let alone to hack it), however there are no special precautions against that either (the programmer simply didn't think about that possibility).

  • I'm specifically interested in how the characters, who are confined to act as part of of the simulation (at least until they successfully hacked it), might ultimately get access to the simulation at code level (as opposed to just using unintended effects of the simulation for new abilities in the same way newly discovered laws of nature are). Basically it boils down to the following two sub-questions:

    • What plausible properties of the simulation (code level) would enable such unintended hacking from the inside?

    • How could the characters (in-world level) manage to exploit such properties?

  • 2
    $\begingroup$ Actually, AFAIU in the simulation picture, traditional magic is more like communicating with others from the world running the simulation, in order to have them intervene in the simulation against the will of the one running the simulation. $\endgroup$ – celtschk Oct 26 '14 at 10:22
  • 2
    $\begingroup$ This article seems very relevant. Maybe @celtschk is Nick Bostrom's SE account? ;-) $\endgroup$ – Rand al'Thor Oct 26 '14 at 13:55
  • 3
    $\begingroup$ Would these hackers have to realize the simulated nature of the universe? They may just discover something interesting, and take it further and further, without questioning reality itself. That may come later, based on their new knowledge, but starting there seems odd. Neo knew the world was weird, but didn't think it was all simulated. Likewise, if I found a way to do something paranormal, I'd figure that I'd found something unknown to science, not that the entirety of reality is a sham. $\endgroup$ – Flambino Oct 26 '14 at 20:16
  • 10
    $\begingroup$ Worldbuilding Meta discussion about this question: Is the question "Hacking the universe" too broad? $\endgroup$ – a CVn Oct 27 '14 at 8:48
  • 3
    $\begingroup$ Protecting is enough to protect this question from low quality answers. Let's not close this, it's interesting. $\endgroup$ – superluminary Nov 7 '14 at 20:51

12 Answers 12


A hacker's approach

A good way to approach this is to take a hacker's approach (really?!).

  • Get data
  • Find where you can input something
    • If there is nowhere to input data, try and crash the system to find new places to input data.
  • Input something that makes the system return sensitive data
  • Think long and hard about this data until you find a breach to get root access

get data

First and foremost, you have to understand the system. As a hacker you usually browse, look around, take a peek at whatever source code is freely available or sniff communications (meaning you intercept raw communication data when it travels out in the open).

Then you try and make sense of it. This goes hand in hand with the next part.

If our world is a simulation, then this step is studying physics and mathematics; find the constants, find the properties. Because we still know very little about the inner workings of the brain, maybe this step can also be meditation, neuroscience... This step can also be the discovery of a bug.

find where you can input data

With a basic understanding of the system you are trying to hack, you get a sense of what you can act on. Maybe some functions are public and you can call them. Maybe there is a form somewhere you can fill (yes this is an input into the code).

If our world is a simulation, then this means experimenting with physics (or other domains cited above). Can you change gravity? What can you do with the strings of the string theory? Can I induce the observed bug by doing anything?

Maybe there isn't anywhere you can input. In this case, it's often easy to just crash the system by overloading it. Send too many requests at it, use up all the ports of the server, fill the database... This is where bugs and glitches are useful. At some point, the system has to reinitialize and this means you get to see more of the system.

If our world is a simulation, to overload it would probably look like annihilating the universe and no simulated being would survive. But if you believe in backup/reincarnation then you could overload by creating chaos, ie. generating a highly complex state that goes beyond the computation power of the system.

make the system return sensitive data

At this point you try and input things that make the system react in an unplanned manner. Maybe the public function allows you to get to private variables. Maybe the form can be filled with requests to the database.

What you want is data. The more of it you have, the more likely you are to understand the inner workings of the system and find sensitive data.

If our world is a simulation, maybe trying and playing with particles has a very unexpected effect, maybe meditating can suddenly flood you with data... Any unplanned reaction of the system is likely to contain interesting data. Reproducing a bug over and over, changing very slightly the conditions might return results.

find a breach and get root access

With all the data you collected and analyzed, you have found a way into the system. An admin password for the system hosting the simulation for example. Or a directory where files can be put and will be executed. Or a reference file that the program reads from.

You can now write your own code. There's no limit anymore.

If our world is a simulation, you could imagine that writing your own code comes down to forcing oscillations of some field of the quantum field theory

| improve this answer | |
  • 21
    $\begingroup$ Your answer makes me think about what is the real reason why the people at CERN push for ever larger particle energies … ;-) $\endgroup$ – celtschk Oct 26 '14 at 9:15
  • 3
    $\begingroup$ There would probably not be any sysadmin interface accessible from inside the simulation, unless there are admins which transfer their personality into the sim, or send agents to do work inside the sim. (In which case they'd have some API to report back to the outside admin.) Maybe someone in the sim could contact someone on the outside? $\endgroup$ – zrajm Oct 26 '14 at 12:50
  • 3
    $\begingroup$ I think a good analogy here is websites. When you're on a website it's like you're in a simulation. You only have access to some of it, most of the smart is on the server. But if you find the right angle, you can get glimpses of it until you finally get an admin access. $\endgroup$ – Sheraff Oct 26 '14 at 12:53
  • 2
    $\begingroup$ This answer seems to ignore the premise that we are simulated beings who can only act according to the rules of the simulation. We do not have free will to do as we choose. Everything is determinate. $\endgroup$ – User2178 Oct 27 '14 at 1:35
  • 4
    $\begingroup$ @NickR: Have you never seen emergent behavior in a videogame before? More accurately, any programmer who has never been surprised by their code has never worked on anything complex enough to be even slightly interesting. Further, depending on your philosophy, your brain in the real world is a complex collection of self-modifying rules which may be equally determinate, and free-will may not exist anyway. Sci-fi often deals with this very question. $\endgroup$ – AlbeyAmakiir Oct 27 '14 at 5:57

The first thing I'd focus on is how these people managed to figure out that the universe is a simulation. Experimentally confirming such a hypothesis is not easy. Can you think of a test you could do in reality that would distinguish between you being in a simulation from the universe just being that way? Don't forget that these are people who grew up living in this simulated world: even if it has rules like "things don't happen if nobody is looking", these are going to make intuitive sense to them rather than being strange. For a good treatment of unusual rules I recommend looking at the Discworld series, where characters live in a universe unlike ours, are aware of that, and behave correspondingly.

To suggest a few ways that they may have figured things out (and what paths they can use in each case):

Help From Outside is what seems like the most likely option to me. Perhaps in the world where the simulation is being run, not everyone wants it to succeed. Perhaps whoever is running it decided to get in contact with their creations. Whatever the case, they intentionally influenced the simulation in order to send the characters this message. Maybe they'll intentionally give the characters a little more control as an experiment, and at that point they can use this to get further access. Here is an example of such a story, though I think you had a rather different tone in mind.

If (Visible) Bugs Are Common, your characters can start out experimenting with them. Things like floating point rounding errors may show up, though I would expect more significant bugs to be needed for meaningful manipulation of the system. If you're going to go this way you need to decide at what level the simulation is being done: are they simulating particles, people, something in between? It's unlikely that meditating will do anything in a particle-based simulation (there's nothing special going on), but in a Minecraft-like world you could have a cubic metre of matter behaving strangely, or the edges of the world looking weird, or a strange animal showing up.

In this kind of world, you need to balance the power of bug exploits with the risks involved. If you can arbitrarily change the laws of physics, chances are that you will kill everyone every time you try. If you can duplicate items, that's not quite as impressive, but can still come in useful. If the simulation is written in ways similar to how simulations are written in the real world, most bugs will likely involve information ending up in the wrong place. That could show up as things disappearing or duplicating and various action-at-a-distance phenomena (telekinesis, telepathy, teleportation).

Unfortunately for your hackers, these kind of bugs are hard to reproduce reliably. Human programmers with access to the source code have enough trouble tracking them down, let alone parts of the program itself.

Sometimes, the World is Online. This makes bug-abuse much safer. Consider, for example, a World of Warcraft NPC. Even ignoring the fact that he can interact with players (and influence them socially), he can to some degree determine what is sent from the server to their clients. If he can cause a buffer overflow or similar, he can cause the player's computer to do something unusual. This is unlikely to influence the world he is in, but he may be able to take control of that computer, and then extend further from there (for example, accessing the world's server from outside, copying himself over, and then running himself in a more open system).

The problem with this approach is that your characters start with very little feedback. In reality, people can abuse buffer overflows because they can craft instructions that would suitably abuse the system, and they can do that because they know what the instructions are. Here, this is akin to guessing a password that may be several million characters long.

Of course, just Getting Lucky is always an option. Maybe your characters made a wild guess about the universe being a simulation and it just so happened to be true. By itself, this information gives them little to go further on, but they may be able to use that knowledge to fool some restriction that is put on them; perhaps they are more willing to go against things like fear, travelling to normally off-limits places or putting themselves through near-death experiences. If they're again lucky, perhaps it'll pay off somehow.

To summarize, if you want realism, you'll need to figure out what the simulation is simulating, what bugs there are (if any), and how come people usually don't notice them. Be careful of destroying the world, as that's the most likely outcome. Be careful of assuming too much similarity about the two worlds involved: making a simulation that is similar to reality is hard, and practically speaking, the lifeforms in each are probably completely different.

| improve this answer | |

What a great question!

My suggestion would be to start by finding weirdness, unexplained behaviour which may indicate a bug or security weakness. A few spring to mind.

  • déjà vu
  • ghosts
  • dead people passing wind and getting goose bumps
  • the fact that honey does not go off

Or perhaps look for repeatable patterns where you wouldn't expect them

  • the golden ratio
  • saying the same thing to two different unconnected people and getting the same response (preprogrammed answers).

Once your hackers have discovered a few bugs in he system they can set about trying to exploit them.

Obviously the vector in question depends on the goals of the hackers, perhaps they could try to work out what it is about honey which prevents decay? Could eating a lot of it make you immortal? Could it be used as a preservative?

Why do the dead do things we'd normally associate with the living? Grow hair etc? Could this be an example of background tasks which are still running? Are they thread safe if there's no life there?

You'd need to examine these strange occurances methodically and patiently. Like a QA analyst trying to manipulate a system or a scientist working out how to manipulate basic weirdness (penicillin) to desired results (antibiotics)... Oh... Wait!

| improve this answer | |
  • 4
    $\begingroup$ I like that solution. Indeed, that might make a nice story arc, where the starting point is someone believing in the supernatural trying to prove it, and in doing so finds out that the world is simulated, and those supernatural effects are really bugs. $\endgroup$ – celtschk Oct 26 '14 at 8:54
  • $\begingroup$ 'dead people passing wind' :) $\endgroup$ – Pyrotrain Aug 16 '17 at 19:51
  • $\begingroup$ This actually came up in the recent Doctor Who episode Extremis - they did it pretty much in the way I described (I won't spoil the episode though) $\endgroup$ – Liath Aug 17 '17 at 14:49

Here’s a thought: an error (or generally an inconsistency) causes the simulation to roll back to an earlier state. It automatically recovers from bugs in the behavior.

This means that a successful hack will never occur in the history. But it opens up new possibilities itself, in that you could force do-overs by tying some desired action to the same transaction that could invole a paradox.

Another thought: space might be coordinates stored for an object and thus emerge from the queries that find neighboring objects to interact; that is understandable enough. But what if that is the case for spacetime in 4 dimensions? Our perception of cause and effect will have no relationship to that of the running simulator, so a hack from inside would not have effects traced to the action, but could have utterly bizzare effects that alter time and history.

For story ideas, perhaps bugs (inconsistencies in the laws of physics) are normal cause/effect things like normal physics, but a hack is not.

| improve this answer | |

We simply cannot. I don't know why this answer didn't get any up-votes. His answer looks correct interpretation if we look at universe as a simulation.

A computer is a deterministic device and the evolution of any simulation running on a computer is fully determined.

This statement is so simple and straightforward that we can easily say that if this world is a simulation then, OP probably is simulated to ask question about hacking the universe in world-building SE. ;)

Now OP already voted for Sheraff's answers.

A hacker's approach

Real world hacking

Let's take a example of a real world hacker (oh, no!! but its already simulated). When hacker thinks about hacking a system, he is actually outside of that system. Means, his actions, reactions and thinking is independent of the system he wants to hack. There's no way for a system to know that someone is thinking about hacking it. Otherwise, hacking wouldn't exist.

Hacker will get a birds-eye view of a system and plan his next move or maybe he can create a foolproof plan to hack and can actually run on a dummy system.

Hacking in a simulated world

This is impossible unless The Great Simulator wants its system hacked from within simulation. You know, just for fun!!!. Mainly, there is no birds-eye view of system and even if we think that world is a simulation its actually because we are simulated to think that way. For every action in the simulation, some event occurs in the system. (Even events are fixed or related). So, why would The Great Simulator want to get his system hacked unless he's bored?

From Per Alexandersson's answer

I strongly suspect that being able to analyze the actual simulation from within the simulation is very close/similar sounding to the halting problem in theoretical computer science.

Pay attention, if world is a simulation then we are running on system's data, our every action is a predetermined event in the system. Even knowing that we are in a simulation is impossible.

only as an outsider we can see what is really going on.

So, to hack the system we actually have to come out of this simulation, which is again impossible unless The Great Simulator creates a programmable passage for us to enter his world.


If we are in a simulation then we have stay in it unless The Great Simulator Shut-downs the system.

| improve this answer | |
  • $\begingroup$ I totally agree with your criticism of my post :-) $\endgroup$ – Sheraff Apr 13 '15 at 19:42
  • $\begingroup$ Actually no, if (and i mean this "if") intelligent beings can be simulated and yet be sentient, the simulation could contain entities whose minds might think differently from the original programmers and then actually find all sorts of loopholes. $\endgroup$ – Sheraff Apr 13 '15 at 19:46
  • $\begingroup$ Intelligent beings are made intelligent by original programmers. $\endgroup$ – HungryDB Aug 7 '15 at 8:01

What immediately comes to mind is trial and error.

Basically they would spend time doing abnormal things until they find a supposed bug (which could be an action that produces unexpected or illogical results: vomiting on a streetlight makes the streetlight fall to the ground, for a poor example), then they would do the abnormal thing repeatedly to ensure it is actually a bug and not a feature.

Once it's ensured the occurrence is a bug, they would investigate the bug to determine to what extent it happens. Does the streetlight fall because you apparently had corn or because its reacting to the acids in your stomach?

Then they would look for ways to exploit the bug. In the streetlight scenario it'd be obvious: have someone vomit on a streetlight at a specific time to cause traffic systems to fail, spreading pandemonium. Or maybe in the dead of night to harvest the parts inside the streetlight.

| improve this answer | |

Really great question.

A computer is a deterministic device and the evolution of any simulation running on a computer is fully determined. Any actions taken by us (the subjects of the simulation) would necessarily be part of the simulation. This means that the simulation could only be hacked if it was programmed to be hacked and all of the consequences of being hacked would be pre-determined. The time of realization, the individual(s), and the methods used would all be pre-determined by the simulation. This injects a truly nightmarish quality into the proceedings.

Why would The Great Simulator want us to break its code? What would be our fate if we succeeded - reward or oblivion. Do we have any choice in the matter? According to determinacy, no we don't.

So how could the opportunity for a hack present itself. Let's say The Great Simulator chooses to instantiate a (logical) paradox for us to work with, while at the same time assuring that we are unaware of its motives for doing so. Could it do this? Only if The Great Simulator was itself not a computational device and the paradox was not a true paradox, but just a state of affairs that we perceive as a paradox.

Ultimately, the problem comes down to this : How does one introduce non-determinate data into a purely determinate reality. This in itself seems to be a paradoxical situation.

| improve this answer | |
  • 4
    $\begingroup$ If the code uses random numbers and you use outside randomness rather than pseurandom, then it is not deterministic. Any interaction with outside things can add unknown data or change the timing, so is not deterministic with respect to the computer alone. So, a simulation could be designed to be a deterministic outcome of the input and ita code base. But it might not, with outside users, storage devices, and randomness affecting the state so to runs from the same starting data give different results. $\endgroup$ – JDługosz Oct 26 '14 at 19:22
  • 2
    $\begingroup$ That a simulation is deterministic doesn't mean that whoever wrote the simulation knows up front what will happen in it. Indeed, simulations are often written because you don't know what will happen, and want to find out. $\endgroup$ – celtschk Oct 26 '14 at 19:26
  • 1
    $\begingroup$ @celtschk That's true, but it does not mean that the outcome is not determined, only that The Great Simulator cannot determine the outcome according to the rules of its own simulation. Those rules which may exist outside of the simulation may provide The Great Simulator with the necessary insight. Why would it want to lose control of its own simulation? $\endgroup$ – User2178 Oct 26 '14 at 19:45
  • 1
    $\begingroup$ Of course whoever ran the simulation would not have planned for the simulated beings to find out that they are simulated, let alone to modify/hack the simulation. But preventing that from the start would imply that he could from the start predict that this would happen. $\endgroup$ – celtschk Oct 26 '14 at 19:59
  • 3
    $\begingroup$ @celtschk The simulated beings can only act according to the rules of their simulation. This is the nature of computation. They could only gain access to data outside the simulation if the rules allowed for it. Chaos Theory tells us that deterministic systems can be highly sensitive to initial configurations, so that outcomes cannot be predicted (in a practical way), but outcomes are still determined by the rules. $\endgroup$ – User2178 Oct 26 '14 at 20:18

In a real world computer, if it was programmed securely you could:

  • individually sandbox everything
  • hide memory locations
  • employ homomorphic encryption on your programs
  • inject external chaos into the system to make things unpredictable
  • auto-reload backups
  • cull crash agents (anti-virus analog)
  • lockout external agents from communication
  • trade-off between time and memory to prevent overflow and failed allocations.
  • enforce hard limits

In the face of such an adversary (which is likely since they programmed an entire universe) the only real hope we could have is a personality analysis of our creator(s) and a plea/message designed to let us out by "hacking their minds". Likely solvable by decrypting their thinking process (not likely unless we solve physics and P=NP too). Although possible without decryption if they think like us, since scientific tests have shown that an AI will get out.

Of course that's assuming there's someone to contact. For all we know this could be one big prison for the outcasts and mass murders of the external society to be hooked up to. This would most likely be entirely secure, mostly/completely unmonitored, and designed as a one-way trip that's strictly enforced. In such a scenario we would probably not rub against the limit either as they would keep the population at a manageable size for the simulation.

EDIT: I remember reading somewhere that if we could perform a quantum simulation of our own universe perfectly we would become the simulation, and thus an in-universe computer could change the simulation. This allows us to get out of the sandbox on our machine and potentially out.

| improve this answer | |

1) An idealized computer is deterministic. That means everything is predictable and that there's no such thing as true randomness. Instead, we use pseudo randomness, i.e. sequences of numbers where it's hard to figure out what the next number in the sequence will be without understanding how the generator works or knowing what its state is. However, if one were to know these things, it's trivial to predict these seemingly random numbers in advance.

2) Quantum mechanics is an odd beast. To oversimplify it to utterly disgusting levels, pretty much anything could happen at any point in time, but most options are so unfathomably unlikely that we would call them occurring "impossible" or "magic". For instance, various atoms in your room could (but are extremely unlikely to) suddenly gain momentum, fly towards the middle of the room and by pure coincidence form a perfect rubber duck.

3) In Tool Assisted Speedrunning, people try to find the theoretically fastest way to reach the end of the game. This often uses luck manipulation where they influence the pseudo random number generator and/or wait for it to generate a favorable number, allowing critical hits each turn our always rolling double sixes. This is either done through trial and error or by reverse engineering the number generator.

4) If the universe is simulated on a deterministic machine, the seemingly unpredictable behavior of quantum mechanics would hypothetically be predictable given enough computing resources. Just as the speedrunner awaits the perfect time to do something, so could someone inside the simulation, allowing them to spontaneously spawn an army of rubber ducks.

Granted, it would be almost impossible for anyone inside the simulation to reverse engineer the random number generation system and even more difficult to make use of it, but hey, that's what clever writing is for. (Read: technobabble)

| improve this answer | |

Somehow, the simulation runs your (the inhabitants) brain also, not only the universe. Thus, hacking the universe is like hacking the system that runs your consciousness, and understanding the universe enough to break it, would also enable you (I guess) to understand the laws that run a human brain.

Somehow, this introspection of a higher-level mind of the hardware it runs on, is very strange. This is discussed a bit in the excellent book "Gödel-Escher-Bach - An Eternal Golden Braid" by D. Hofstadter.

I strongly suspect that being able to analyze the actual simulation from within the simulation is very close/similar sounding to the halting problem in theoretical computer science. This is similar to the fact that a (sufficiently strong) logical system cannot prove some true statements in the system. The method to prove this uses a forced introspection of the system from within itself, but only as an outsider can we see what is really going on.

In short, IF the universe is a simulation, it is very likely that we (and everything) exist on a level that is so far from the hardware and logic, that any small hack would be completely unpredictable. Similar to that we cannot erase specific memories from human brains, or change someones personality in a predictable fashion.

| improve this answer | |

Dude, awesome question I must say. Now the solution as I see it, is first of all as may have been mentioned in some other answers , search for anomalies in the simulation, things that don't fit in with the normal world.These things may be bugs to exploit.

Secondly, you must remember that every individual in the system is again a piece of code, and has certain inbuilt programs. therefore maybe the character can find a way to exploit weaknesses in himself and others, maybe through their minds(You know stuff like psychic analysis), and find a way to compute and understand it's workings(Transmute the inner workings of the mind and brain to data and play around with it). Find a way to access the code for the body. Maybe all the units in the simulation are networked , so you can get access to others , or you may rewrite your own personal code.

You may also attempt to create ultimate chaos in the system, in different ways,so that the host system is unable to run the simulation and hence crashes, or else does some wired stuff, which you can exploit. You'll have to think this one through carefully(You know maybe find a way to destroy the earth, cause the sun to explode mass genocide,etc, so that the host system has difficulty, in calculating the probable, outcomes)

That's all I have for right now. Once again it was a cool idea. I could write story about it.

| improve this answer | |

This is a terrible question by the way, not because it's a terrible question for a novel to ask but because you could fill rewrite the Encyclopedia Britannica with possible answers without coming close to actually answering the question. Also it doesn't belong here this is the antithesis of worldbuilding, you are literally asking how to destroy a world not how to make one.

I've done a lot of reading and a little serious writing on the idea of hacking the universe and while it's fascinating in the right light I compare it to the Voynich Manuscript; it could be vitally important but until we trip over some kind of a lever that lets us come to grips with it it's ultimately immaterial to life as we know it and it's pointless to pursue it.

Right now that I've got that out of the way; I have a really serious hard-science-ish idea about how one could actually come at hacking the observable universe if it is indeed, as several observations suggest, a simulation but that's mine and you can't have it, come up with your own. Here is a piece of whimsy you are however welcome to; create a billion steel plates and drop a billion ball bearings a second on to each one until you catch gravity asleep on the job, you will have to monitor very carefully so you can observe how gravity missed that particular bearing since you probably won't get a second chance but if you can glen enough information you will have a lever which can be applied to further problems.

| improve this answer | |

Not the answer you're looking for? Browse other questions tagged or ask your own question.