You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The executeTypescript defense-in-depth "dangerous pattern" validator
(src/validation/security-validator.ts:43-63) matches security-sensitive literal
tokens in the submitted source — eval(, exec(/execSync/execFile, os.system, subprocess.(run|call|Popen|check_output), import … 'child_process'. Because the match
is on raw source text, it also fires when those tokens appear in non-executable
contexts: string literals, documentation text being written to a store, comments, or
data being analyzed.
When that happens the model receives a hard refusal and — not recognizing it as terminal — retries reworded variants repeatedly. The 2026-06-22 cross-project log analysis
(template /dev-analyze-and-self-improve) found this as the single largest cluster: 26 occurrences / 3 sessions (modulo, paperclip-management), all retry-flagged.
Reproduction
Submit any executeTypescript whose code contains one of the blocked tokens as data —
e.g. building a Markdown note that documents the validator's own blocklist, or analyzing a
snippet that mentions subprocess.run. The call is refused even though nothing dangerous
executes. (Observed live while writing the resolution note for the consuming template's
issue aberemia24#38.)
Why it matters
Agents waste turns retry-looping on a non-retryable refusal.
The refusal text does not tell the caller it is terminal, nor how to proceed.
The legitimate escape hatch (skipDangerousPatternCheck: true param / CODE_EXECUTOR_SKIP_DANGEROUS_PATTERNS env) is under-documented at the point of failure.
Suggested directions (non-binding)
Refusal message: make it explicit that the block is terminal ("do not retry; this is
defense-in-depth, not a transient error") and name the bypass param. This alone would stop
the retry-loops.
Reduce false positives: consider not matching inside string/comment literals (the tokens
are dangerous when executed, not when present as text/data). A lightweight tokenizer or
skipping quoted/commented regions would cut the noise.
Discoverability: surface skipDangerousPatternCheck (defense-in-depth bypass, not a
security boundary) in the refusal message and tool description.
Context
Filed from the claude-code-developer-template self-improvement issue aberemia24#38 (pattern P1).
The consumer side is handled there (agent guidance: recognize the hard refusal, stop
retrying, use the deliberate bypass when the call is legitimate). This issue tracks the
server-side tuning. Reference: src/validation/security-validator.ts:43-63.
Activity
test: repoint dead test-file imports to current src/ module locations
Merge pull request #8 from SWSAmor/fix/issue-7-terminal-refusal-message