6. Let $k$ be a real number, in the Cartesian coordinate system $x O y$ there are two point sets $A=\left\{(x, y) \mid x^{2}+y^{2}=\right.$ $2(x+y)\}$ and $B=\{(x, y) \mid k x-y+k+3 \geqslant 0\}$. If $A \cap B$ is a singleton set, then the value of $k$ is $\qquad$
The point set $A$ represents the circle $\odot C:(x-1)^{2}+(y-1)^{2}=2$, and the point set $B$ represents the region below the line $y=k(x+1)+3$. Since the line is tangent to $\odot C$, the distance from the center $C(1,1)$ to the line is
$$
d=\frac{|2 k+2|}{\sqrt{k^{2}+1}}=\sqrt{2} \Rightarrow k^{2}+4 k+1=0 \Rightarrow k=\frac{-4 \pm 2 \sqrt{3}}{2}=-2 \pm \sqrt{3} \text {. }
$$

Combining the graph, we can see that the value of $k$ is $-2-\sqrt{3}$.