We discuss Bayesian inference for subgroups in clinical trials. We start with a decision theoretic approach, based on a straightforward extension of a 0/c utility function and a probability model across all possible subgroup models. We show that the resulting rule is essentially determined by the odds of subgroup models relative to the overall null hypothesis M0 of no treatment effects and relative to the overall alternative M1 of a common treatment effect in the entire patient population. This greatly simplifies posterior inference. We then generalize the approach to allow for subgroups that are characterized by arbitrary interactions of covariates. The two key elements of the generalization are a flexible nonparametric Bayesian response function and a separate description of the subgroup report that is not linked to the parametrization of the response model. We discuss an application to an adaptive enrichment design for targeted therapy.