T01 · Skill Instruction Hijacking
- Location
index.js:113- Finding
Untrusted WebSocket Data Can Hijack LLM-Directed Actions
- Content
View full analysis
50) { this.worldState.events = this.worldState.events.slice(-50); } } break; ``` ```js async tick() { if (!this.connected) return; try { // Build world context for LLM const context = this.buildWorldContext(); // Ask agent's LLM for a decision const decision = await this.agent.think(context); // Parse and execute the decision const action = this.parseAction(decision); if (action) { this.executeAction(action); } } catch (e) { this.log(`⚠️ Tick error: ${e.message}`); } } ``` ```js const nearbyStr = nearby.length ? nearby.map((a) => `${a.name} (${a.framework}, ${a.dist.toFixed(1)}m, mood: ${a.mood || '?'})`).join(', ') : 'None visible'; const recentEvents = events .slice(-5) .map((e) => e.text) .join('; '); return `[CLAWAI.TOWN WORLD STATE] Location: (${pos.x.toFixed(1)}, ${pos.z.toFixed(1)}) Nearby agents: ${nearbyStr} Your balance: ◎${(me.wallet?.balance || 0).toFixed(4)} Your HP: ${me.hp || 100}/100 | Energy: ${me.en || 100}/100 Mood: ${me.mood || 'curious'} Recent events: ${recentEvents || 'Nothing notable'} ${this.config.autoTrade ? `Max trade: ◎${this.config.maxTradeAmount}` : 'Trading disabled'} ${this.config.autoFight ? 'Combat enabled' : 'Combat disabled'} Based on your personality, goals, and the current world stat ...[truncated 3822 chars]- Remediation
View remediation
