The cortex solves the credit assignment problem: synaptic weights adjust over time despite the lack of a clear relationship between strengths of individual synapses and the behavioural output. We propose that a combination of Hebbian, acetylcholine- and noradrenaline-dependent excitatory plasticity, together with inhibitory plasticity restoring detailed E/I balance, can effectively translate the partial error information available to each synapse into learning rules that solve the credit assignment problem. We derive conditions on these plasticity mechanisms guaranteeing robust learning of a number of input-output associations of the same order as the theoretical capacity. We use the theory to make a key prediction regarding inhibitory plasticity, which we tested and confirmed by reanalysing published data. Finally, we identified distinct functional roles for each of the plasticity mechanisms in our model.