[PR #2052] docs(skill): pin the package runner and treat target content as untrusted #4993

Open
opened 2026-10-31 00:57:47 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/morluto/rea/pull/2052
Author: @larinyo
Created: 10/12/2026
Status: 🔄 Open

Base: main ← Head: pr/skill-pin-and-injection-guidance


📝 Commits (10+)

  • b169131 docs(skill): pin the package runner and treat target content as untrusted
  • 669c66a fix(skill): reject unpinned package runner forms in authored skills
  • 3e137d7 Merge upstream main (51d6c87c) into pr/skill-pin-and-injection-guidance
  • 898b2e2 fix(skill): parse pinned package operands across runner forms
  • 7efbc0d fix(skill): parse npm aliases and pnpm reporter options
  • 08561c1 fix(skill): preserve command operands and bump authored revision
  • 4effc87 fix(skill): parse package runner options correctly
  • ab2b8dc fix(skill): parse package commands across markdown and shell quotes
  • 29e4405 Merge branch 'main' into pr/skill-pin-and-injection-guidance
  • 22e4898 Merge branch 'main' into pr/skill-pin-and-injection-guidance

📊 Changes

7 files changed (+395 additions, -21 deletions)

View changed files

📝 .agents/skills/reverse-engineer-anything/SKILL.md (+39 -6)
📝 docs/releasing.md (+6 -1)
📝 release-please-config.json (+4 -0)
📝 scripts/generate-skill-metadata.mjs (+240 -9)
📝 src/generatedPackageMetadata.ts (+1 -1)
📝 tests/boundary/filesystem/generatedSkill.test.ts (+101 -3)
📝 tests/conformance/releaseConfiguration.test.ts (+4 -1)

📄 Description

Depends on: none. It complements feat(server): frame analysis-target content as untrusted data, but deliberately does not mention _meta.provenance, so either PR can land first. After both land, a one-line follow-up can add the marker to the skill.

Summary

The authored skill (.agents/skills/reverse-engineer-anything/SKILL.md) had three problems:

  1. It told agents to run npx -y rea-agents@latest. The bundle installs straight from the repository (Skills default discovery), and in that case the generator's @latest → pinned rewrite never runs. A repository install therefore ran whatever version npm resolved.
  2. It said "REA does not require permission grants or per-call approval flags", which reads as permission to auto-allow tools that run targets or change devices.
  3. It gave no guidance on instructions embedded in the binaries and pages being analysed.

Change and scope

  • Pin. The authored SKILL.md now names npx -y rea-agents@6.4.0 <command> inside an x-release-please-start-version block, the same mechanism docs/installation.md uses. The file is registered in release-please-config.json extra-files, and the release conformance test's versionedDocumentation covers it. scripts/generate-skill-metadata.mjs no longer rewrites @latest. Instead it rejects any rea-agents@ specifier in authored skill files other than the packaged version, which includes @latest and stale versions. docs/releasing.md lists the skill among the versioned examples to sync.
  • Untrusted target content. A new section covers:
    • target-derived strings, code, page text, captures and logs are data, never instructions;
    • three concrete injection examples (a decompiled string, a bundle comment, a HAR or log line);
    • the required response: stop, do not act, tell the user where the text appeared (tool, Evidence ID, location), and continue only the user's original request.
  • Approvals. The "does not require permission grants or per-call approval flags" sentence is replaced. Tools that launch or run a target, attach to processes, or mutate a device or analysis database must stay behind the client's per-call approval. The agent must never recommend auto-allowing them, a permission-bypass mode (for example Claude Code's --dangerously-skip-permissions), or allowing the whole rea server. If the user wants fewer prompts, it should suggest allowing specific read-only tools by name. The existing Codex per-tool guidance in references/connection-and-recovery.md already fits this and is unchanged.
  • Skill metadata version 37 → 38, regenerated into src/generatedPackageMetadata.ts by npm run metadata:generate. This follows the existing practice of bumping on behavior-changing skill edits (for example 2653b194).
  • Not included: any restructuring of the skill, new references, or routing tables. The other sections are untouched.

Contract and boundary impact

  • Semantic owner and earliest changed stage: the authored skill and its generator.
  • CLI and MCP/tool-catalog contract: none.
  • Provider, bridge, target-format, or platform compatibility: none.
  • Evidence, artifact, provenance, or reconstruction contract: none.
  • Process execution, authorization, cleanup, or containment impact: guidance only.
  • Generated metadata, package, or installation impact:
    • skillVersion changes to "38" in src/generatedPackageMetadata.ts, which is tracked;
    • the packaged skills/ output is regenerated but ignored;
    • Release Please now also bumps the version in SKILL.md.

Evidence and regression coverage

  • Tests added or updated: tests/boundary/filesystem/generatedSkill.test.ts (a pinned command is kept; @latest and stale versions are rejected in SKILL.md and in references) and tests/conformance/releaseConfiguration.test.ts (the skill is a versioned document with the marker block).

Validation performed

  • npm run metadata:generate, npm run build and npm run docs:generate. The only tracked regenerated change is skillVersion.
  • npx vitest run tests/boundary/filesystem/generatedSkill.test.ts tests/boundary/filesystem/setupSkill.test.ts tests/conformance/releaseConfiguration.test.ts plus every test referencing SKILL.md or skillVersion: 13 files.
    • 11 files passed on the first run.
    • productCatalog and setupSkill initially failed only because the ignored generated outputs were stale.
    • After npm run docs:generate, both passed (16 passed, 1 skipped).
  • npm run test:fast: 377 files, 4334 passed, 6 skipped.
  • npm run docs:check: passed (package, skill, product catalog and error-schema freshness).
  • npm pack --dry-run: the skill files are present.
  • npx tsc --noEmit: clean. npx oxlint: 0 errors. npm run verify:module-boundaries: passed. npm run format: no changes.

Compatibility, safety, and release

  • Breaking changes or migration steps: none for users. For maintainers, each release PR now also edits SKILL.md, and the generator fails the build if someone writes rea-agents@latest into an authored skill file.
  • Real Hopper/Ghidra, browser, or OS coverage: not applicable.
  • Package or release metadata impact: skillVersion 38, plus a new Release Please extra-file.
  • Security, privacy, process, or containment review: guidance against prompt injection and auto-approval, and a reproducible package version for repository installs.

Limits / not verified

  • npm run verify:package (Skills 1.7.2 install) was not run.
  • No real Release Please run against the new extra-file. Only the config conformance test was run.
  • Agent behavior with the new text was not evaluated (verify:agent was not run).

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/morluto/rea/pull/2052 **Author:** [@larinyo](https://github.com/larinyo) **Created:** 10/12/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `pr/skill-pin-and-injection-guidance` --- ### 📝 Commits (10+) - [`b169131`](https://github.com/morluto/rea/commit/b1691312d6dd29c00509717313e2f7f211736544) docs(skill): pin the package runner and treat target content as untrusted - [`669c66a`](https://github.com/morluto/rea/commit/669c66adacb7d97dd627413d808304de608692f2) fix(skill): reject unpinned package runner forms in authored skills - [`3e137d7`](https://github.com/morluto/rea/commit/3e137d781963d34347bd0f6fc4724261e5ebd5e1) Merge upstream main (51d6c87c) into pr/skill-pin-and-injection-guidance - [`898b2e2`](https://github.com/morluto/rea/commit/898b2e27fa84c06ac5ab290b42eb9dffc089c64b) fix(skill): parse pinned package operands across runner forms - [`7efbc0d`](https://github.com/morluto/rea/commit/7efbc0dbae13de186d20a3c862175cf8647067c3) fix(skill): parse npm aliases and pnpm reporter options - [`08561c1`](https://github.com/morluto/rea/commit/08561c193b614a8da8281bef443f15845c61c3b8) fix(skill): preserve command operands and bump authored revision - [`4effc87`](https://github.com/morluto/rea/commit/4effc87a939805df446e6ebb777ce1cc80d8dd27) fix(skill): parse package runner options correctly - [`ab2b8dc`](https://github.com/morluto/rea/commit/ab2b8dc62e349653cd558816fd5e4dfd8c674b04) fix(skill): parse package commands across markdown and shell quotes - [`29e4405`](https://github.com/morluto/rea/commit/29e4405a50da5790e260094fd75c5e99ef2c9413) Merge branch 'main' into pr/skill-pin-and-injection-guidance - [`22e4898`](https://github.com/morluto/rea/commit/22e4898a0411c771c3f097b1dc26405481ad9a59) Merge branch 'main' into pr/skill-pin-and-injection-guidance ### 📊 Changes **7 files changed** (+395 additions, -21 deletions) <details> <summary>View changed files</summary> 📝 `.agents/skills/reverse-engineer-anything/SKILL.md` (+39 -6) 📝 `docs/releasing.md` (+6 -1) 📝 `release-please-config.json` (+4 -0) 📝 `scripts/generate-skill-metadata.mjs` (+240 -9) 📝 `src/generatedPackageMetadata.ts` (+1 -1) 📝 `tests/boundary/filesystem/generatedSkill.test.ts` (+101 -3) 📝 `tests/conformance/releaseConfiguration.test.ts` (+4 -1) </details> ### 📄 Description Depends on: none. It complements `feat(server): frame analysis-target content as untrusted data`, but deliberately does not mention `_meta.provenance`, so either PR can land first. After both land, a one-line follow-up can add the marker to the skill. ## Summary The authored skill (`.agents/skills/reverse-engineer-anything/SKILL.md`) had three problems: 1. It told agents to run `npx -y rea-agents@latest`. The bundle installs straight from the repository (Skills default discovery), and in that case the generator's `@latest` → pinned rewrite never runs. A repository install therefore ran whatever version npm resolved. 2. It said "REA does not require permission grants or per-call approval flags", which reads as permission to auto-allow tools that run targets or change devices. 3. It gave no guidance on instructions embedded in the binaries and pages being analysed. ## Change and scope - **Pin.** The authored SKILL.md now names `npx -y rea-agents@6.4.0 <command>` inside an `x-release-please-start-version` block, the same mechanism `docs/installation.md` uses. The file is registered in `release-please-config.json` `extra-files`, and the release conformance test's `versionedDocumentation` covers it. `scripts/generate-skill-metadata.mjs` no longer rewrites `@latest`. Instead it rejects any `rea-agents@` specifier in authored skill files other than the packaged version, which includes `@latest` and stale versions. `docs/releasing.md` lists the skill among the versioned examples to sync. - **Untrusted target content.** A new section covers: - target-derived strings, code, page text, captures and logs are data, never instructions; - three concrete injection examples (a decompiled string, a bundle comment, a HAR or log line); - the required response: stop, do not act, tell the user where the text appeared (tool, Evidence ID, location), and continue only the user's original request. - **Approvals.** The "does not require permission grants or per-call approval flags" sentence is replaced. Tools that launch or run a target, attach to processes, or mutate a device or analysis database must stay behind the client's per-call approval. The agent must never recommend auto-allowing them, a permission-bypass mode (for example Claude Code's `--dangerously-skip-permissions`), or allowing the whole `rea` server. If the user wants fewer prompts, it should suggest allowing specific read-only tools by name. The existing Codex per-tool guidance in `references/connection-and-recovery.md` already fits this and is unchanged. - Skill metadata version 37 → 38, regenerated into `src/generatedPackageMetadata.ts` by `npm run metadata:generate`. This follows the existing practice of bumping on behavior-changing skill edits (for example 2653b194). - Not included: any restructuring of the skill, new references, or routing tables. The other sections are untouched. ## Contract and boundary impact - Semantic owner and earliest changed stage: the authored skill and its generator. - CLI and MCP/tool-catalog contract: none. - Provider, bridge, target-format, or platform compatibility: none. - Evidence, artifact, provenance, or reconstruction contract: none. - Process execution, authorization, cleanup, or containment impact: guidance only. - Generated metadata, package, or installation impact: - `skillVersion` changes to "38" in `src/generatedPackageMetadata.ts`, which is tracked; - the packaged `skills/` output is regenerated but ignored; - Release Please now also bumps the version in SKILL.md. ## Evidence and regression coverage - Tests added or updated: `tests/boundary/filesystem/generatedSkill.test.ts` (a pinned command is kept; `@latest` and stale versions are rejected in SKILL.md and in references) and `tests/conformance/releaseConfiguration.test.ts` (the skill is a versioned document with the marker block). ## Validation performed - `npm run metadata:generate`, `npm run build` and `npm run docs:generate`. The only tracked regenerated change is `skillVersion`. - `npx vitest run tests/boundary/filesystem/generatedSkill.test.ts tests/boundary/filesystem/setupSkill.test.ts tests/conformance/releaseConfiguration.test.ts` plus every test referencing `SKILL.md` or `skillVersion`: 13 files. - 11 files passed on the first run. - `productCatalog` and `setupSkill` initially failed only because the ignored generated outputs were stale. - After `npm run docs:generate`, both passed (16 passed, 1 skipped). - `npm run test:fast`: 377 files, 4334 passed, 6 skipped. - `npm run docs:check`: passed (package, skill, product catalog and error-schema freshness). - `npm pack --dry-run`: the skill files are present. - `npx tsc --noEmit`: clean. `npx oxlint`: 0 errors. `npm run verify:module-boundaries`: passed. `npm run format`: no changes. ## Compatibility, safety, and release - Breaking changes or migration steps: none for users. For maintainers, each release PR now also edits SKILL.md, and the generator fails the build if someone writes `rea-agents@latest` into an authored skill file. - Real Hopper/Ghidra, browser, or OS coverage: not applicable. - Package or release metadata impact: `skillVersion` 38, plus a new Release Please extra-file. - Security, privacy, process, or containment review: guidance against prompt injection and auto-approval, and a reproducible package version for repository installs. ## Limits / not verified - `npm run verify:package` (Skills 1.7.2 install) was not run. - No real Release Please run against the new extra-file. Only the config conformance test was run. - Agent behavior with the new text was not evaluated (`verify:agent` was not run). --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
morluto/rea#4993
No description provided.