# Replace a Model Provider Key (https://www.shipfox.io/docs/how-to/set-up-work/rotate-model-provider-credentials)

Description: Save a new provider key. Verify a run before revoking the old key.

Replace a provider key while the old one still works. Shipfox tests the new key
before saving it.

## Before you begin [#before-you-begin]

You need access to agent settings and a new provider key.

Keep the old key active until the test run succeeds.

## Find affected agent steps [#find-affected-agent-steps]

Search workflow files in the project for the provider ID. Also check the workspace
default provider. A step that omits `provider` may resolve to that default.

Choose one workflow that uses the provider and a model your team needs.

## Replace the credential [#replace-the-credential]

1. Open **Settings → Agents**.
2. Open the configured provider's menu and select **Edit credentials**.
3. Enter the new key and any other required values.
4. Select **Test & save**.

If the live test fails, Shipfox keeps the current setup. Fix the new key before
trying again.

## Verify and retire the old credential [#verify-and-retire-the-old-credential]

Re-run the representative workflow. Confirm that its agent step resolves the
same provider and model, returns a response, and finishes successfully.

After the run succeeds, revoke the old key at the provider. Run the workflow
again if revocation takes time.

Use [Fix agent failures](https://www.shipfox.io/docs/how-to/run-and-troubleshoot/agent-provider-failures)
if the verification run reports a credential or provider error.