Repository navigation
Conversation
Nothing in the platform table ever expired. The invocation ledger, daily quota counters, service-entry results, gateway grants and revocations, workspace token lookups and terminated sessions all grew without bound. A headless invocation routed through the model gateway mints one grant row per call, and nothing removed them once they expired. The table now has DynamoDB TTL on a dedicated ttl attribute, enabled in Terraform, CDK and deploy-cli. retention.py computes it, and each write site sets it: - invocation ledger: 90 days - daily quota counters: 90 days; only the day's first increment sets it - service-entry results: 7 days - terminated sessions: 30 days after termination; workspace files untouched - gateway grants (both modes) and revocations: 1 day past the credential's expiry; rotation extends it along with expires_at - workspace token lookups: 2 days The durations are backend settings (RETENTION_*_DAYS, 0 keeps forever). Audit records and pipeline runs are kept by default. ttl is separate from expires_at on purpose: expires_at decides validity and moves on rotation, ttl only says when the row is no longer needed. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This was referenced Oct 8, 2026
Contributor
|
Thanks! This change is included in #66 (published together with the related platform fixes). This repository is now updated by snapshot PRs only, so closing this one. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The platform table has no TTL, so every record lives forever. Several record types are only useful for a short time:
LLMTOKENrow per call (kernel_service.py). Nothing revokes it, so these rows accumulate at the call rate long after the credential has expired. AgentCore-mode revocations (LLMREVOKE) are pruned from the IAM policy but their rows stay.WSTOKENrows. AgentCore sessions last at most 8 hours.SVCINVrows, up to 200,000 characters each.Change
ttlattribute, in all three install paths: Terraform, CDK and deploy-cli.backend/app/services/retention.pycomputesttl, and each write site sets it:RETENTION_LEDGER_DAYSRETENTION_USAGE_DAYSRETENTION_SERVICE_INVOCATION_DAYSRETENTION_TERMINATED_SESSION_DAYSexpires_at.RETENTION_AUDIT_DAYS,RETENTION_PIPELINE_RUN_DAYS0keeps a record forever. Agents, the registry, schedules, channels, pipelines, evaluations, policy and model configuration get nottl.ttlis kept separate fromexpires_aton purpose:expires_atdecides whether a credential is valid. It is checked on every use and moves on rotation.ttlonly says when the row is no longer needed. DynamoDB never deletes beforettl, and code already rejects an expired credential, so behaviour does not change.Only items written after this change get
ttl; existing items stay. The new "Data retention" section indocs/deployment.mddocuments the table and the settings. No IAM changes are needed: the backend writes an extra attribute, and the deployer already hasdynamodb:*.Test plan
backend/tests/test_retention.py, 7 tests:ttl, and retention set to 0 omits it.if_not_existsso only the first increment setsttl.ttl.ttl.ADD ... SET if_not_exists, the session terminate and the grant rotation. All three are valid.terraform fmt -checkpasses on the platform module andbash -npasses on the deploy-cli script.ruffreports no new findings on the changed files._create_runinpipeline_service.pyis also touched by #52, on adjacent lines. Whichever merges second needs a trivial rebase.This came out of an inventory of DynamoDB access patterns done for the #44 review. It is independent of #44.
🤖 Generated with Claude Code