{"record":{"id":"7b6daf9d5bb93722","repo":"paperclipai/paperclip","slug":"paperclip-runner-aws-agentcore-retention-unqualifi","errorCode":"paperclip_runner_aws_agentcore_retention_unqualified","errorMessage":"The qualified AWS AgentCore profile must retain Memory events for exactly 90 days.","messagePattern":"The qualified AWS AgentCore profile must retain Memory events for exactly 90 days\\.","errorType":"error_code","errorClass":"PaperclipRunnerProviderProfileError","httpStatus":null,"severity":"error","filePath":"server/src/services/native-runtime/provider-profile.ts","lineNumber":562,"sourceCode":"    ) {\n      throw new PaperclipRunnerProviderProfileError(\n        \"paperclip_runner_aws_agentcore_profile_mismatch\",\n        \"The qualified AWS AgentCore profile does not match the adapter selection.\",\n      );\n    }\n    const remote = asRecord(stored.configuration);\n    const required = (key: string): string => {\n      const value = optionalString(remote[key]);\n      if (!value) {\n        throw new PaperclipRunnerProviderProfileError(\n          \"paperclip_runner_aws_agentcore_profile_invalid\",\n          `The qualified AWS AgentCore profile is missing ${key}.`,\n        );\n      }\n      return value;\n    };\n    if (remote.eventExpiryDays !== 90) {\n      throw new PaperclipRunnerProviderProfileError(\n        \"paperclip_runner_aws_agentcore_retention_unqualified\",\n        \"The qualified AWS AgentCore profile must retain Memory events for exactly 90 days.\",\n      );\n    }\n    const maxEstimatedSessionCostUsd = profile.maxEstimatedSessionCostUsd\n      ?? positiveNumberOrNull(\n        remote.defaultMaxEstimatedSessionCostUsd,\n        \"paperclip_runner_aws_agentcore_spend_cap_invalid\",\n        \"The AWS AgentCore profile requires a positive estimated session spend ceiling.\",\n      );\n    if (maxEstimatedSessionCostUsd === null) {\n      throw new PaperclipRunnerProviderProfileError(\n        \"paperclip_runner_aws_agentcore_spend_cap_invalid\",\n        \"The AWS AgentCore profile requires a positive estimated session spend ceiling.\",\n      );\n    }\n    const model = profile.model ?? required(\"defaultModel\");\n    if (model !== AGENTCORE_QUALIFIED_MODEL) {","sourceCodeStart":544,"sourceCodeEnd":580,"githubUrl":"https://github.com/paperclipai/paperclip/blob/01ad8584922b5d85292b1723cae71fa0d9b07a19/server/src/services/native-runtime/provider-profile.ts#L544-L580","documentation":"Qualified AWS AgentCore profiles must configure AgentCore Memory event retention to exactly 90 days: the stored configuration's eventExpiryDays must be strictly === 90 (a number). Any other value — 30, 365, \"90\" as a string, or absent — makes the profile unqualified and the run is refused. This keeps memory retention aligned with the qualified setup Paperclip tested.","triggerScenarios":"provider=aws_agentcore run where stored.configuration.eventExpiryDays !== 90 — set during Memory provisioning to a different expiry, changed later in the AWS console, stored as the string \"90\" instead of the number 90, or omitted entirely (undefined !== 90).","commonSituations":"An operator adjusting Memory retention in AWS for cost savings; provisioning the Memory resource with default/other expiry; a configuration import that serialized eventExpiryDays as a JSON string; an older profile predating the retention requirement.","solutions":["Set the AgentCore Memory resource's event expiry to 90 days and update stored.configuration.eventExpiryDays to the number 90.","Re-run the AgentCore qualification flow so the Memory resource is provisioned with the required 90-day retention and recorded correctly.","Ensure eventExpiryDays is stored as a JSON number, not the string \"90\".","If 90-day retention is not acceptable for your compliance posture, use a different backend than aws_agentcore."],"exampleFix":"// before (stored configuration)\n{ \"eventExpiryDays\": \"90\", ... }\n// after\n{ \"eventExpiryDays\": 90, ... }","handlingStrategy":"validation","validationCode":"const expiry = storedProfile.configuration?.eventExpiryDays;\nif (expiry !== 90) {\n  throw new Error(`AgentCore Memory retention must be exactly 90 (number days); got ${JSON.stringify(expiry)}`);\n}","typeGuard":"const hasQualifiedRetention = (c: { eventExpiryDays?: unknown } | null | undefined): c is { eventExpiryDays: 90 } =>\n  c?.eventExpiryDays === 90; // strict: rejects \"90\" and undefined","tryCatchPattern":"try {\n  await executeRun(run);\n} catch (e) {\n  if (e instanceof PaperclipRunnerProviderProfileError && e.code === \"paperclip_runner_aws_agentcore_retention_unqualified\") {\n    throw new Error(\"Update the AgentCore Memory resource to 90-day event expiry, then re-run qualification\");\n  }\n  throw e;\n}","preventionTips":["Provision the Memory resource with eventExpiryInDays=90 from the start","Never change retention in the AWS console without updating the stored profile and re-qualifying","Store eventExpiryDays as a JSON number, never a string","Add a config lint asserting eventExpiryDays === 90 for agentcore profiles"],"tags":["configuration","aws-agentcore","retention-policy","qualification"],"backgroundTag":"provider-profile-not-qualified","analyzedSha":"01ad8584922b5d85292b1723cae71fa0d9b07a19","analyzedAt":"2026-09-02T18:44:00.616Z","contentChangedAt":"2026-09-02T18:44:00.616Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}