We develop a statistical theory for the dynamics of non-aligning, non-interacting self-propelled particles confined in a convex box in two dimensions. We find that when the size of the box is small compared to the persistence length of a particle's trajectory (strong confinement), the steady-state density is zero in the bulk and proportional to the local curvature on the boundary. Conversely, the theory may be used to construct the box shape that yields any desired density distribution on the boundary. When the curvature variations are small, we also predict the distribution of orientations at the boundary and the exponential decay of pressure as a function of box size recently observed in 3D simulations in a spherical box.Active fluids consisting of self-propelled units are found in biology on scales ranging from the dynamically reconfigurable cell cytoskeleton [1] to swarming bacterial colonies [2,3], healing tissues [4,5], and flocking animals [6]. Experiments have begun to achieve the extraordinary capabilities and emergent properties of these biological systems in nonliving active fluids of self-propelled particles, consisting of chemically [7][8][9][10][11][12] or electrically [13] propelled colloids, or monolayers of vibrated granular particles [14][15][16].In contrast to thermal motion, active motion is correlated over experimentally accessible time and length scales. When the persistence length of active motion becomes comparable to the mean free path, uniquely active effects arise that transcend the thermodynamically allowed behaviors of equilibrium systems, including giant number fluctuations and spontaneous flow [3,14,[16][17][18][19][20][21][22][23][24][25][26][27][28][29][30]. Importantly, a sufficient active persistence length is the only requirement for macroscopic manifestations of activity, as revealed by athermal phase separation of nonaligning, repulsive self-propelled particles [31][32][33][34][35][36][37][38][39][40][41].When boundaries and obstacles are patterned on the scale of the active correlation length, they dramatically alter the dynamics of the system, and striking macroscopic properties emerge [42][43][44][45][46][47][48][49]; for example, ratchets and funnels drive spontaneous flow in active fluids [42][43][44][45][46]. This effect has been used to direct bacterial motion [50] and harness bacterial power to propel microscopic gears [51][52][53]. However, optimizing such devices for technological applications requires understanding the interaction of an active fluid with boundaries of arbitrary shape. More generally, any real-world device necessarily includes boundaries, and thus the effects of boundary size and shape are essential design parameters. Although recent studies have explored confinement in simple geometries [43,47,[54][55][56], there is no general theory for the effect of boundary shape.In this Letter, we study the dynamics of non-aligning and non-interacting self-propelled particles confined to two-dimensional convex containers, such as ellipses and polygons. We find...