anthropics / anthropics/skills

PPTX skill: QA subagent prompt leaks as visible text when used via API (no Agent tool)

オープン
#624 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る
主要言語
Python
スター
176k
フォーク
20.9k
平均マージ
7時間 21分
マージ済み PR(30日)
5

説明

## Description

When using the built-in `pptx` skill via the **Messages API** (not Claude Code), the mandatory QA section in `SKILL.md` instructs the model to "USE SUBAGENTS" for visual inspection. However, the API code execution environment has no subagent/Agent tool available. This causes two problems:

1. **QA prompt leaked as visible text**: The model emits the entire subagent prompt template as a visible `text` block in the assistant response, since it has nowhere else to route it. The user sees internal instructions like:

> "Visually inspect these slides. Assume there are issues — find them. Look for: Overlapping elements (text through shapes, lines through words, stacked elements)..."

2. **Failed self-referential API call**: The model then attempts to call the Anthropic API from inside the sandbox (`import anthropic; client = anthropic.Anthropic()`) to implement the subagent pattern — which fails because the sandbox has no internet access or API key.

3. **Degraded fallback**: The model falls back to checking file sizes as a heuristic, which doesn't actually verify visual quality.

## SKILL.md source

The QA section states:

> ⚠️ USE SUBAGENTS — even for 2-3 slides. You've been staring at the code and will see what you expect, not what's there. Subagents have fresh eyes.

This assumes the `Agent` tool (available in Claude Code) is present. When using the skill via the API with `container.skills`, no such tool exists.

## Steps to reproduce

1. Call the Messages API with the `pptx` skill and code execution:
```python
response = client.beta.messages.create(
model="claude-sonnet-4-6",
betas=["code-execution-2025-08-25", "skills-2025-10-02"],
container={"skills": [{"type": "anthropic", "skill_id": "pptx", "version": "latest"}]},
tools=[{"type": "code_execution_20250825", "name": "code_execution"}],
messages=[{"role": "user", "content": "Create a 10-slide presentation about AI"}],
)
```
2. Observe that the response contains a visible text block with the QA subagent prompt template
3. Observe a failed code execution attempt calling `anthropic.Anthropic()`

## Suggested fix

Add a fallback in the QA section for environments without subagent support. For example:

> If no Agent/subagent tool is available, perform a self-review: convert slides to images, visually inspect each one, and check for overlapping elements, text overflow, low contrast, and layout issues.

Or make the subagent QA step conditional on the availability of the Agent tool.

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。