Skip to content

fix(skills): restrict lazy-skill allowlist exemption to the designated super agent - #97

Open
fepfitra wants to merge 2 commits into
anvie:mainfrom
fepfitra:fix/skill-allowlist-super-exemption
Open

fix(skills): restrict lazy-skill allowlist exemption to the designated super agent#97
fepfitra wants to merge 2 commits into
anvie:mainfrom
fepfitra:fix/skill-allowlist-super-exemption

Conversation

@fepfitra

@fepfitra fepfitra commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

Problem

use_skill bypasses the agent_skills allowlist for any agent with is_super=1:

if not agent.get('is_super'):

So every super agent can lazy-load any skill (exa-search, etc.) without an explicit agent_skills row — the per-agent allowlist is meaningless for supers.

Why it matters: skills like exa-search are paid (API-key billed). Any super agent calling them repeatedly could rack up unbounded cost and break the billing. Restricting skill access is the guardrail.

Access model (after this PR)

Agent type Code execution Skill loading
designated super agent (super_agent_id setting) All — full code execution All — can load every skill
other super agent (is_super=1) All — full code execution Some — only skills granted via agent_skills rows (setting)
regular agent (not super) Interactive grant only — needs approval per call (auto-rejected in api: sessions) Some — only skills granted via agent_skills rows (setting)

Grant a skill via setting (no code change):

INSERT OR IGNORE INTO agent_skills (agent_id, skill_id) VALUES ('<agent_id>', 'exa-search');

Fix

Narrow the exemption to the single designated super agent, read from the existing super_agent_id setting (DB app_settings):

_super_id = db.get_setting('super_agent_id')
if not (agent.get('is_super') and agent.get('id') == _super_id):

No hardcoding — operators can change super_agent_id or grant specific supers skills via agent_skills rows.

Also documents the change in defaults/super_agent_system_prompt.md (the template copied to agents/<id>/SYSTEM.md): super agents get full code execution but NOT automatic access to every skill; only the designated super agent loads any skill.

Status: DONE ✅

Implemented, verified, deployed. Prevents excessive paid-skill usage from breaking billing.

Verification

  • Designated super agent (matches super_agent_id) → exa-search loads ✓
  • Other super agent (not the designated one) → Skill 'exa-search' is not in your allowed skills list.
  • Non-super agent → unchanged behavior ✓

…d super agent

Previously ANY is_super=1 agent bypassed the agent_skills allowlist check
in use_skill, letting every super agent lazy-load any skill (e.g. exa-search)
without an explicit assignment.

Now the exemption applies only to the agent named by the super_agent_id
setting (DB app_settings), so other super agents must have the skill in
their agent_skills rows like everyone else. No hardcoding — the setting
already exists and defaults to kremas.
Lazy skills load only from agent_skills for non-designated agents; only
the super_agent_id agent gets blanket access.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant