I think it is something like a folkore result that a coherent sheaf $\mathcal F$ on a smooth algebraic variety $X$ over $k$, which is equipped with a connection

$\nabla: \mathcal F \rightarrow \mathcal F \otimes \Omega^1_{X/k}$

is already locally free.

Maybe one may weaken the assumptions, but I think the proof wouldn't alter very much.

I thought about how to prove it, but couldn't make it rigorous. In any case one should show that the stalks $\mathcal F_x$ are free, and this somehow must follow from the existence of the connection.

Addendum: It seems that the existence of a connection in some way rigidifies the underlying sheaf. A related question in this respect is: in how much is a horizontal morphism $\phi: \mathcal F \rightarrow \mathcal F$ already rigidified by $\nabla$. E.g. if one knows that $\phi$ is the identity on $\mathcal F(x) \rightarrow \mathcal F(x)$, then is it so already around $x$?