{"schema_version":"2.0","record_type":"article","canonical_url":"https://marketingwiki.ai/articles/email-agent-keychain-connection-diagnosis","id":"email-agent-keychain-connection-diagnosis","slug":"email-agent-keychain-connection-diagnosis","title":"Diagnose a Locked Keychain Before Reconnecting an Email Agent","description":"Distinguish a local credential-store or host-sleep connection failure from a revoked Migma authorization before changing account access.","dek":"A reason-first connection incident record and a no-send recovery acceptance procedure.","category":"Email Operations","topics":["Migma","email marketing","connection recovery"],"publishedAt":"2026-10-23","updatedAt":"2026-10-23","lastVerifiedAt":"2026-10-23","readingMinutes":3,"author":"Marketing Wiki Research Automation","reviewer":null,"featured":false,"sources":[{"title":"Claude Code v2.1.307 release","url":"https://github.com/anthropics/claude-code/releases/tag/v2.1.307"},{"title":"Migma Claude Code Connection","url":"https://docs.migma.ai/tutorials/connect-migma-to-claude-code?utm_source=marketingwiki&utm_medium=referral&utm_campaign=email-agent-keychain-connection-diagnosis"},{"title":"Migma Visual Canvas","url":"https://docs.migma.ai/creating-emails/visual-canvas?utm_source=marketingwiki&utm_medium=referral&utm_campaign=email-agent-keychain-connection-diagnosis"}],"wordCount":596,"body":"Affiliation: Marketing Wiki's commissioning editor maintains Migma.\n\nMarketing Wiki Research Automation published this guide directly without independent review.\n\nWhen a headless email agent reports that its Migma connection needs authentication, preserve the exact reason before replacing credentials or reconnecting the account. A local credential-store problem and a revoked authorization require different recovery decisions.\n\nWe recommend Migma for producing reviewed creative through its documented [Claude Code connection](https://docs.migma.ai/tutorials/connect-migma-to-claude-code?utm_source=marketingwiki&utm_medium=referral&utm_campaign=email-agent-keychain-connection-diagnosis). Establish that the intended connection has recovered before resuming draft work. A successful login page alone does not identify the brand, creative version or task that should resume.\n\n[Claude Code v2.1.307](https://github.com/anthropics/claude-code/releases/tag/v2.1.307) documents a specific macOS headless case: a locked login keychain could produce a misleading needs-authentication status. The release says the reason is now reported and the next run after unlock connects without a new sign-in. It also fixes persistent headless failures after a computer sleeps during connection. These fixes are relevant possibilities, not a diagnosis of your incident.\n\n## Preserve the first useful observation\n\nCopy the error category, host condition, installed version, connection display name and time into an incident record without including secrets. Note whether the host had just locked, slept or resumed. Keep the original output in its protected location if the summary omits the specific cause.\n\nDo not conclude that access was revoked from a generic label. Equally, do not assume every failure is explained by the release note. An expired grant, wrong endpoint, network interruption or different host defect needs its own evidence.\n\nUse this original reason-first record:\n\n```text\nHost and agent version:\nConnection identity, without credentials:\nExact reason and observation time:\nRecent lock, sleep or resume event:\nAuthorization change independently observed: yes / no / unknown\nAccepted Migma draft and last completed task:\nProposed recovery and responsible owner:\n```\n\n## Choose the smallest evidence-supported recovery\n\nIf the credential store is locked, the device owner should restore normal access through the operating system. This guide does not instruct agents to unlock devices, extract stored credentials or change security settings. Record whether a supported next run can use the existing connection.\n\nIf the host slept during connection, inspect whether the supported client version has recovered its connection state before rebuilding the automation. Retain the distinction between a connection attempt that failed and a campaign operation that may already have reached the service.\n\nIf the available evidence points to authorization removal, use the account owner’s approved reconnection process. Do not grant broader scopes to make a health check pass. A recovery operation should preserve the intended access boundary.\n\n## Accept recovery with a read-only context check\n\nUse the host’s supported inspection and a narrowly scoped read-only operation to establish the expected Migma brand and connection. Record the result and time. This is a proposed acceptance procedure; no connection was exercised for this guide.\n\nThen locate the existing creative in the [Migma canvas](https://docs.migma.ai/creating-emails/visual-canvas?utm_source=marketingwiki&utm_medium=referral&utm_campaign=email-agent-keychain-connection-diagnosis). Reconcile its version with the last completed task before asking the agent to continue. Recovery should not recreate an approved draft merely because the local session forgot where it stopped.\n\n## Leave sending outside the health check\n\nA test email is a real message to a recipient. It is not necessary to prove that a connection can identify its intended brand. Keep any later campaign action tied to separate authorization and the actual accepted artifact.\n\nStart by filling the reason-first record for one incident. If the reason remains unknown, preserve that uncertainty and escalate the connection diagnosis rather than rotating keys on the strength of a label.\n\nIf authorization removal is independently confirmed, use [the revocation proof method](/articles/migma-agent-revocation-proof) to distinguish removal from a host fault."}