Reject a safe_mode: true skill bundling scripts/ or non-standard resources at validation time (ADR-2034 D-11) #191
Labels
No labels
auto/blocked-by-deps
auto/ci-timeout
auto/claimed-implementer
auto/claimed-merge
auto/claimed-reviewer
auto/driver-down
auto/invariant-violation
auto/last-attempt-tier-0
auto/last-attempt-tier-1
auto/last-attempt-tier-2
auto/last-attempt-tier-min
Automation Tracking
auto/needs-conflict-resolution
auto/needs-implementer
auto/postmortem
auto/ready-to-merge
auto/restart-throttled
auto/revert
auto/sentinel
auto/stale-inactivity
auto/unstable
Blocked
Bounty
$100
Bounty
$1000
Bounty
$10000
Bounty
$20
Bounty
$2000
Bounty
$250
Bounty
$50
Bounty
$500
Bounty
$5000
Bounty
$750
MoSCoW
Could have
MoSCoW
Must have
MoSCoW
Should have
Needs Feedback
Points
1
Points
13
Points
2
Points
21
Points
3
Points
34
Points
5
Points
55
Points
8
Points
88
Priority
Backlog
Priority
CI Blocker
Priority
Critical
Priority
High
Priority
Low
Priority
Medium
Signed-off: Owner
Signed-off: Scrum Master
Signed-off: Tech Lead
Spike
State
Completed
State
Duplicate
State
In Progress
State
In Review
State
Paused
State
Unverified
State
Verified
State
Wont Do
Type
Automation
Type
Bug
Type
Discussion
Type
Documentation
Type
Epic
Type
Feature
Type
Legendary
Type
Refactor
Type
Support
Type
Task
Type
Testing
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Blocks
#160 Epic: Agent Skills — Full Resource Support and Safe Execution
cleveragents/cleveractors-core
Reference
cleveragents/cleveractors-core#191
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Metadata
Commit Message:
feat(skills): reject safe_mode:true skills that bundle scripts/ or non-standard resourcesBranch:
feature/m1-skill-safe-mode-resource-auditNote (amended 2026-11-25): This repository's PRs are submitted against
develop, notmaster. The reference tomasterbelow describing the PR target is corrected todevelopaccordingly; nothing else about the acceptance criteria changes.Background and context
ADR-2034 D-9 already prevents a
safe_mode: trueskill from executing ascripts/or non-standard-folder resource (the double-safety gate's "skill safety" half stays closed). The ADR's 2026-11-25 revision adds D-11: nothing previously prevented such a skill from existing in the first place —SkillValidator.validate(src/cleveractors/agents/skill_schema.py, starting line 193) computesresources(_validate_resources, line 261) andsafe_mode(_validate_safe_mode, line 262) completely independently and never cross-checks them. A skill package can therefore declare (or default to)safe_mode: true— asserting it needs no privileged operations — while still bundling ascripts/or non-standard-folder entry that only makes sense under privilege. The declaration is then not merely unused, it is false, and nothing flags this at the point the skill is loaded.Per D-11, this must fail fast —
ValidationErrorfromSkillValidator.validate, whichSkillLoader._validate_one(src/cleveractors/agents/skills.py, ~line 236) already wraps asAgentCreationErrorfor every other validation failure — not merely leave the resource dormant and unreachable at execution time.Current behavior
SkillValidator.validateaccepts, without error, skill content such as:with no
safe_modefield (canonical defaulttrue) — even thoughscripts/helper.pyclassifies (viaSkillResourceClassifier.classify, same file, ~line 80) asSkillResourceClass.SCRIPT, a class that can never be executed while the skill reports itself safe. The same gap exists for a bundled non-standard-folder entry (e.g.fixtures/sample.pdf, classifiedNON_STANDARD).Expected behavior
SkillValidator.validateraisesValidationError— naming the skill'snameand every offending resource path — when the skill's effectivesafe_mode(explicit or defaulttrue) istrueandresourcescontains at least one entry classified bySkillResourceClassifier.classifyasSkillResourceClass.SCRIPTorSkillResourceClass.NON_STANDARD. A skill declaringsafe_mode: falseis unaffected regardless of what itsresourcescontain — the rule is one-directional, matching ADR-2034 D-11.Acceptance criteria
safe_mode: true(explicit or omitted) and ascripts/...resource fails validation withValidationErrornaming the skill'snameand the offending path.safe_mode: trueand a non-standard-folder resource (e.g.fixtures/...) fails validation the same way.safe_mode: trueand onlyreferences/,assets/, and root-level files continues to validate successfully (no regression).safe_mode: falsevalidates successfully regardless of itsresources— bundling no script/non-standard resource at all is not an error.SkillLoader._validate_one/load/aload(src/cleveractors/agents/skills.py) surface this asAgentCreationErrorwith no code change required there, since they already wrap anyValidationErrorraised bySkillValidator.validate.Supporting information
docs/adr/ADR-2034-skill-package-support.mdD-11.docs/actor-registry-standard.md§16.1 "Safe-mode/resource consistency".docs/index.md§4.4.8 "Resolution and validation".SkillValidator.validate(src/cleveractors/agents/skill_schema.py, ~line 193), specifically the gap betweenresources = self._validate_resources(...)(line 261) /safe_mode = self._validate_safe_mode(...)(line 262) and theSkill(...)construction (line 266).SkillResourceClassifier.classify(same file, ~line 80) is the existing D-8 classifier to reuse — do not reimplement path classification.Subtasks
SkillValidator.validate(src/cleveractors/agents/skill_schema.py), run afterresources/safe_modeare computed and before constructingSkill, that raisesValidationErrorwhensafe_modeisTrueand anyresourceskey classifies asSkillResourceClass.SCRIPTorSkillResourceClass.NON_STANDARDviaSkillResourceClassifier.classify.nameand every offending resource path in theValidationErrormessage (not just the first).features/agent_skills.feature(alongside the existing safe_mode/resources scenarios around lines 78-110) covering:safe_mode: true+ a script resource fails;safe_mode: true+ a non-standard resource fails;safe_mode: true+ only references/assets/root files succeeds;safe_mode: false+ a script or non-standard resource succeeds;safe_mode: falsewith neither succeeds.nox -s coverage_report.nox(all default sessions), fix any errors.Definition of Done
This issue is complete when:
develop, reviewed, and merged.