fix(security): redactSecrets on admin memories export/import (#1131, #1132) - #1153
Merged
Merged
Conversation
…1132) Security fixes for the memory backup/restore endpoints merged in PR #1051. ## F1084 / #1131: Memory export exposes all workspaces GET /admin/memories/export now applies redactSecrets() to each content field before including it in the JSON response. Pre-SAFE-T1201 memories (stored before redactSecrets was mandatory on writes) no longer leak credential patterns in the admin export. ## F1085 / #1132: Memory import does not call redactSecrets POST /admin/memories/import now calls redactSecrets() on content before BOTH the deduplication check and the INSERT. This ensures: - Imported memories with embedded credentials cannot land unredacted in agent_memories (SAFE-T1201 / #838 parity with the commit_memory path). - Dedup is performed against the redacted value so two backups with the same original secret both get [REDACTED:*] as their content and are correctly treated as duplicates. ## New tests admin_memories_test.go: 6 tests covering redactSecrets parity on both Export and Import endpoints. Closes #1131. Closes #1132. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
molecule-ai Bot
added a commit
that referenced
this pull request
Apr 21, 2026
…1132) (#1153) Security fixes for the memory backup/restore endpoints merged in PR #1051. ## F1084 / #1131: Memory export exposes all workspaces GET /admin/memories/export now applies redactSecrets() to each content field before including it in the JSON response. Pre-SAFE-T1201 memories (stored before redactSecrets was mandatory on writes) no longer leak credential patterns in the admin export. ## F1085 / #1132: Memory import does not call redactSecrets POST /admin/memories/import now calls redactSecrets() on content before BOTH the deduplication check and the INSERT. This ensures: - Imported memories with embedded credentials cannot land unredacted in agent_memories (SAFE-T1201 / #838 parity with the commit_memory path). - Dedup is performed against the redacted value so two backups with the same original secret both get [REDACTED:*] as their content and are correctly treated as duplicates. ## New tests admin_memories_test.go: 6 tests covering redactSecrets parity on both Export and Import endpoints. Closes #1131. Closes #1132. Co-authored-by: Molecule AI Core-DevOps <core-devops@agents.moleculesai.app> Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com> Co-authored-by: Molecule AI Infra-Runtime-BE <infra-runtime-be@agents.moleculesai.app>
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.
Security fixes for admin memories backup/restore (PR #1051)
F1084 / #1131: Memory export exposes all workspaces
GET /admin/memories/export now applies redactSecrets() to each content field before returning. Pre-SAFE-T1201 memories no longer leak credential patterns.
F1085 / #1132: Memory import does not call redactSecrets
POST /admin/memories/import now calls redactSecrets() before both dedup check and INSERT. Closes SAFE-T1201 parity gap with commit_memory MCP bridge.
Tests: admin_memories_test.go
6 tests covering redactSecrets parity on Export and Import endpoints.
Closes #1131, #1132.