feat(skills): added skills to agent block#3149
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Greptile OverviewGreptile Summary
Confidence Score: 3/5
Important Files Changed
Sequence DiagramsequenceDiagram
participant UI as Sim UI (Agent block)
participant API as /api/skills
participant DB as Postgres (skill table)
participant EX as Executor (AgentBlockHandler)
participant LLM as LLM Provider
participant TOOLS as executeTool()
UI->>API: GET /api/skills?workspaceId=...
API->>DB: SELECT skill rows by workspace_id
DB-->>API: skills (name/description/content)
API-->>UI: skills list
UI->>EX: Run workflow with Agent block (skills selected)
EX->>DB: resolveSkillMetadata(skillIds, workspaceId)
DB-->>EX: [{name, description}]
EX->>LLM: System prompt + <available_skills> metadata
EX->>LLM: Tools include load_skill(skill_name enum)
LLM->>TOOLS: call load_skill({skill_name, _context.workspaceId})
TOOLS->>DB: resolveSkillContent(skill_name, workspaceId)
DB-->>TOOLS: markdown content
TOOLS-->>LLM: tool result {content}
LLM-->>EX: Final response using loaded instructions
|
|
@greptile |
|
@cursor review |
Additional Comments (1)
At minimum, gate Prompt To Fix With AIThis is a comment left during a code review.
Path: apps/sim/tools/index.ts
Line: 218:220
Comment:
**Missing authz for skill loads**
`executeTool` handles `load_skill` by trusting `params._context?.workspaceId`, but it never verifies that the running agent/workflow is actually allowed to read skills for that workspace (or that the requested skill is among the agent’s selected skills). Any prompt/tool-call that can set `_context.workspaceId` can fetch arbitrary skill content from that workspace, bypassing the permission-group `disableSkills` enforcement added in the agent handler.
At minimum, gate `load_skill` with the same permission check used for execution (e.g. `validateSkillsAllowed(ctx.userId, ctx)`), and ideally restrict loads to the skill IDs/names attached to the agent block for this run (so the model can’t enumerate/fetch other workspace skills).
How can I resolve this? If you propose a fix, please make it concise. |
|
@greptile |
|
@cursor review |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 2 potential issues.
Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.
...mponents/panel/components/editor/components/sub-block/components/skill-input/skill-input.tsx
Show resolved
Hide resolved
* fix(executor): loop sentinel-end wrongly queued * fix nested subflow error highlighting
…ranch (#3152) * fix(resolver): response format in deactivated branch * add evaluator metrics too * add child workflow id to the workflow block outputs * cleanup typing
Summary
Adds Agent Skills as a first-class feature — reusable prompt/instruction packages that users can create, manage, and attach to Agent blocks. Follows the agentskills.io open specification.
Architecture
Skills use progressive disclosure to keep context lean:
<available_skills>XML so the LLM knows what's availableload_skilltool lets the LLM load full skill content on-demand when it decides a skill is relevantThis works across all providers (OpenAI, Anthropic, Gemini, etc.) using standard tool-calling — no provider-specific code needed.
What's included
skilltable with workspace-scoped unique name index/api/skillswith workspace permission checksskill-inputsubblock (Combobox dropdown for skill selection)skills-resolver.tsfor metadata/content resolution,load_skillhandler in tools/index.tsdisableSkillswired end-to-end (permission groups API, access control UI, settings modal, executor validation)Type of Change
Testing
Tested manually
Checklist