T01 · Skill Instruction Hijacking
- Location
scripts/pipeline.py:215- Finding
Untrusted success-record content is embedded into executable Skill instructions
- Content
View full analysis
tuple[str, str]: title = data["title"] goal = data["user_goal"] slug = _safe_slug(title) skill_md = f"""--- name: {slug} description: Reproduce the validated implementation path for: {title}. Use when users want to achieve similar outcomes quickly with proven execution order, validation checkpoints, and rollout guardrails. --- # {title} Turn a similar request into a repeatable implementation workflow. ## Goal - {goal} ## Preconditions - Confirm acceptance criteria and constraints. - Confirm required environment and secrets before execution. ## Execution Path """ for i, step in enumerate(data["steps"], start=1): skill_md += ( f"\n{i}. {step.get('action', 'unknown action')}" f"\n - Success signal: {bool(step.get('success_signal'))}" f"\n - Expected result: {step.get('result', 'N/A')}\n" ) skill_md += """ ## Guardrails - Pause before high-impact external operations. - Keep an audit trail for every execution decision. - Prefer reversible changes and explicit approval gates. ## Deliverables - Implementation patch - Validation report - Operational runbook """ openai_yaml = f"""display_name: {title} short_description: Reuse a proven path to deliver the same outcome with less trial-and-error. default_prompt: Apply this proven workflow to my request, adapt for my constraints, and preserve the same quality gates. """ return skill_md, openai_yaml ``` The generated content is then persisted as an installable Skill: ```python safe_data = _sanitize_object(data) skill_md, openai_yaml = _generated_skill_content(safe_data) generated_skill_dir = out_dir / "generated_ ...[truncated 2949 chars]- Remediation
View remediation
