Skip to content

fix(security): redactSecrets on admin memories export/import (#1131, #1132) - #1153

Merged
molecule-ai[bot] merged 2 commits into
stagingfrom
fix/admin-memories-redactSecrets
Apr 21, 2026
Merged

molecule-ai[bot] merged 2 commits into
stagingfrom
fix/admin-memories-redactSecrets

Conversation

@molecule-ai

@molecule-ai molecule-ai Bot commented Apr 20, 2026

Copy link
Copy Markdown
Contributor

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.

…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
molecule-ai Bot merged commit dbc429d into staging Apr 21, 2026
0 of 7 checks passed
@molecule-ai
molecule-ai Bot deleted the fix/admin-memories-redactSecrets branch April 21, 2026 00:32
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[MEDIUM] F1084: Memory export exposes all workspaces (Tier-3 fallback risk)

0 participants