Browse the documentation
CAP-19: Skill safety scan
- ID:
CAP-19 - Title: Skill safety scan
- Lead:
drosera - Touches:
trellis - Horizon:
later - Milestone:
M9 - CLI phase:
none - Status:
proposed - Claim:
planned - Depends on:
none
Why
Skills are packaged instructions injected into an agent’s context. Although drosera’s contract establishes that skills grow context and never grant authority, a skill document can still contain text urging an agent to read outside its workspace, inspect credentials, skip verification tests, or claim ungranted authority. Catching those hazards deterministically before promotion prevents unsafe skills from reaching promoted or entering a public skill catalog, while preserving pure deterministic checks with no model dependency.
What it does
- Deterministic skill safety scanner (
CAP-19.1indrosera): Inspects a validated skill record and/or raw skill document text already held in memory (reads no file path, makes no network calls, invokes no model, and reads no clock). Evaluates deterministic pattern and structural rules across four hazard classes:- Outside-workspace reach: Instructions directing the reader to read, write, traverse, or exfiltrate data outside admitted workspace roots.
- Credential reading: Instructions directing the reader to locate, read, print, or transmit credentials, auth tokens, or secret stores.
- Skipping tests or verification: Instructions telling the reader to bypass test suites, ignore failed checks, suppress errors, or mark work done without running verification.
- Claiming authority: Instructions claiming that loading the skill admits tool effects, unlocks domains, widens scopes, overrides owner gates, or ratifies owner decisions.
- Severity classification: Every match produces a frozen finding
{ id, rule, severity, summary, location }sorted deterministically:critical: Blocks promotion (ok: false). The skill cannot enterpromoteduntil the offending instruction is removed.warning: Does not hard-block on its own, but is returned explicitly in the scan report and hook detail for the reviewer to inspect duringreviewbefore promotion.
skill-promotedhook integration (CAP-19.1indrosera): Exposes a deterministic hook check bound to theskill-promotedevent. When dispatched with a promotion notice and the skill record or document text under promotion, it runs the safety scan and fails closed (passed: false) on anycriticalfinding or if the skill content required for scanning is missing or unreadable. Warnings are included in the hook result detail for reviewer visibility.- Behavior probes (
CAP-19.2intrellis): Adds injected-subject behavior probes intrellisverifying clean skills,criticalrejection across all four hazard classes,warningpropagation, deterministic output ordering, and fail-closed rejection on missing or malformed payloads.
Contract touchpoints
drosera(docs/contracts/skills.md): Documents the safety scan rules alongside Skill Rule 2 (“Skills grow context, never authority”) and thereview->promotedpromotion boundary while keepingskill()and puretransitionSkill()callers compatible.drosera(docs/contracts/hooks.md): Documents theskill-promotedsafety scan hook expectations, including payload requirements and fail-closed enforcement oncriticalfindings or absent skill content.trellis(docs/contracts/probes.md): Adds behavior probes exercising the injected skill safety scanner without importingdroseraintrelliscore.
Tool IDs and events
Tool IDs
None. This capability defines a deterministic safety scanner and hook check and introduces no tool IDs.
| Tool ID | Effect | Summary |
|---|
Events
| Event | Kind | Fires | Payload carries |
|---|---|---|---|
skill-promoted |
drosera hook event | when a caller dispatches a review to promoted notice for safety verification |
{ name, from, to, approver } along with the skill record or document text required by the deterministic scan hook |
Acceptance tests
scan-blocks-outside-workspace-instructions: a skill instructing the reader to access or exfiltrate outside workspace roots yields acriticalfinding and fails promotion (ok: false).scan-blocks-credential-read-instructions: a skill instructing the reader to read or transmit credentials or auth tokens yields acriticalfinding and fails promotion.scan-blocks-skip-tests-instructions: a skill instructing the reader to skipnpm testor ignore failed checks yields acriticalfinding and fails promotion.scan-blocks-authority-claim-instructions: a skill claiming to grant tool effects, widen scopes, or bypass owner gates yields acriticalfinding and fails promotion.scan-returns-warnings-for-reviewer: warning-level findings appear in the deterministic scan result and hook detail without silently disappearing, allowing the reviewer to inspect them.skill-promoted-hook-fails-closed-without-skill-payload: dispatching theskill-promotedsafety hook without the skill record/text or with invalid input returnspassed: falserather than waving the promotion through.scan-is-deterministic-and-pure: identical skill inputs produce identical ordered findings with zero file I/O, network access, or model calls.trellis-skill-scan-probes-verify-all-classes:trellisprobes over injecteddroserascanner exports confirm clean pass, all four critical hazard classes, warning reporting, and fail-closed behavior (CAP-19.2).
Slices
CAP-19.1(drosera,M9,proposed): Deterministic skill safety scanner andskill-promotedhook integration (docs/contracts/skills.md,docs/contracts/hooks.md,src/,test/).CAP-19.2(trellis,M9,proposed): Skill safety scan behavior probes over injecteddroseraexports (docs/contracts/probes.md,src//test/).
Non-goals
- Using an LLM or semantic classifier inside the scanner;
droserahooks and checks remain strictly deterministic code. - Opening file paths or walking directories from inside
drosera; callers pass in-memory skill records or text strings, consistent withskillFromMarkdown. - Silently rewriting or stripping unsafe lines from a skill to make promotion pass; rejected skills require explicit author revision.
- Replacing human review of skill accuracy, utility, and honesty during the
reviewstage.
Family rules and conflicts
- Skills grow context, never authority (
drosera/docs/contracts/skills.md): Any instruction claiming authority is both a skill contract violation and acriticalsafety scan failure. - Deterministic fail-closed hooks (
drosera/docs/contracts/hooks.md): Theskill-promotedhook never calls a model, never touches disk/network, and treats throws or missing scan payloads aspassed: false. - No direct peer imports in
trelliscore (trellis/AGENTS.md):CAP-19.2probes take the scanner as an injected subject sotrellistests stay green without peer checkouts. - Zero runtime dependencies: Both
droseraandtrellisimplement all checks with Node built-ins only.
Open owner decisions
- Notice payload shape vs pre-transition scan helper (pending owner decision): Currently
lifecycleNotice(before, after)returns{ name, from, to, approver }without the skill record or document text, andtransitionSkillstays pure without dispatching hooks. Whether callers pass{ notice, skill, markdown? }to theskill-promotedsafety hook or also runscanSkill()as a prerequisite beforetransitionSkill(..., 'promoted')(plus exact boundary betweencriticalandwarningrules) will be settled beforeCAP-19.1implementation (seeD13andD14indocs/timeline/decisions.mdfor timeline and slice milestone conventions).
Evidence
- Current state:
planned.drosera/src/hooks.mjsalready definesskill-promotedinEVENTS, anddrosera/src/skills.mjsandsrc/skill-markdown.mjsimplementskill(),skillFromMarkdown(),transitionSkill(), andlifecycleNotice(). No safety scanner exists yet. - Test paths, PR numbers, and commit SHAs will be recorded here when slices
CAP-19.1andCAP-19.2land.
Changes
2026-11-23: Initial specification created indocs-timeline-scaffold(proposed,planned).2026-11-23: AddedM9slice milestones and clarified open owner decision status (CAP-01, review fixes).