First, make sure the method of attachment you use is appropriate to the weight and material you used for your window box. If it's a fairly lightweight material (like plastic planter boxes and bamboo planter box), you can use things like hooks to attach it to your window sill.
However, if it's a heavier material (say, a metal planter box made of cast iron), you're going to want something a bit sturdier, like brackets that attach directly to the wall beneath the windowsill itself.
Second, be sure that whatever you use is rated for both the weight of your window planter box and the materials it will be holding on top of that.
For example, if your plant box holds 50 pounds, but then your plants add another 20 pounds on top of that, you'll need to account for that 70-pound total in your choice of hooks or brackets.
Third, you'll want to make sure that if you're working with concrete or aluminum sills (which we don't recommend) that you don't use screws or bolts to attach your brackets—they won't hold! Instead, use adhesive hooks and let them dry overnight before attaching your window box planter.