paperclipai/paperclip · error · PaperclipRunnerProviderProfileError

paperclip_runner_aws_agentcore_retention_unqualified

paperclip_runner_aws_agentcore_retention_unqualified

Error message

The qualified AWS AgentCore profile must retain Memory events for exactly 90 days.

What it means

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.

Source

Thrown at server/src/services/native-runtime/provider-profile.ts:562

    ) {
      throw new PaperclipRunnerProviderProfileError(
        "paperclip_runner_aws_agentcore_profile_mismatch",
        "The qualified AWS AgentCore profile does not match the adapter selection.",
      );
    }
    const remote = asRecord(stored.configuration);
    const required = (key: string): string => {
      const value = optionalString(remote[key]);
      if (!value) {
        throw new PaperclipRunnerProviderProfileError(
          "paperclip_runner_aws_agentcore_profile_invalid",
          `The qualified AWS AgentCore profile is missing ${key}.`,
        );
      }
      return value;
    };
    if (remote.eventExpiryDays !== 90) {
      throw new PaperclipRunnerProviderProfileError(
        "paperclip_runner_aws_agentcore_retention_unqualified",
        "The qualified AWS AgentCore profile must retain Memory events for exactly 90 days.",
      );
    }
    const maxEstimatedSessionCostUsd = profile.maxEstimatedSessionCostUsd
      ?? positiveNumberOrNull(
        remote.defaultMaxEstimatedSessionCostUsd,
        "paperclip_runner_aws_agentcore_spend_cap_invalid",
        "The AWS AgentCore profile requires a positive estimated session spend ceiling.",
      );
    if (maxEstimatedSessionCostUsd === null) {
      throw new PaperclipRunnerProviderProfileError(
        "paperclip_runner_aws_agentcore_spend_cap_invalid",
        "The AWS AgentCore profile requires a positive estimated session spend ceiling.",
      );
    }
    const model = profile.model ?? required("defaultModel");
    if (model !== AGENTCORE_QUALIFIED_MODEL) {

View on GitHub (pinned to 01ad858492)

Solutions

  1. Set the AgentCore Memory resource's event expiry to 90 days and update stored.configuration.eventExpiryDays to the number 90.
  2. Re-run the AgentCore qualification flow so the Memory resource is provisioned with the required 90-day retention and recorded correctly.
  3. Ensure eventExpiryDays is stored as a JSON number, not the string "90".
  4. If 90-day retention is not acceptable for your compliance posture, use a different backend than aws_agentcore.

Example fix

// before (stored configuration)
{ "eventExpiryDays": "90", ... }
// after
{ "eventExpiryDays": 90, ... }
Defensive patterns

Strategy: validation

Validate before calling

const expiry = storedProfile.configuration?.eventExpiryDays;
if (expiry !== 90) {
  throw new Error(`AgentCore Memory retention must be exactly 90 (number days); got ${JSON.stringify(expiry)}`);
}

Type guard

const hasQualifiedRetention = (c: { eventExpiryDays?: unknown } | null | undefined): c is { eventExpiryDays: 90 } =>
  c?.eventExpiryDays === 90; // strict: rejects "90" and undefined

Try / catch

try {
  await executeRun(run);
} catch (e) {
  if (e instanceof PaperclipRunnerProviderProfileError && e.code === "paperclip_runner_aws_agentcore_retention_unqualified") {
    throw new Error("Update the AgentCore Memory resource to 90-day event expiry, then re-run qualification");
  }
  throw e;
}

Prevention

When it happens

Trigger: 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).

Common situations: 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.

Related errors


AI-assisted analysis of paperclipai/paperclip@01ad858492 (2026-09-02). Data as JSON: /api/errors/7b6daf9d5bb93722. Report an issue: GitHub.