Skip to content

Rotate Credentials Without Stopping the Pipeline

A safe rotation follows add, test, switch, observe, revoke. Keep the old credential valid until every process that needs the replacement has proved it can work. “Without stopping the pipeline” means preserving queued work and maintaining capacity where the deployment supports a rolling change; some singleton and database rotations still require a brief controlled interruption.

CredentialTypical consumersReload behavior
Cloud GitHub AppsColony Cloud control plane and Workers through short-lived installation tokensManaged by Cloud; reconnect only when installation access changes.
Cloud LLM/API secretsManaged and BYO Worker tasksUpdate in Settings → Secrets; verify a new task before removing the old provider key.
Cloud Worker tokenBYO Worker registration and heartbeatDeploy replacement Workers with a new token, drain old Workers, then revoke.
Self-host GitHub/ADO provider identityMayor, Workers, monitor, webhook receiver as applicableStartup-only; restart consumers.
Self-host LLM credentialWorkers and any singleton that invokes the configured engineEnvironment change requires process restart.
Postgres credentialMayor, Workers, monitor, MCP, and operational CLICoordinate database and all clients; normally requires reconnect/restart.
Monitor login credentialMonitor dashboard/APIRestart monitor; active sessions may be invalidated.
Package-feed credential or custom CAWorker entrypoint and package managersRe-rendered at Worker startup; replace Workers one at a time.

Configuration hot reload does not reread arbitrary environment variables. Provider, database, tenant, repository identity, webhook, and command settings are explicitly redeploy-only.

  1. Create the replacement credential at the upstream provider without revoking the current one.
  2. Open Settings → Secrets and update the corresponding secret.
  3. Start a small task that exercises the credential and inspect its Worker result.
  4. Observe normal tasks through at least one complete analyze/develop/review path when the secret affects the LLM engine.
  5. Revoke the old upstream credential only after new tasks consistently use the replacement.

Changing a package-feed credential for a repository updates what Workers receive on a later registration/config refresh. Validate with a clean dependency install, not a Worker that already has packages cached.

  1. Generate a new token under Settings → Workers for the same logical group.
  2. Deploy at least one replacement Worker with the new token and confirm a fresh heartbeat.
  3. Let the replacement complete a real task for each required repository or role.
  4. Request Drain on Workers using the old token and wait for their claims to finish.
  5. Stop the drained containers.
  6. Revoke the old token and confirm no active Worker still depends on it.

Revoking first immediately blocks registration and heartbeat. Do that only for an active compromise, then inspect and reclaim any abandoned tasks.

Rotate self-host provider or LLM credentials

Section titled “Rotate self-host provider or LLM credentials”
  1. Create a new PAT/key with the same least-privilege access and leave the old one active.
  2. Update the secret value behind the existing environment-variable name. Do not rename the variable and change config in the same rotation unless necessary.
  3. Run colony check --stage credentials and colony check --stage repository from an environment using the replacement.
  4. Replace Workers one at a time when at least two serve the repository; wait for each replacement heartbeat and task before continuing.
  5. Restart the Mayor and other singleton consumers during a controlled window. The durable queue remains in Postgres, but intake may pause briefly.
  6. Revoke the old credential after the replacement completes a full workflow.

Rotate package-feed credentials or certificates

Section titled “Rotate package-feed credentials or certificates”

Update the protected host copy of /colony/keys/credentials.yaml or the mounted CA files. The Worker entrypoint renders package-manager configuration and trust stores from scratch at startup, so a running Worker does not adopt the change.

  1. Add the new feed PAT or certificate while the old one remains accepted.
  2. Replace one Worker and wait for startup rendering to succeed.
  3. Run a clean setup that downloads from every affected feed or TLS endpoint.
  4. Continue the rolling replacement across the pool.
  5. Revoke the old PAT or remove the old certificate only after all Workers have restarted.

Use the database provider’s dual-password, role handoff, or connection-proxy feature when available:

  1. Add a new database role/password with equivalent least-privilege schema and runtime access.
  2. Validate a new connection and backup with the replacement.
  3. Update Colony’s protected DATABASE_URL value.
  4. Drain/replace Workers, then restart the Mayor, monitor, MCP, and other long-lived clients so every pool reconnects.
  5. Confirm migrations, queue reads/writes, heartbeats, and monitor queries.
  6. Revoke the old database credential after checking active database sessions.

If the database cannot accept old and new credentials simultaneously, schedule a full colony safestop and treat the rotation as planned downtime rather than risking partial connectivity.

  • No Worker or singleton logs authentication failures.
  • Every intended Worker has a fresh heartbeat and the expected repository scope.
  • Provider write operations, formal review, and merge work under the correct identities.
  • Clean dependency installation succeeds without cached credentials.
  • The monitor and CLI can read and write Postgres.
  • The old credential is revoked at the provider, not merely removed from one environment file.
  • The rotation time, affected credential identifier, verification evidence, and rollback window are recorded without storing the secret itself.