8. For the ellipse $\frac{x^{2}}{a^{2}}+\frac{y^{2}}{b^{2}}=1(a>b>0)$, the right vertex is $A$, the upper vertex is $B$, the left focus is $F$, and $\angle A B F=$ $90^{\circ}$. Then the eccentricity of the ellipse is . $\qquad$
8. $\frac{\sqrt{5}-1}{2}$.

From $B F^{2}+A B^{2}=A F^{2}$, we have
$$
\begin{array}{l}
c^{2}+b^{2}+b^{2}+a^{2}=(a+c)^{2} . \\
\text { Then }\left(\frac{c}{a}\right)^{2}+\frac{c}{a}-1=0 .
\end{array}
$$

Solving, we get $\frac{c}{a}=\frac{\sqrt{5}-1}{2}$.