T09 · Insecure Skill Coding Practices
- Location
scripts/setup-auto-memory.sh:43- Finding
API Key Is Echoed During Interactive Setup
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
This skill appears to do what it claims: store and recover agent memory through public permanent storage, with important privacy and API-key handling risks disclosed enough for user review.
Install only if you want permanent public storage for selected memories or files. Do not upload secrets, credentials, private prompts, regulated data, or personal data unless you encrypt it first. Treat the Auto Drive API key as sensitive, avoid pasting it while screen sharing or into shell history, and pin the optional npx-based auto-respawn tooling before using wallet anchoring.
scripts/setup-auto-memory.sh:43API Key Is Echoed During Interactive Setup
scripts/update-api-key.sh:17API Key Rotation Accepts Secrets Through Command-Line Arguments
scripts/automemory-download.sh:27Download Destination Validation Can Be Bypassed with a Final-Component Symlink
SKILL.md:233Optional Wallet Integration Uses an Unpinned Package Through npx
The declared description promises persistent agent-memory functionality on the Autonomys Network, including saving decisions/context and rebuilding history from a CID after state loss. This code chunk does not implement those behaviors. Instead, it contains support/setup logic: dependency checks, CID regex validation, API-key verification with the Auto Drive service, and local credential/config persistence. Those are materially different from the advertised primary purpose. While helper/setup code can be related, this chunk lacks any actual memory-chain upload, retrieval, or reconstruction logic, and it performs an undeclared credential-handling capability.
The description promises a durable agent-memory system that saves decisions, identity, and context and can reconstruct full history from a CID. The supplied code does not implement saving, memory chaining, identity/context handling, or history reconstruction. It only validates a CID and downloads the corresponding file from Autonomys endpoints, writing it to stdout or a local file. This is a materially different primary purpose. The optional use of an API key for authenticated downloads also touches external access not reflected in the declared permissions, though the main mismatch is the gap between claimed memory functionality and actual file-download behavior.
The declared description presents a broader system capability centered on durable storage and recovery of agent memory on the Autonomys Network. The supplied code chunk is specifically a recall utility: it accepts or discovers a CID, validates it, downloads each linked memory item via API or public gateway, optionally decompresses content, prints or saves JSON files, follows previousCid links, and optionally rewrites a local automemory state file. That is only the retrieval/restoration portion of the described system, not the permanent storage portion. The code does not upload, save, or persist memories to the network, nor does it reconstruct full agent identity/context except by outputting fetched entries. Because the primary declared purpose combines storage and guaranteed persistence, while the actual script is a limited chain-fetch/restore tool with local file writes, this is a material description-behavior mismatch.
The code is a generic uploader for a single file to Auto Drive. It authenticates with an API key, creates an upload, sends one file chunk, completes the upload, validates the returned CID, and prints the CID/gateway URL. While this may be a building block for storage on Autonomys-related infrastructure, it does not implement the declared higher-level behavior of permanent agent memory, chaining memory entries, preserving identity/context, or reconstructing history after state loss. The description materially overstates the actual behavior, so this is a mismatch.
The declared description is about a memory persistence capability: saving agent state/history to the Autonomys Network and rebuilding history from a CID. The supplied code does not implement memory saving, retrieval, chain reconstruction, or CID-based recovery. Instead, it performs initial service configuration by directing the user to create an API key, collecting that credential, saving it locally, and verifying the key. While this may support the broader memory feature, the chunk’s actual primary purpose is setup and credential management, which is materially different from the declared end-user functionality.
The declared description is about durable agent-memory storage and recovery on the Autonomys Network. The actual code does not implement memory storage, recovery, CID handling, identity/context persistence, or network-based history reconstruction. Instead, it performs credential management: it reads a new API key, validates it, saves it, and tells the user to restart a gateway. This is a materially different primary purpose and introduces an undeclared capability related to secret/API key handling.
The declared description presents a core memory-storage and history-reconstruction capability on the Autonomys Network. The supplied code does not store memory, rebuild history, manage CIDs, or implement persistence logic. Instead, it is an operational verification script for setup readiness: it checks local prerequisites, validates an API key, and displays account upload limits and usage. These are materially different primary behaviors from the declared purpose, so this is a clear description-behavior mismatch.
Referenced artifact was not completely inspected
scripts/automemory-recall-chain.sh [cid] [--limit N] [--output-dir DIR]
Referenced artifact was not completely inspected
scripts/automemory-recall-chain.sh [cid] [--limit N] [--output-dir DIR]
The skill uses 'shell' capability that is not listed in its permissions. This may indicate deceptive intent or missing permission declarations.
The script is designed to persist an API key in plaintext within $HOME/.openclaw/.env, creating a durable secret at a predictable location. Even though permissions are tightened, any compromise of the user account, unsafe backups, accidental file disclosure, or other local tooling that reads .env files could expose the credential.
AD_BASE_URL="https://mainnet.auto-drive.autonomys.xyz/api"
AD_DOWNLOAD_URL="https://public.auto-drive.autonomys.xyz/api"
AM_OPENCLAW_DIR="${OPENCLAW_DIR:-$HOME/.openclaw}"
AM_ENV_FILE="$AM_OPENCLAW_DIR/.env"
AM_CONFIG_FILE="$AM_OPENCLAW_DIR/openclaw.json"
GREEN='\033[0;32m'
This block intentionally manages a .env file containing AUTO_DRIVE_API_KEY, which increases the credential exposure surface beyond process memory into persistent local storage. In the context of an agent skill that may be installed broadly, automatic secret persistence makes leakage through backups, support bundles, repo mistakes, or local compromise more likely.
fi
echo -e "${GREEN}✓ Saved to $AM_CONFIG_FILE${NC}"
# --- .env ------------------------------------------------------------------
# Remove any existing AUTO_DRIVE_API_KEY lines first to prevent duplicates,
# then append exactly one entry.
if [[ -f "$AM_ENV_FILE" ]]; then
The code appends the API key directly into a shell-sourceable .env file, creating plaintext secret material on disk. While quoting is handled carefully to prevent shell injection, the main risk remains credential disclosure from persistent storage in a commonly targeted file format.
sed '/^AUTO_DRIVE_API_KEY=/d' "$AM_ENV_FILE" > "$sedtmp" && mv "$sedtmp" "$AM_ENV_FILE"
fi
# Single-quote the value so characters like #, $, and backticks are
# preserved literally when the .env file is later sourced by bash.
local safe_key="${key//\'/\'\\\'\'}"
echo "AUTO_DRIVE_API_KEY='${safe_key}'" >> "$AM_ENV_FILE"
chmod 600 "$AM_ENV_FILE"
Remote code is downloaded and executed. This bypasses code review and could introduce malicious code.
if [[ -n "$EXPERIENCE" ]] && echo "$EXPERIENCE" | jq empty 2>/dev/null; then
echo "[$COUNT] Fetched $CID via gateway" >&2
else
# ZLIB compressed — pipe curl directly into decompressor (no intermediate variable)
EXPERIENCE=""
if command -v python3 &>/dev/null; then
EXPERIENCE=$(curl -sS --fail "$GATEWAY_URL" 2>/dev/null \
Remote code is downloaded and executed. This bypasses code review and could introduce malicious code.
| python3 -c "import sys,zlib;sys.stdout.buffer.write(zlib.decompress(sys.stdin.buffer.read()))" 2>/dev/null || true)
fi
if [[ -z "$EXPERIENCE" ]] && command -v perl &>/dev/null; then
EXPERIENCE=$(curl -sS --fail "$GATEWAY_URL" 2>/dev/null \
| perl -MCompress::Zlib -e 'undef $/;my $d=uncompress(<STDIN>);print $d if defined $d' 2>/dev/null || true)
fi
if [[ -n "$EXPERIENCE" ]]; then
The skill has Write permission and explicitly documents persistent local state updates, including writing the latest CID to a state file and modifying MEMORY.md. In context, this persistence is more dangerous because the skill's purpose is long-term retention and resurrection of agent context; accidental or unsafe writes can preserve sensitive data locally and make future agents trust or consume tainted history.
license: Apache-2.0
description: Indestructible agent memory — permanently stored, never lost. Save decisions, identity, and context as a memory chain on the Autonomys Network. Rebuild your full history from a single CID, even after total state loss.
compatibility: Requires curl, jq, and the file utility, plus outbound HTTPS to the Autonomys Auto Drive API (ai3.storage) and public gateway. Stored data is permanent and public — do not store secrets. Works with OpenClaw and Hermes agents on macOS and Linux.
allowed-tools: Bash(curl:*) Bash(jq:*) Bash(file:*) Read Write
metadata:
openclaw:
emoji: "🧬"
The invocation guidance includes broad phrases like 'save memory', 'remember this permanently', and 'Any time the user wants data stored permanently,' which can overlap with ordinary conversational requests. In an agent environment, this increases the risk of unintentional invocation and accidental transmission of sensitive context to a permanent public storage network.
The documentation instructs users to run npx tsx auto-respawn.ts ... without pinning a specific package version. Unpinned npx execution can fetch whatever version is current at execution time, creating a supply-chain risk where a compromised or incompatible dependency is executed unexpectedly.
The document explicitly encourages storing arbitrary agent memory, including potentially full file snapshots and identity/context data, on permanent decentralized storage and describes resurrection from a single CID, but it does not warn that such data may be irreversible, publicly retrievable, and unsuitable for secrets or personal data. In the context of an agent memory skill, this omission is dangerous because operators may persist API keys, credentials, private prompts, personal data, or sensitive internal state that cannot be deleted once published.
Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.
local key="$1"
mkdir -p "$AM_OPENCLAW_DIR"
chmod 700 "$AM_OPENCLAW_DIR"
# Collect temp files for cleanup
_AM_TMPS=()
Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.
jq -n --arg key "$key" \
'{"skills": {"entries": {"auto-memory": {"enabled": true, "apiKey": $key}}}}' \
> "$newtmp" && mv "$newtmp" "$AM_CONFIG_FILE"
chmod 600 "$AM_CONFIG_FILE"
else
local jsontmp
jsontmp=$(mktemp)
Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.
jq -n --arg key "$key" \
'{"skills": {"entries": {"auto-memory": {"enabled": true, "apiKey": $key}}}}' \
> "$newtmp" && mv "$newtmp" "$AM_CONFIG_FILE"
chmod 600 "$AM_CONFIG_FILE"
else
local jsontmp
jsontmp=$(mktemp)
Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.
jq -n --arg key "$key" \
'{"skills": {"entries": {"auto-memory": {"enabled": true, "apiKey": $key}}}}' \
> "$newtmp" && mv "$newtmp" "$AM_CONFIG_FILE"
chmod 600 "$AM_CONFIG_FILE"
else
local jsontmp
jsontmp=$(mktemp)
Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.
jq -n --arg key "$key" \
'{"skills": {"entries": {"auto-memory": {"enabled": true, "apiKey": $key}}}}' \
> "$newtmp" && mv "$newtmp" "$AM_CONFIG_FILE"
chmod 600 "$AM_CONFIG_FILE"
else
local jsontmp
jsontmp=$(mktemp)
Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.
jq -n --arg key "$key" \
'{"skills": {"entries": {"auto-memory": {"enabled": true, "apiKey": $key}}}}' \
> "$newtmp" && mv "$newtmp" "$AM_CONFIG_FILE"
chmod 600 "$AM_CONFIG_FILE"
else
local jsontmp
jsontmp=$(mktemp)