Target query: chatbot credential rotation. Use this runbook when your chatbot calls a CRM, booking tool, help desk, or internal API and the credential behind that action needs to change.
Two recent releases make this less of a back-office concern. Google added credential refresh to managed Gemini agents on July 7, and Mistral added more control over connectors in June. Both reflect the same production reality: as AI systems stay connected for longer and do more work, credentials will expire, be rotated, lose scope, and occasionally need immediate revocation.
For a website chatbot, a failed rotation is visible to a customer. A lead form submits no record. A booking request appears to succeed but never reaches the calendar. A support handoff loses the transcript. The safe response is not to postpone rotation; it is to treat it as a customer-facing release with an overlap window, a small test set, and a reversal plan.
The rotation card to complete before changing a key
Write this down before an administrator touches the integration. It is deliberately short enough to use for a routine 90-day rotation, but specific enough for an incident.
| Field | Record | Example |
|---|---|---|
| Integration and action | The exact customer-facing operation | HubSpot: create qualified lead from widget |
| Credential owner | Named team or service identity, never a person alone | Revenue operations / agentkit-prod-leads |
| Current and new scope | Permissions each credential actually has | contacts.write; no delete, export, or admin scope |
| Overlap window | How long both credentials may work | 60 minutes, then revoke old key |
| Test identities | Harmless records and destinations | [email protected], test pipeline |
| Success signal | The evidence that the action completed downstream | API 201 plus CRM record ID and webhook receipt |
| Stop condition | When to pause, roll back, or disable the action | Any production lead missing a record ID |
| Recovery owner | Who can restore the known-good path | On-call integration owner |
The important field is the success signal. A 200 response from a middleware layer is not proof that the CRM, calendar, or help desk received the request. Define the final, durable effect you expect to see.
Separate credentials by capability, not by chatbot
One all-powerful key shared by every chatbot makes rotation quick once and risky forever. It also turns a small configuration error into a broad incident.
Create separate service identities for distinct jobs: lead capture, ticket creation, appointment requests, and read-only product lookup. Give each one only the methods and records it needs. A lead-capture integration should create a contact in one designated list; it should not be able to delete contacts or download the entire customer database.
This makes incidents easier to contain. If a key used by the booking flow is exposed, revoking it should not take down the customer-support handoff too. It also makes observability useful: an unexpected request from a support-ticket identity is immediately suspicious when the identity has one documented purpose.
The chatbot connector permissions checklist is the right starting point for deciding what an action may do. Credential rotation adds the operational question: can you replace the identity without changing the customer journey?
Use a two-key overlap, then prove the new path
Avoid the tempting sequence of revoke old key, paste new key, and hope the next customer exercises it. Providers can take time to propagate permissions; secrets can be copied into the wrong environment; and an integration may cache access tokens longer than expected.
Instead, use this sequence:
- Create the new credential with the same minimum scope. Do not use a broad administrator token as a temporary shortcut.
- Store it in the approved secret store or integration setting. Label it with the rotation date and owner, but never put the secret itself in a ticket, prompt, or chat transcript.
- Run a synthetic action through the new path. Use a test email, test ticket, or test calendar slot that is safe to delete.
- Confirm the downstream artifact. Check the record ID, required fields, owner, and any follow-up webhook—not merely the chatbot's success message.
- Route a tiny, reversible production slice if the workflow supports it. For example, send one internal test lead through the same widget route or enable the new credential for one low-risk action.
- Revoke the old credential only after the new path has evidence. Record the revocation time and watch authentication and action errors through the overlap expiry.
Some OAuth connections refresh access tokens without a new setup step, while API keys typically do not. Do not assume the platform's refresh feature covers every connector. Confirm whether it refreshes a short-lived access token, stores a refresh token, rotates a client secret, or simply retries a request. The difference determines whether a key rotation will be automatic or an outage.
Worked example: rotating a lead-capture webhook
Imagine a B2B software company whose website chatbot qualifies visitors and sends a webhook to a CRM. The CRM asks the company to rotate the API key after an employee with access leaves.
The first attempt looks healthy in the widget: the visitor sees “Thanks, we’ll be in touch.” But the team checks the CRM and finds no contact. The new key had permission to authenticate and create an event, but not to create a contact in the production pipeline.
Here is the rotation evidence that would have caught it before a real visitor was affected:
{
"rotation": "crm-leads-2026-07-25",
"test_contact": "[email protected]",
"request": {
"action": "create_lead",
"required_fields": ["email", "conversation_summary", "source"]
},
"expected": {
"http_status": 201,
"crm_record_id": "required",
"pipeline": "website-qualified",
"webhook_delivery": "received"
},
"observed": {
"http_status": 202,
"crm_record_id": null,
"pipeline": null,
"webhook_delivery": "received"
},
"result": "fail: keep old credential active; correct new-key scope"
}
The lesson is not “require 201 for every API.” APIs vary. The lesson is to make the expected downstream result explicit. In this case, the missing crm_record_id stops the release even though the webhook accepted the request.
After correcting the scope, rerun the test with a fresh test contact. Reusing a partially created record can hide a duplicate-prevention or idempotency problem. Then verify that a retry does not create two CRM contacts when the first response times out.
Test the failure paths customers actually encounter
A happy-path test only proves that one request succeeded at one moment. Rotation should test the cases that create silent losses or repeated actions:
- Expired or revoked old credential: the chatbot returns a controlled fallback, logs the failed action, and does not claim that the task completed.
- Insufficient scope: the system identifies the action as unauthorized rather than silently dropping a field or downgrading the request.
- Timeout after submission: the retry uses an idempotency key or a durable request ID so it cannot create duplicate tickets, leads, or bookings.
- Refresh failure: a short-lived access token cannot refresh, and the action routes to a human or a queue before the customer is told it succeeded.
- Wrong environment: a production conversation cannot create a test record, and a staging test cannot touch a production customer.
- Revoked integration during a conversation: the chatbot clearly says it cannot complete the action and offers the next supported step.
The chatbot approval workflow guide helps with actions that need customer confirmation. Rotation adds another boundary: confirmation is not enough if the system cannot prove the requested action reached its destination.
Monitor outcomes for the first business day
The old key's removal is not the finish line. For at least one normal business cycle, watch both technical signals and customer outcomes:
| Signal | What to compare | Escalate when |
|---|---|---|
| Authentication failures | New 401, 403, token-refresh, or signature errors against the pre-rotation baseline | Any increase after the old key is revoked |
| Action completion | Created CRM records, tickets, or bookings divided by requested actions | Completion falls below the agreed baseline |
| Duplicate effects | Records with the same request ID, email, or time window | One duplicate payment-adjacent or high-priority action; repeated duplicates elsewhere |
| Customer wording | Messages that say “submitted,” “booked,” or “we’ll contact you” | The claim appears without a durable downstream ID |
| Fallback use | Escalations or manual queues caused by integration failure | The queue grows beyond the on-call team's agreed capacity |
Keep the monitoring tied to request IDs rather than raw chat text where possible. Conversation logs are valuable for diagnosis, but they can contain personal data. The durable integration record should carry the minimum identifier needed to reconcile the two systems.
When a rotation exposes a defect, preserve the evidence before changing anything. Capture the request ID, response code, scope error, credential version label, and downstream lookup result. Then decide whether to restore the prior credential, keep the action disabled, or fix forward with a newly scoped credential. The AI agent audit-trails guide explains the broader event trail worth retaining for customer-facing actions.
Retire access without leaving a recovery gap
Once the new credential is stable, revoke the old one at the provider—not just in your secret manager—and remove it from every environment where it was used. Confirm that scheduled jobs, staging environments, and forgotten test scripts are not still relying on it.
Record four things: the old credential's identifier (never its value), its revocation time, the new credential version, and the evidence from the test and monitoring window. Set the next rotation reminder with the actual expiry date, not a vague quarterly calendar note.
Do not keep an old production key alive indefinitely “just in case.” That turns rollback into a permanent exposure. A proper recovery path uses a new, controlled replacement credential with the same least-privilege scope, plus an action disable switch for the cases where an integration cannot be trusted.
Credential rotation is a reliability practice as much as a security practice. Customers should not discover a stale secret through a missing lead, a duplicate appointment, or a false promise in chat. In Agentkit, conversation logs can help reconcile failures, while custom API calls, lead capture, forms, webhooks, and integrations should each have their own scoped test and evidence trail.
No credit card required.



