a method of controllably attenuating a beam of light coupled into a port includes directing the beam of light against a mirror , and controlling an orientation of the mirror such that a predetermined fraction of the beam of light is coupled into the port . the predetermined fraction is less than a maximum fraction corresponding to optimal coupling of the beam of light into the port . the method may be implemented with a variable optical attenuator including a first port , a second port , a mirror located to direct light output by the first port to the second port , and a controller coupled to the mirror to align it such that the predetermined fraction of light is coupled into the second port . the method may also be implemented with an optical switch .