Hyperparameter model with endogeneity

I’m stuck on how to specify a model—or if I can—and thought some of you might have ideas.

Imagine you have a continuous response variable Y that is influenced by two continuous properties A and B. What I want to quantify is the effect of A on Y independent of B. Simple enough. Where this gets tricky is with the data.

The data come from an experiment where there’s a categorical treatment X. What we observe is the response of Y to X and the response of A to X (but B is not measured). If I were to just regress Y against A I would have an endogeneity issue since the variation of each is due to the same manipulation. Is there any way around this (without some kind of instrument)? Could I regress Y against the treatment X and then use a hyperparameter where the effect of X on Y is somehow a function of A?

From your description of the problem, I gather that we have a causal influence of X on Y (X → Y), which might be partly or entirely mediated via a X → A → Y pathway. But what isn’t pinned down is the role of B, which is unmeasured. If you want to control for unmeasured B, then you need a generative model for B. B also doesn’t seem to figure in the meat of your question here, which makes me wonder if I’m misunderstanding what your conceptual set-up is:

B is definitely of interest, but it isn’t something that is measured well. I could probably come up with a somewhat informed prior of the relationship between B and Y from lab studies. If I could, would a model like this make sense:

Y ~ a + bX
b ~ c + dA + eB