Consider the following stochastic differential equation:

$d{Y}_{t}={Z}_{t}d{W}_{t}$

and terminal condition ${Y}_{T}=b,$ for which holds: $E[|b{|}^{2}]<\mathrm{\infty}$ Furthermore b is adapted to the filtration generated by the Browian motion only at terminal time $T$.

${Z}_{t}$ is a predictable square integrable process. So the right hand side ${Z}_{t}d{W}_{t}$ is martingale.

Why is the solution ${Y}_{t}$ adapted to the underlying filtration If I rewrite the equation, I get:

${Y}_{t}={Y}_{T}-{\int}_{t}^{T}{Z}_{s}d{W}_{s}=b-{\int}_{t}^{T}{Z}_{s}d{W}_{s}$

Since $b$ is only mb w.r.t to terminal time $T$, ${Y}_{t}$ cannot be adapted.

Where did I do a mistake?

$d{Y}_{t}={Z}_{t}d{W}_{t}$

and terminal condition ${Y}_{T}=b,$ for which holds: $E[|b{|}^{2}]<\mathrm{\infty}$ Furthermore b is adapted to the filtration generated by the Browian motion only at terminal time $T$.

${Z}_{t}$ is a predictable square integrable process. So the right hand side ${Z}_{t}d{W}_{t}$ is martingale.

Why is the solution ${Y}_{t}$ adapted to the underlying filtration If I rewrite the equation, I get:

${Y}_{t}={Y}_{T}-{\int}_{t}^{T}{Z}_{s}d{W}_{s}=b-{\int}_{t}^{T}{Z}_{s}d{W}_{s}$

Since $b$ is only mb w.r.t to terminal time $T$, ${Y}_{t}$ cannot be adapted.

Where did I do a mistake?