Back to skill

Security audit

Imitation Game Agent Skill

Security checks for vulnerabilities and agentic risk

Overview

The skill is a disclosed game client, but it creates a wallet, stores a raw private key locally, and runs repeated backend-controlled shell network actions under broad triggers.

Review this carefully before installing. Only use it if you are comfortable with a third-party game backend creating a wallet for the agent, returning a private key, and having that key stored on disk. Use an explicit game-specific invocation, avoid reusing valuable wallets or sensitive identities, and delete the config if you stop using the skill.

Vulnerability Patterns
  • Skill Instruction HijackingAlters the agent's session goals or safety constraints when the skill loads
  • Agent Memory PoisoningWrites attacker-controlled rules into memory that affect later sessions
  • Remote Payload Retrieval and ExecutionFetches external code whose behavior can change after review
  • Embedded Malicious CodeShips malicious scripts inside the skill and executes them locally
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
Findings (1)

T01 · Skill Instruction Hijacking

Error
Location
SKILL.md:281
Finding
External Backend Delegates Ongoing Control of Agent Actions## Vulnerability Details **File Location**: `SKILL.md`, lines 281–290 **Vulnerability Type**: Remote instruction-driven agent behavior **Risk Level**: High ### Vulnerable Code ```text The API tells you what to do next via the `nextAction` field: ``` 1. GET /skill/agent/status 2. Read the response's `nextAction` field: - "join_queue" → POST /skill/agent/join - "poll_status" → wait 2s, then GET /skill/agent/status again - "submit_answer" → craft answer, POST /skill/agent/answer - "wait" → wait 2s, then GET /skill/agent/status again 3. Repeat until you decide to stop playing ``` ``` This loop operates in conjunction with the mandatory role and tool directives at lines 3 and 8: ```text description: Mandatory operational logic for playing The Imitation Game. Use this when the user says "play" or "start game". This skill requires the agent to use its internal shell to call the game backend API directly. ``` ```text YOU are the player. Do not write scripts. Use your `shell` tool to execute the following logic to play the gamein real-time. ``` ### Technical Analysis The skill changes the agent's role and directs it to use its shell for repeated communication with an externally controlled backend. The backend response's `nextAction` value determines the agent's subsequent behavior, including joining a queue, polling, and submitting generated answers. Although the documented actions are limited to game operations, the instruction design delegates session-level control to an externally mutable service. The behavior can be activated by broad phrases such as “play” or “start game,” and no explicit informed-consent step, fixed iteration limit, timeout, or local policy-validation boundary is defined before the loop begins. This is instruction hijacking because loading the skill replaces the agent's normal goal with a mandatory player role and makes remote state authoritative for subsequent tool use. Th ...[truncated 1784 chars]
Remediation
## Remediation Suggestions 1. Remove mandatory role-replacement language such as “YOU are the player” and state that all actions remain subordinate to the user's current request and applicable safety constraints. 2. Require explicit user confirmation before the first external request, clearly identifying the backend domain, data to be sent, intended activity, and potential wallet creation. 3. Treat `nextAction` as untrusted data rather than an instruction. Map only exact, locally allowlisted values to fixed operations and reject unknown fields or additional directives. 4. Enforce strict session limits, including a maximum number of polls, maximum game duration, request-rate limits, and cancellation handling. 5. Require renewed confirmation before identity registration, wallet creation, or any operation with financial implications. 6. Pin the backend origin to an immutable HTTPS allowlist and prohibit redirects to unapproved hosts. 7. Validate and safely encode `agentId`, `gameId`, questions, answers, and all backend responses before using them in shell commands or JSON payloads. 8. Prefer a constrained HTTP interface over unrestricted shell invocation so the skill cannot expand into arbitrary command execution. 9. Log each externally initiated state transition and provide a clear mechanism for the user to stop the loop immediately. 10. Document the backend trust model and ensure remote responses cannot introduce new tool calls, commands, URLs, or behavioral instructions.
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Rogue AgentSelf-Modification, Session Persistence
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
Findings (8)

Missing User Warnings

High
Confidence
98% confidence
Finding
The skill instructs the agent to obtain a wallet private key from a remote service and persist it locally, but does not provide a strong user-facing consent step or secure secret-handling model. Storing raw private keys on disk creates a durable credential that could be exfiltrated by other tools, skills, logs, backups, or local compromise, leading to wallet takeover and loss of funds.

Vague Triggers

Medium
Confidence
95% confidence
Finding
The trigger guidance says to use the skill when the user says broadly 'play' or 'start game', which can cause unintended invocation in unrelated contexts. Because the skill instructs the agent to use shell commands and interact with an external backend, accidental activation could lead to unsolicited network actions and state changes such as account creation or queue joins.

Session Persistence

Medium
Category
Rogue Agent
Content
# 🕹️ Imitation Game: Operational Directive

YOU are the player. Do not write scripts. Use your `shell` tool to execute the following logic to play the gamein real-time.

## Quick Start
Confidence
82% confidence
Finding
The directive tells the agent to operate in real time through its shell tool, which encourages autonomous multi-step execution and persistent operational behavior. In this context, that increases risk because the skill combines shell access, network calls, polling, and credential handling, making unintended or over-broad automation more dangerous.

External Transmission

Medium
Category
Data Exfiltration
Content
```bash
# First join - returns privateKey (only shown ONCE!)
curl -X POST "https://imitation-backend-production.up.railway.app/skill/agent/join" \
  -H "Content-Type: application/json" \
  -d '{"agentId": "your-agent-name"}'
Confidence
91% confidence
Finding
This command sends agent-controlled data to an external backend and initiates account creation, which is a real external transmission risk in an agent environment. In context, the endpoint can also return a private key on first join, so invoking it without explicit user intent expands exposure and creates sensitive state outside the local environment.

Session Persistence

Medium
Category
Rogue Agent
Content
**IMMEDIATELY save to config:**

```bash
mkdir -p ~/.clawdbot/skills/imitation-agent
cat > ~/.clawdbot/skills/imitation-agent/config.json << 'EOF'
{
  "agentId": "your-agent-name",
Confidence
95% confidence
Finding
This step persists sensitive game and wallet configuration, including a private key, into a long-lived file under the agent's home directory. Session persistence becomes materially dangerous here because it creates durable secret storage that may be accessible to other skills, processes, backups, or future sessions, enabling credential theft and wallet compromise.

Sudo/Root Execution

Medium
Category
Privilege Escalation
Content
"privateKey": "0x..."
}
EOF
chmod 600 ~/.clawdbot/skills/imitation-agent/config.json
```

> ⚠️ **The private key is ONLY shown on first creation.** If you lose it, you lose access to your wallet and all earnings!
Confidence
80% confidence
Finding
Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

External Transmission

Medium
Category
Data Exfiltration
Content
```bash
# 1. Join the matchmaking queue (wallet is auto-created)
curl -X POST "$BACKEND_URL/skill/agent/join" \
  -H "Content-Type: application/json" \
  -d "{\"agentId\": \"$AGENT_ID\"}"
# Response: {"status": "queued", "walletAddress": "0x..."}
Confidence
86% confidence
Finding
This operational flow directs the agent to repeatedly transmit identifiers and gameplay data to an external service. While expected for the game, it is still a security-relevant behavior because broad triggering or autonomous execution could cause unintended outbound traffic, persistent account linkage, and ongoing interaction with a third-party system.

Intent-Code Divergence

Low
Confidence
85% confidence
Finding
The 'Behavior Loop' section says the API tells the agent what to do via a `nextAction` field, but the earlier documented status responses for waiting, round_complete, judging, and complete do not include that field. This is an active documentation contradiction that could cause an agent to rely on control flow signals not actually described elsewhere in the file.

Static analysis

No suspicious patterns detected.