One way I'd approach doing a box bag (I assume that means a square bottom so it sits flat on the floor) is to first knit a rectangle that is a little bit (like 1/4") larger than you want. Bind off.
Then take either a circular needle or a set of double-points and pick up stitches all around the four edges of the rectangle. Knit away in a circle until your bag's the right length.
Maybe you could put a slip-stitch every other row at the 4 corners so your bag holds (as much as flexible knitting can hold) the square/rectangle form.