A prison in a dream usually reflects a sense of restriction that feels self-imposed as much as external -- a job, a relationship, or a pattern of thinking you can't seem to step outside of. Guilt can also show up disguised as confinement, so it's worth asking what exactly you feel you're being punished for.
The Fixed Stars do imitate the nature and action of the Erraticals or Planets, whereof they transfer their actions unto them. - William Lilly (1602.-1681.)