Test that delegated keys never expand their parent’s authority
Build a local authorization matrix for permission inheritance, resource scopes and cross-workspace denials before rolling out delegated credentials.
Replace a widely shared workspace credential with scoped workers while keeping recovery, financial reads and revocation under deliberate control.
A legacy credential often serves several unrelated jobs: content reads, resource creation, billing inspection and cleanup. Start with the workflows that use it, their resource ownership and their real required operations. A list of API routes alone can miss scheduled jobs and incident tools that only run when something fails.
Classify each consumer by workspace, project or inbox boundary and by allowed effects. Include cleanup and known-result recovery explicitly. A worker that can create a resource but cannot inspect or stop its own work can leave an operational gap even when its normal happy path appears correct.
Lupin child keys cannot gain permissions or resource scope beyond their creating key. Omitting a permission map inherits effective parent authority. Therefore, merely creating a new child credential does not prove that it is narrowly restricted. Inspect the returned authority and select an explicit policy suited to the job.
Keep management credentials separate from runtime credentials. Budget changes require a workspace key with api_key_create, while financial reads use api_key_read and inbox-scoped keys are rejected. A content worker should not receive a broader workspace credential simply to make a dashboard query convenient.
Issue one replacement for a clearly bounded workload and store it through the existing private credential mechanism. Check authorized reads and a local or isolated fixture of the intended write path. Include expected denials for another project and forbidden operations; successful authentication alone says little about the effective boundary.
Update one consumer at a time and track which deployments and scheduled processes still use the old credential. Avoid copying either key into incident chat, source control or model context. Evidence of a successful migration can record key identifiers and scopes without retaining the bearer value.
Unfinished paid actions belong to their original workspace and resource context. Inventory pending journals, running resources and scheduled tasks before revoking access. Determine which authorized operator will reconcile them after the old worker credential is removed; a newly restricted worker may intentionally lack that visibility.
Keep a narrow overlap period only when required for continuity and monitor its end. Do not maintain an undocumented broad key indefinitely as a fallback. If a migration needs broader access than the owner approved, stop that consumer’s rollout and resolve its policy through the owner rather than silently widening the replacement.
Revoke the old key after the intended consumers have moved and recovery ownership is assigned. Confirm that it no longer authenticates through a safe read, and verify that replacement workers retain only their planned capabilities. Replaying autonomous registration does not restore a revoked key, so it is not a credential rollback mechanism.
Finish with an operational inventory: active consumer, key identifier, scope, permissions, owner and rotation location. Repeat the boundary checks when new tools are added. This makes least privilege an ongoing property of the deployed workflow instead of a one-time choice made during migration.
Reviewed against the checked-in Lupin implementation and official reference documentation on 2026-11-05. Operational examples are illustrative; no live paid action, provider mutation or external message was executed.
Prepared with AI assistance by Lupin editorial. How we research and maintain these guides.