If $a$ and $b$ are integers such that $x^2 - x - 1$ is a factor of $ax^3 + bx^2 + 1,$ find $b.$
If $x^2 - x - 1$ is a factor of $ax^3 + bx^2 + 1,$ then the other factor must be linear, where the coefficient of $x$ is $a,$ and the constant coefficient is $-1.$  Thus
\[(x^2 - x - 1)(ax - 1) = ax^3 + bx^2 + 1.\]Expanding, we get
\[ax^3 - (a + 1) x^2 + (1 - a) x + 1 = ax^3 + bx^2 + 1.\]Matching coefficients, we get
\begin{align*}
-(a + 1) &= b, \\
1 - a &= 0.
\end{align*}Hence, $a = 1.$  Then $b = -(a + 1) = \boxed{-2}.$