> ## Documentation Index
> Fetch the complete documentation index at: https://docs.defindex.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Rescue

Emergency withdrawal of a vault's funds out of a strategy and back into the vault, where only users can withdraw them.

Rescue is for when an underlying protocol becomes risky. It unwinds the position, returns the capital to the vault as [idle funds](/getting-started/index#idle-funds), and pauses the strategy so nothing is invested back into it. User withdrawals stay open throughout: no role can freeze them.

Only the Vault Manager or the Emergency Manager can call it. See [Vault Roles](/getting-started/vault-roles).

## Running it

<Card title="Rescue from the Console" icon="shield" href="https://console.defindex.io" horizontal>
  The fastest path in an emergency: open your vault at console.defindex.io and trigger the rescue from the Admin tab, signing with the connected Manager or Emergency Manager wallet.
</Card>

Ready-made scripts are in [paltalabs/defindex-rescue](https://github.com/paltalabs/defindex-rescue), which also covers rebalancing idle funds:

```bash theme={null}
pnpm rescue
```

The scripts can either sign and submit with a secret key, or build and simulate the transaction and write the unsigned XDR to a file, for a hardware wallet or a multisig to sign. Set `VAULT_ADDRESS` and one of `SIGNER_SECRET` or `SIGNER_PUBLIC_KEY`.

To call the contract method yourself, see [Vault Administration](/advanced-documentation/direct-contract-calls/vault-administration).
