anthropics / anthropics/skills
PPTX skill: QA subagent prompt leaks as visible text when used via API (no Agent tool)
- Langage dominant
- Python
- Étoiles
- 176k
- Forks
- 20.8k
- Merge moyen
- 7 h 21 min
- PR mergées (30 j)
- 5
Description
## 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.
Guide de contribution
Aucun guide de contribution indexé pour ce dépôt
Évaluation
Cette issue n'a pas encore été évaluée.