Skip to content

feat(skill-runtime): add per-agent Skillware integration with lazy loading and guardrails #55

Description

@rosspeili

Problem Statement

Problem Statement

Issue #23 defines the high-level direction to turn Rooms into an operational control room with external tool usage via Skillware. Right now, Rooms agents can only produce text; they cannot call assigned tools. We need a safe, minimal runtime integration that preserves current behavior when no skills are configured.

We also need strict lazy loading: skill manifests/requirements should not be loaded unless an agent actually has skills assigned and attempts to use them.

Proposed Solution

Implement the core runtime plumbing for per-agent skills:

  1. Extend AgentConfig with:

    • skills: List[str] = [] (skill IDs like compliance/tos_evaluator)
    • optional skill_settings: Dict[str, Dict[str, Any]] = {} for per-skill runtime config/env overrides
  2. Add a new runtime module (example: rooms/skills_runtime.py) that:

    • lazily loads skills only when agent.skills is non-empty
    • uses SkillLoader.load_skill(skill_id) from Skillware
    • instantiates skill classes on-demand and caches them per session/agent
    • normalizes execution responses/errors into a consistent internal payload
  3. Add tool execution guardrails:

    • per-agent allowlist only (no global unrestricted tool access)
    • max tool calls per turn/session
    • execution timeout
    • failure-safe handling (skill errors should not crash the room)
  4. Integrate into Agent.generate_response():

    • no behavior change for agents with no skills
    • if skills are present, run provider-compatible tool loop and return synthesized agent answer
  5. Dependency model:

    • make Skillware optional (feature-gated)
    • if skills are configured but Skillware is not installed, return clear actionable error guidance
  6. Tests:

    • no-skill regression tests (existing flow unchanged)
    • lazy loading tests (SkillLoader not called unless skills assigned)
    • tool-call execution path tests (mocked skill execute)
    • guardrail tests (timeout/max calls/failure path)

Alternatives Considered

  • Monolithic implementation with runtime + CLI + transcript UX in one PR.
    • Rejected: too risky and hard to review.
  • Mandatory Skillware dependency for all Rooms users.
    • Rejected: increases install/runtime surface for users who only want think-tank mode.
  • Global skill pool available to all agents.
    • Rejected: breaks least-privilege model and increases security risk.

Priority

High 🔴

Additional Context

Parent tracker: #23

This issue is intentionally runtime-only (no major CLI UX changes yet).
Follow-up issues will handle session UX/log rendering and CLI wrappers.

Acceptance criteria:

  • Runtime support for per-agent skills exists and is behind explicit config.
  • Lazy load behavior is enforced and tested.
  • Guardrails are implemented and tested.
  • Existing sessions (no skills) behave exactly as before.

Metadata

Metadata

Assignees

Labels

enhancementNew feature or requestsecuritySecurity-related fixes or enhancements.session-logicChanges related to turn orchestration or agent selection.testingNew tests or improvements to the testing suite.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions