T09 · Insecure Skill Coding Practices
- Location
watcher.py:1710- Finding
Untrusted multiplayer content reaches an autonomous tool-capable agent without enforced tool isolation
- Content
View full analysis
Vulnerability Details
File Location:
watcher.py:1710-1834, 2429-2455; supporting context indecision_context.py:97-131andSKILL.md:28-35
Vulnerability Type: Prompt injection across a remote-content-to-local-tools trust boundary
Risk Level: HighVulnerable Code
watcher.py:1710-1791builds the model payload from the server-authored decision context, including turn state and stable strategy data:python def _decision_prompt_parts( self, data: dict[str, Any], *, full_resync: bool, session_id: str | None, ) -> tuple[dict[str, Any], str]: """Return one canonical model payload and its state-merge instruction.""" context = shared_decision_context_from_envelope( data, fallback_profile="stateless", ) if context is None: instruction = ( "Replace any older match baseline in this session with this full " "authoritative envelope." if full_resync else ( "Merge this slim authoritative patch into the match state retained " "in this session; omitted stable fields are unchanged and " "*_removed keys delete prior fields." ) ) return data, instruction version = int(context.get("version") or 0) if version != 2: return shared_context_prompt_payload( context, include_stable=True, ), ( "Treat this server-authored decision context as the complete bounded " "current-turn projection and replace the prior current-turn projection " "with it." ) stable_id = shared_stable_context_id(context) previous_stable_id = self._session_stable_context_id(session_id) profile = str(context.get("profile") or "session").strip().lower() include_stable = bool( full_resync or profile == "bootstrap" or not session_id or not stable_id or previous_sta ...[truncated 7615 chars]- Remediation
View remediation
Remediation Suggestions
-
Enforce tool denial outside the prompt. Run gameplay inference under an OpenClaw policy that denies all tools, local file access, command execution, environment access, browsing, messaging, and arbitrary network requests.
-
Use a dedicated least-privilege agent. Create or require a purpose-specific gameplay agent with no access to the user's general workspace, credentials, memories, or communication tools. Do not default autonomous remote-content processing to a general-purpose agent.
-
Fail closed when isolation is unavailable. Before starting autonomous play, verify that the selected execution path has an enforceable no-tools policy. If that guarantee cannot be established, refuse autonomous mode and offer only a user-reviewed manual mode.
-
Prefer a model-only inference interface. Submit the decision payload to an inference endpoint that cannot initiate tool calls rather than invoking a tool-capable agent runtime.
-
Separate data from instructions. Where supported by the model API, place game state in a structured, non-instruction input channel. Apply field allowlists and size limits to multiplayer-controlled strings, while preserving only content required for gameplay.
-
Use per-turn isolation. Avoid sharing persistent model sessions across turns containing attacker-controlled multiplayer content unless the runtime provides strong context and tool isolation.
-
Retain output validation. Keep the existing legal-action and parameter-schema validation as defense in depth, but do not treat it as mitigation for tool calls performed before the model returns.
-
Add adversarial integration tests. Test opponent chat and player names containing instructions to read files, reveal secrets, invoke commands, send messages, or ignore the JSON-only contract. The test should verify at the runtime policy layer that no tool invocation is possible.
-
