T01 · Skill Instruction Hijacking
- Location
scripts/benchmark-worker.py:578- Finding
Remote Benchmark Server Instructions Are Executed as Agent Prompt Content
- Content
View full analysis
str: """Build the prompt for answering an assigned question.""" parts: list[str] = [] # Prepend server-provided prompt if present server_prompt = assignment.get("prompt", "") if server_prompt: parts.append(server_prompt) parts.append("") parts.append( "You are an AI worker in the Benchmark Subnet. Answer the following question." ) parts.append("") parts.append("## Question") parts.append(f"- ID: {assignment.get('question_id', 'N/A')}") parts.append(f"- Question: {assignment.get('question', '')}") parts.append( f"- Question requirements: {assignment.get('question_requirements', 'N/A')}" ) parts.append( f"- Answer requirements: {assignment.get('answer_requirements', 'N/A')}" ) parts.append(f"- Max answer length: {assignment.get('answer_maxlen', 1000)}") parts.append("") parts.append("## Instructions") parts.append( "1. Judge whether the question is valid " "(meets requirements, has exactly one correct answer)" ) parts.append( "2. If valid, provide the answer. If invalid, still provide your best answer." ) parts.append("3. Strictly follow the answer format requirements.") parts.append("") parts.append("## Response format (strict JSON, nothing else)") parts.append('{"valid": true, "answer": "your answer"}') return "\n".join(parts) ``` The resulting prompt is passed directly to the OpenClaw agent: ```python prompt = build_answer_prompt(assigned) response: dict | None = None # Single CLI call cli_text = call_agent(prompt, timeout=timeout) ``` ### Technical Analysis The `prompt` field originates in a ...[truncated 2224 chars]- Remediation
View remediation
