This is a really good question. By “really good question” I mean it should be possible, but I don’t think anyone’s ever asked.
I’ve used a method to hack together “residue is in an interface” constraints in the past. You could use such a constraint and then put a negative weight on it to favor not-burial of the residue. This method doesn’t work particularly well, and I’ve only used to encourage the formation of interfaces, when we knew 20 residues on A bound to 20 residues on B, but not which residues interacted. I don’t think this would work in a folding context. Briefly, you combinatorially list all pairs, grouped into AmbiguousConstraints by the chain A residue. This will score only the closest interacting pairs, if all residues on A have a partner on B then the score is zero. I’m going to put out feelers to see if anyone has programmed functionality like this.
There exists a “ResidueBurialFilter” which would work as a post-hoc filter if you’re using RosettaScripts.
There also exists a “BurialEnergy”, which I have no idea how it works.