This paper presents a new optimization approach for designing minimum-cost fail-safe distributions of fluid viscous dampers for seismic retrofitting. Failure is modeled as either complete damage of the dampers or partial degradation of the dampers' properties. In general, this leads to optimization problems with large number of constraints. This may result in high computational costs if all the constraints are simultaneously considered during the optimization analysis. Thus, to reduce the computational effort, the use of a working-set optimization algorithm is proposed in this paper. The main idea is to solve a sequence of relaxed optimization subproblems with a small subset of all constraints. The algorithm terminates once a solution of a subproblem is found that satisfies all the constraints of the problem. The retrofitting cost is minimized with constraints on the interstory drifts at the peripheries of frame structures. The structures considered are subjected to a realistic ensemble of ground motions, and their response is evaluated with time-history analyses. The transient optimization problem is efficiently solved with a gradient-based sequential linear programming algorithm. The gradients of the response functions are calculated with a consistent adjoint sensitivity analysis procedure. Promising results attained for 3-D irregular frames are presented and discussed. The numerical results highlight the fact that the optimized layout and size of the dampers can change significantly even for moderate levels of damage.