MCPcopy Index your code
hub / github.com/simstudioai/sim / maskContentForStorage

Method maskContentForStorage

apps/sim/executor/handlers/agent/memory.ts:128–140  ·  view source on GitHub ↗

* Handlers persist messages to memory before the executor redacts block * output, so mask content here too when the block-output stage is enabled — * otherwise raw PII is stored in the memory table and read back on later runs. * `onFailure: 'throw'` aborts rather than persisting unredacted

(ctx: ExecutionContext, message: Message)

Source from the content-addressed store, hash-verified

126 * `onFailure: 'throw'` aborts rather than persisting unredacted content.
127 */
128 private async maskContentForStorage(ctx: ExecutionContext, message: Message): Promise<Message> {
129 if (!ctx.piiBlockOutputRedaction?.enabled || !message.content) {
130 return message
131 }
132 return {
133 ...message,
134 content: await redactObjectStrings(message.content, {
135 entityTypes: ctx.piiBlockOutputRedaction.entityTypes,
136 language: ctx.piiBlockOutputRedaction.language,
137 onFailure: 'throw',
138 }),
139 }
140 }
141
142 private requireWorkspaceId(ctx: ExecutionContext): string {
143 if (!ctx.workspaceId) {

Callers 2

appendToMemoryMethod · 0.95
seedMemoryMethod · 0.95

Calls 1

redactObjectStringsFunction · 0.90

Tested by

no test coverage detected