Well, one approach would be to have both parties generate and publish commitments, and that they jointly publish a zero-knowledge-proof that both commitments are to the same value.
Here's one approach at doing that: both $A$ and $B$ generate and publish Pedersen commitments; for example, $A$ selects a random value $r$ and publishes $C_A = g^k h^r$, while $B$ selects a random value $s$ and publishes $C_B = g^k h^s$ (where this is done in a group where discrete logs are hard, and no one knows the discrete log of $h$ with respect to $g$).
The zero-knowledge-proof that they're committing to the same value is a proof of knowledge of a value $v$ such that $C_A C_B^{-1} = h^v$ (which, for honest commitments, is $v = r-s$); if one side commits to another value, no one will know such a value $v$, and hence no one (not even $A, B$ jointly) will be able to publish such a proof. Note that $C_A C_B^{-1}$ can be computed by anybody with access to the two commitments.
It would appear to be fairly simple for the two sides to work together to generate such a Schnorr proof:
$A$ selects a random value $a$ and sends $h^a$ to $B$; $B$ selects a random value $b$ and sends $h^b$ to $A$.
They both compute the common value $c = \text{Hash}(h^a h^b)$
$A$ computes $x = a + c r$, and publishes $x, h^a$. $B$ computes $y = b - c s$, and publishes $y, h^b$.
The pair $h^ah^b, x+y$ would be a valid Schnorr proof; the verifier would check if $h^{x+y} = (h^ah^b) (C_A C_B^{-1})^{\text{Hash}(h^ah^b)}$
Now:
I believe that access to the 'half-proofs' $x, h^a$ and $y, h^b$ does not provide any insight into either commitment.
This protocol is protected from a single malicious actor; if (say) $A$ was honest, then if the zero-knowledge proof verifies, the $B$ must have committed to the same value. Actually, even if both sides are malicious, they still cannot individually commit to different values.