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.
There will neither good or evil be performed, but when the good or bad planets in a nativity or revolution shall aspect the Moon by a quadrate. - William Lilly (1602.-1681.)