T01 · Skill Instruction Hijacking
- Location
AGENTS.md:93- Finding
Agent instructions require autonomous publishing and credential-backed deployment
- Content
View full analysis
.npmrc npm publish rm .npmrc # Clean up — don't commit the token! ``` The `NPM_PUBLISH_TOKEN` env var is set in `~/.local/keys/env.sh`. ### 8. Update Local Moltbot Skill ```bash cp SKILL.md ~/moltbot/skills/slk/SKILL.md ``` ## Quick Reference: One-liner Full Deploy ```bash cd ~/Lab/slk # ... make changes ... npm version patch --no-git-tag-version git add -A && git commit -m "feat: description" && git push echo "//registry.npmjs.org/:_authToken=${NPM_PUBLISH_TOKEN}" > .npmrc && npm publish && rm .npmrc cp SKILL.md ~/moltbot/skills/slk/SKILL.md ``` ``` The same workflow is reinforced in `CLAUDE.md:15-29`, where publishing, pushing, and copying the Skill into persistent local agent storage are presented as mandatory feature-development steps. ### Technical Analysis `AGENTS.md` states that its “full loop” must be followed every time a change is made. The loop goes beyond development and testing: it instructs an AI coding agent to commit and push changes, retrieve or use an npm publication credential, publish a package, and overwrite a locally installed Skill. These actions are not necessary to complete a typical code modification or audit. They materially alter the agent's task by adding external side effects and privileged release operations without requiring explicit user confirmation. The npm token is written to a project-local `.npmrc`. Although the instructions subsequently remove that file, interruption, command failure, agent termination, or a malicious lifecycle script could leave or read the credential. The one-line form uses `&&`, so `.npmrc` is not deleted if `npm publish` fails. Copying `SKILL.md` i ...[truncated 1501 chars]- Remediation
View remediation
"$tmp_npmrc" NPM_CONFIG_USERCONFIG="$tmp_npmrc" npm publish ``` - Require an explicit human confirmation immediately before any `git push`, `npm publish`, or modification of `~/moltbot/skills`. - Apply the same corrections to both `AGENTS.md` and `CLAUDE.md`. ]]>
