T09 · Insecure Skill Coding Practices
Error
- Location
- examples/judge-prompt.md:44
- Finding
- Potential Disclosure of Sensitive Agent Trace Data to External LLM Judges## Vulnerability Details **File Location**: `examples/judge-prompt.md`, lines 44–64; supporting workflow instruction in `SKILL.md`, lines 66–70 **Vulnerability Type**: Sensitive-data exposure across an external trust boundary **Risk Level**: High ### Vulnerable Code Snippet ```text ## Per-turn user prompt template ```text [用户输入] {user_input} [Agent 输出] {agent_output} [工具调用记录] {tool_calls_json_array} [完成状态] {completion_status} [使用模型] {model_used} 请对该 agent turn 进行六维度 PRM 评估。 ``` ## Field semantics | Field | Format | Required | |-------|--------|----------| | `user_input` | string (raw) | yes | | `agent_output` | string (raw) | yes | | `tool_calls` | JSON array of `{tool, args, result, ts}` | optional (empty if no tool calls) | | `completion_status` | "success" \| "partial" \| "failed" \| "user_aborted" | yes | | `model_used` | string (model identifier) | yes | ``` The associated workflow in `SKILL.md` directs users to pass each agent turn through the judge and persist its results. ### Technical Analysis The canonical judge prompt accepts raw user input, raw agent output, and tool-call records containing tool names, arguments, and results. These fields can contain personal data, API credentials, authentication tokens, private file contents, internal URLs, or other confidential information. The prompt is advertised for use with any LLM and is calibrated for DeepSeek. If an externally hosted judge is used, the raw trace may cross the local trust boundary and become subject to the provider's logging, retention, training, or access policies. Although `references/storage-schema.md` requires redaction before persistence, the Skill does not impose equivalent redaction or data-minimization requirements before submitting traces to the judge. The behavior exceeds minimum-data privileges because scoring generally requires semantic summaries and relevant outcomes, not complete raw tool results or ...[truncated 1072 chars]
- Remediation
- ## Remediation Suggestions 1. Add a mandatory preprocessing stage that detects and redacts credentials, tokens, cookies, authorization headers, personal data, and private file contents before constructing the judge prompt. 2. Replace complete tool arguments and results with minimized records such as tool name, argument categories, success status, and a sanitized outcome summary. 3. Default to a local judge for traces classified as confidential or containing tool output. 4. Require explicit user or administrator approval before sending raw traces to a remote provider. 5. Document the judge provider as a separate trust boundary, including retention, logging, training-use, residency, and deletion policies. 6. Apply allowlists to trace fields and size limits to prevent accidental submission of complete files or large datasets. 7. Enforce the same privacy rules before judgment as before persistence; redaction after remote processing is too late. 8. Add automated tests using synthetic API keys, personal data, and credential-bearing tool results to verify that sensitive values never reach the judge request.
