Repository navigation
feat(skills): skill-runner execution surface + close the raw library read (ent#139) - #1735
Conversation
…read (ent#139)
OSS half of the skill runner. Three surfaces.
Backend: GET /api/skills/library/{name} returns a skill's full content —
SKILL.md plus any bundled scripts/, i.e. executable material — behind a bare
get_current_user. An agent-scoped key resolves to its owner, so before this any
agent could pull arbitrary executable content out of the library and run it
locally. That is self-acquisition with no chokepoint, so the endpoint now calls
reject_agent_principal. This stands on its own as an edition-agnostic security
fix, which is why it lives in OSS. Listing (name + description) stays open so
agents can still discover what exists.
MCP: run_skill and list_runnable_skills, structurally run_playbook pointed at
the library. The tool-side allow-list check exists only to turn a predictable
refusal into a message listing what IS available — the backend re-checks at
dispatch, and a failed pre-check falls through rather than failing open into
"assume permitted". On an OSS build both tools return an honest disabled/
unavailable status instead of throwing.
Grid: AgentTile gains its first agent-class variant, keyed off
agent.type === 'skill-runner' (the trinity.agent-type label), so it needs no new
per-agent field and degrades to the standard tile when the feature is absent —
with the module unmounted no agent carries that type. Identity chip, teal avatar
ring and an exposed-skill chip. The ring uses a CSS var rather than a Tailwind
class because there is no teal token in tailwind.config.js and an invented class
name renders no border at all, silently. Status rides the Grid's existing
visibility-aware batch refresh — no new polling loop — and is admin-only, so a
non-admin viewer keeps null and gets the standard tile.
Related to Abilityai/trinity-enterprise#139
Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Live check rendered "1 skills exposed". Related to Abilityai/trinity-enterprise#139 Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
|
Live-tested against a real instance alongside Abilityai/trinity-enterprise#195. Verified live:
Fixed after live check (b56b319): the chip rendered "1 skills exposed" — pluralized. Not verified:
Note for reviewers: the MCP server is a baked image (no bind mount), so |
|
Resolve by running |
vybe
left a comment
There was a problem hiding this comment.
Validated: OSS half of ent#139 (standalone security fix closing the agent-key library-content read + graceful-fallback MCP tools + degrading grid tile). Enterprise half merged with review fixes (single-slot pin). Earlier CI failure was the base-side hung-job flake; rerun green.
Related to Abilityai/trinity-enterprise#139 (OSS half; the gated module is Abilityai/trinity-enterprise#195).
1. Security fix — close the unrestricted library read
GET /api/skills/library/{name}returns a skill's full content — SKILL.md plus any bundledscripts/, i.e. executable material — behind a bareget_current_user. An agent-scoped key resolves to its owner, so any agent could pull arbitrary executable content out of the library and run it locally: self-acquisition with no chokepoint.Now calls
reject_agent_principal. This is edition-agnostic and stands on its own, which is why it lives in OSS rather than behind the entitlement. Listing stays open (name + description) so agents can still discover what exists — only the content fetch is closed.get_skillnow gets 403. Agents get skills two supported ways instead — assigned/injected by an operator, or executed on the runner under a per-skill allow-list. Neither needs raw content over REST.2. MCP tools
run_skill(skill_name, input)andlist_runnable_skills— structurallyrun_playbook(tools/connector.ts) pointed at the library. Both auto-register from the existing tool group; noserver.tschange.The tool-side allow-list check is not authorization — it exists only to turn a predictable refusal into a message listing what IS available. The backend re-checks the ACL at dispatch, and a failed pre-check falls through to the backend rather than failing open into "assume permitted". On an OSS build (no module mounted) both tools return an honest
enabled: false/ "not available on this platform" instead of throwing a stack trace at the agent.3. Grid tile — first agent-class variant
AgentTile.vuekeyed offagent.type === 'skill-runner'(thetrinity.agent-typelabel), so:Adds a
SKILL RUNNERidentity chip (same shape as.sys-badge), a teal avatar ring, and an exposed-skill chip (or a warn chip when the runner exists but execution is off).The ring uses a CSS var (
--gv-ring-runner, defined per-theme inFleetGrid.vue) rather than a Tailwind class — there is no teal token intailwind.config.js, and an invented class name renders no border at all, silently. Light and dark values both defined.Status rides the Grid's existing visibility-aware
refreshBatchData— no new polling loop — and the endpoint is admin-only, so a non-admin viewer keepsnulland gets the standard tile.Deliberately scoped as an in-tile variant rather than a new component, so it does not pre-empt epic Abilityai/trinity-enterprise#94's tile-variant architecture.
Verification
npx tsc --noEmiton the MCP server → clean.@vue/compiler-sfcparse +compileScript+compileTemplateonAgentTile.vueandFleetGrid.vue→ clean. (A fullnpm run buildfails on this machine for an unrelated pre-existing reason:mermaidis inpackage.jsonbut missing from the localnode_modules, breakingAgentWorkspace.vue.)pytest tests/unit -k "skill or models_centralized or auth_wiring or enumeration"→ 138 passed, 3 skipped.GET /api/skills/librarystill 200 for an admin JWT.Not done
The Grid tile has not been seen rendered — no skill-runner agent exists on this stack (the module refuses to provision without a configured skills library), so the variant is verified by compilation and code inspection only, not visually.
🤖 Generated with Claude Code