Two-dimensional materials, particularly graphene-based materials, having a plurality of apertures thereon can be formed into enclosures for various substances and introduced to an environment, particularly a biological environment (in vivo or in vitro). One or more selected substances can be released into the environment, one or more selected substances from the environment can enter the enclosure, one or more selected substances from the environment can be prevented from entering the enclosure, one or more selected substances can be retained within the enclosure, or combinations thereof. The enclosure can for example allow a sense-response paradigm to be realized. The enclosure can for example provide immunoisolation for materials, such as living cells, retained therein.