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.
Make the Sun, or any of the superiors to signify princes and great persons. Scribes and rusticks, [are shown by] the inferior planets, and chiefly the Moon. - William Lilly (1602.-1681.)