You can use bags for pellets. It doesn't keep all the stuff in but a good portion of it. Just remember to keep lots of room in the bag for expansion of the pellets.
I always put my pellets in some cheeseclothe and yea leave plenty of room for expansion, also I would have to say that a majority of the hops even when well stiirred do remain in the bag.