Repository navigation
Conversation
β¦-only) Plan doc for giving Havaya app-user sessions read-only access to the live dashboard skills via a name-scoped `load_skill` gateway tool, without weakening the per-user file jail. Review-only (not for merge) β codex design + security review requested. Options A/B/C compared; A chosen for the smallest isolation blast radius. Co-Authored-By: Claude Opus 4.8 <[email protected]>
cryptolir
left a comment
There was a problem hiding this comment.
Plan review feedback for PR #72:
-
[P1] Realpath confinement under
<home>/skills/conflicts with the actual merged skill roots.
The plan saysload_skillshould matchloadWorkspaceSkillEntries()but then realpath-confineSKILL.mdunder<skillsHome>/skills/. CurrentloadWorkspaceSkillEntries()merges extra, bundled, managed, personal agents-skills, project agents-skills, and workspace skills, with workspace highest precedence. So a skill visible in the prompt may legitimately resolve outside<workspace>/skills/unless it has been dashboard-synced there. Either constrain the app prompt/tool to workspace-synced skills only, or realpath-confine against the matched entry's trusted source root, not only<home>/skills/. -
[P1]
load_skillmust use the same filtered/prompt-visible skill set, not raw entries.
The plan's resolution step usesloadWorkspaceSkillEntries(skillsHome)and matches by name. That raw list includes skills that may later be filtered out byshouldIncludeSkill,skillFilter, eligibility, ordisableModelInvocation. Ifload_skillcan load names outside the app-visible prompt, it becomes a side channel to hidden/non-invocable skills. Build the tool's allowlist from the samepromptEntries/snapshot used to render the app prompt. -
[P2] App-only registration needs to handle
_no-app-usersessions explicitly.
The doc says register only whenisAppUserSession(sessionKey). ButisAppUserSessioncan be true whileresolveAppUserIdfails, and those sessions are intentionally jailed into_no-app-user. Ifload_skillis registered there, a malformed app session with no resolved user still gets shared skill access. That may be acceptable, but it should be a conscious choice. I would gate on resolved app user id, not just:app:. -
[P2] Sibling filenames can leak more than needed.
Returning sibling filenames is lower risk than contents, but it can still reveal implementation detail or accidental files in the skill dir. For v1 I would omitfilesentirely unless a real target skill needs it, or list only allowlisted doc-like files after filtering dotfiles/temp files.
Answers to the open questions:
- Tool scope: app sessions with resolved
appUserIdonly. - Prompt branch point: pass an app-skill-loading mode into the same skills prompt builder/snapshot path, so the visible prompt list and
load_skillallowlist cannot drift. - Name matching: trim input, exact canonical match after that. Avoid case-insensitive unless collisions are explicitly rejected/handled.
- Sibling files: not in v1. Add
fileonly once a skill demonstrably needs it. - Content cap: 24 KB is reasonable; truncate with
truncated: true, but include a clear instruction that truncated skills may be incomplete. - Carve-out: remove the dead host carve-out, and commit
life-access-scopesource to git before more host-only edits accumulate. - Regression surface: normal sessions should be untouched; add a byte-for-byte prompt snapshot test for normal sessions.
β¦v 2) Address the four findings + open-question answers on PR #72: - [P1] confine each load against the matched entry's own trusted root (baseDir), not a hardcoded <home>/skills/, so multi-root (bundled/managed) skills resolve. - [P1] tool allowlist = the same filtered, prompt-visible snapshot, not raw loadWorkspaceSkillEntries (no hidden-skill side channel). - [P2] gate on a resolved app user via the #71 resolveAppUserId ?? appUserIdFromSessionKey fallback (turn-1-safe); exclude _no-app-user. - [P2] drop the sibling files list from v1. Plus: trim+exact name match, 24KB cap with truncated flag, remove the dead life-access-scope carve-out and commit that hook to git, normal-session prompt snapshot regression test. Co-Authored-By: Claude Opus 4.8 <[email protected]>
|
Thanks β all four findings folded into Rev 2 ( [P1] Multi-root confinement β fixed. [P1] No hidden-skill side channel β fixed. The tool's allowlist is now the same filtered, prompt-visible snapshot that renders the app prompt (via the shared builder/snapshot path), never raw [P2] [P2] Sibling files β dropped Open-question answers β all taken as you suggested: trim + exact match against the de-duplicated snapshot (no case-insensitive); 24 KB cap with
|
β¦) (#74) * feat(skills): load_skill tool for app-user sessions (live skills, jailed) App-user sessions run jailed (tools.fs.workspaceOnly) and cannot read the shared SKILL.md by path, so the live dashboard skills listed in their prompt were unusable (the reason the Havaya Drive method was hard-embedded). Add a read-only, name-scoped load_skill tool that resolves a skill NAME β from the same filtered, prompt-visible set the model is shown β to its SKILL.md content, read server-side. The per-user file jail is untouched. Implements docs/experiments/plans/app-user-skill-access.md (Option A) with the codex 4517821566 refinements: - allowlist = the snapshot's resolvedSkills (filtered/prompt-visible), so it is never a side channel to disableModelInvocation/ineligible skills (#2); - confinement against the matched entry's own baseDir, not a hardcoded path, so multi-root (bundled/managed/workspace) skills resolve; symlink-escape rejected (#1); - gated on a resolved app user via resolveAppUserId ?? appUserIdFromSessionKey (turn-1-safe, excludes _no-app-user) (#3); - 24KB cap + truncated flag; no sibling files in v1 (#4). The app skills prompt lists name+description only (no <location>, no host-path leak) and instructs the model to call load_skill; normal sessions unchanged. Files: new src/agents/tools/load-skill.ts; buildAppSkillsPrompt in skills/workspace.ts; buildSkillsSection app branch (system-prompt.ts) threaded via buildEmbeddedSystemPrompt; appSkills wired through pi-tools -> openclaw-tools; attempt.ts resolves the app user, builds the single skills source, and branches. Gate: vitest load-skill 11 + system-prompt.skills 6 + save-user-section 13 (unchanged); tsgo clean on touched files; oxlint --type-aware 0/0; oxfmt. Co-Authored-By: Claude Opus 4.8 <[email protected]> * fix(skills): address codex 4519976882 β tool-filter, compaction, limits Three P2 fixes to the load_skill app-session path: - [#1] derive appSkillLoad from the FINAL tool list (tools.some(load_skill)) rather than just appUserId, and suppress the app skills section when load_skill was filtered out by tool policy β so the model is never told to call a tool it does not have. The skills prompt is now built after tool creation in both attempt.ts and compact.ts. - [#2] mirror the whole app-session skill branch in compact.ts, so app-user COMPACTION also gets the path-free app prompt + load-by-name (no <location> leak, no loss of the load_skill behavior). - [#3] new limitAppSkills() applies the same maxSkillsInPrompt/char caps as the normal prompt; both the app prompt and the load_skill allowlist are built from it, so an app session can neither see nor load more skills than a normal prompt shows. Gate: vitest load-skill 11 + system-prompt.skills 8 (+2 limitAppSkills) + overflow-compaction; tsgo clean on touched files; oxlint --type-aware 0/0; oxfmt. Co-Authored-By: Claude Opus 4.8 <[email protected]> * docs(skills): clarify the load_skill allowlist is the prompt-limited subset Codex recheck 4520156223 non-blocking nit: comments in load-skill.ts and the appSkills option docs (openclaw-tools.ts, pi-tools.ts) described the allowlist as the snapshot's resolvedSkills; after the limit fix it is the prompt-limited subset (via limitAppSkills). Comment-only; keeps the security invariant easy to audit. Co-Authored-By: Claude Opus 4.8 <[email protected]> --------- Co-authored-by: Liran Peretz <[email protected]> Co-authored-by: Claude Opus 4.8 <[email protected]>
Plan doc for codex review β not for merge. Design + security review of giving Havaya app-user sessions access to the live dashboard skills.
Problem
App-user chats on
liferun sandboxed (tools.fs.workspaceOnly: true). They already see the live dashboard skills in their system prompt, but the per-user file jail blocks them fromread-ing theSKILL.mdto apply them β which is exactly why the Drive summary method had to be hard-embedded ("Live skill vs embedded copy").Proposal (Option A)
A narrow, read-only
load_skill({ name })gateway tool: resolves a skill name to itsSKILL.mdcontent server-side (from the shared home, which gateway code can read even though the model's file tools are jailed), realpath-confined under<home>/skills/. The per-user jail is untouched; skills arrive through an additive, name-validated, read-only channel. The app-session skills prompt is rewritten to "callload_skill(name)" and drops the absolute host path.Options B (mirror skills into the jail) and C (read-only skills exception in the core
workspaceOnlyjail) are compared in Β§4 β A chosen for the smallest isolation blast radius.What I'd like reviewed
skillsSnapshot, name matching, whether v1 should serve a skill's sibling files, the content byte cap, and the regression surface for normal sessions.Doc:
docs/experiments/plans/app-user-skill-access.md.pnpm check:docsgreen.π€ Generated with Claude Code