Confinement framework for encapsulating objects