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 47 including a first port 2, a second port 26, a mirror 12 located to direct light output by the first port 8a to the second port, and a controller 18 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.