The authors describe a new method for constructing confidence intervals. Their idea consists in specifying the cutoff points in terms of a function of the target parameter rather than as constants. When it is suitably chosen, this so-called tail function yields shorter confidence intervals in the presence of prior information. It can also be used to improve the coverage properties of approximate confidence intervals. The authors illustrate their technique by application to interval estimation of the mean of Bernoulli and normal populations. They further suggest guidelines for choosing the optimal tail function and discuss the relationship with Bayesian inference.