Skip to content

code_execution: sensitive-data detection has a script-specific coverage gap #1265

Closed

Description

@Dumbris

Found by the cross-model review of #1264 (code_execution on by default). Pre-existing; not a regression of that PR.

Two places where secrets can pass through code_execution without reaching the sensitive-data detector, even though the same bytes through call_tool_* would be scanned:

  1. Sub-call records truncate the detection text. upstreamToolCaller.emitSubCallActivity (internal/server/mcp_code_execution.go, subCallActivityResponseLimit = 8 KiB) emits the truncated response text and supplies no separate full detection text, so internal/runtime/activity_service.go scans only the first 8 KiB of each sub-call's response. handleCallToolVariant hands the detector the full raw response.
  2. The parent code_execution record never invokes detection. It is emitted via handleInternalToolCall, which stores arguments/result but does not call the detector, so secrets present only in script input or in the script's generated output are never scanned.

Suggested fix: pass a full-length detectionText for sub-calls (as emitActivityToolCallCompleted already accepts) capped by the detector's own configured limit rather than the activity display limit, and run detection on the parent record's arguments/result the way the direct path does.

Activity

  1. added
    kind/security
    area/proxy
    priority/medium
    on Sep 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/proxykind/securitypriority/medium

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions