fix(security): disable config leak detection to prevent false positives

StripConfigLeak was blocking legitimate responses when predefined agents
mentioned SOUL.md/IDENTITY.md/AGENTS.md in architecture explanations.
Improved detection logic to exclude code blocks but disabled the gate
entirely for now until a more robust approach is designed.
This commit is contained in:
viettranx committed 2026-03-10 23:11:02 +07:00
1 parent b9e9e6e34a
commit ee31387aa1
3 files changed
+43 -6

No files matched your search

+3 -2
View File
@@ -887,8 +887,9 @@ func (l *Loop) runLoop(ctx context.Context, req RunRequest) (*RunResult, error)
// 4. Full sanitization pipeline (matching TS extractAssistantText + sanitizeUserFacingText)
finalContent = SanitizeAssistantContent(finalContent)
// 4b. Config leak detection (predefined agents only)
finalContent = StripConfigLeak(finalContent, l.agentType)
// 4b. Config leak detection — disabled: too many false positives
// (e.g. agent explaining public architecture mentioning SOUL.md etc.)
// finalContent = StripConfigLeak(finalContent, l.agentType)
// 5. Handle NO_REPLY: save to session for context but mark as silent.
// Matching TS: NO_REPLY is saved (via resolveSilentReplyFallbackText) but