This paper presents a treatment of the topology optimization problem for two-dimensional fields governed by Laplace's equation. The study considers various boundary conditions, including Dirichlet, Neumann, Robin, and nonlinear radiation boundary conditions. Additionally, the topological derivative for a general objective functional comprising solely of boundary quantities is derived, with a special focus on the case of a radiation boundary condition in a black body. The accuracy of the derived adjoint problem and topological derivative is validated through several boundary element method calculations.