We assess the impact of unexpected shocks to real interest rates and GDP growth on government budgets for nine European Union countries. Shocks are estimated as one-step-ahead forecast errors arising from a recursive bivariate VAR model. Our analysis is relevant, in particular, to deciding what safety margins are needed to limit the risk of the deficit's exceeding the 3% Maastricht threshold. The approach followed differs in two respects from standard analyses aiming at defining budgetary positions that satisfy the Stability and Growth Pact. First, whereas the latter examine only fluctuations in economic activity, we also consider fluctuations in interest rates. Second, whereas standard analyses focus on deviations from trends and define margins for the medium-term cyclically adjusted balance, we examine unexpected shocks and define margins for nominal balances. The results point to significant differences in the required margins across countries.