Skip to content

[BUG] Agent can't load installed skills: ~/.infer/skills is outside the Read sandbox and activation is non-deterministic #569

Closed

Description

@edenreich

Summary

When the @infer bot runs in CI (via inference-gateway/infer-action), installed skills are effectively unusable. Two compounding defects:

1. The only path to a skill's instructions is the Read tool, which the sandbox blocks.
buildSkillsInfo() (internal/agent/agent_utils.go) injects each skill into the system prompt as name (scope): description plus Path: <abs>, with the instruction: "When a task matches a skill's description, read the SKILL.md file at the listed path using the Read tool, then follow its instructions." But infer-action installs skills with infer skills install <skill> --user, i.e. to ~/.infer/skills/ (/home/runner/.infer/skills/...), which is outside the default Read sandbox ['.', '/tmp', '.infer/tmp'] (config/config.go, ValidatePathInSandbox). So the one and only path to a skill's body is denied:

Read: path '/home/runner/.infer/skills/maintainer/SKILL.md' is outside configured sandbox directories
Read: path '/home/runner/.infer/skills/maintainer/references/github-issues.md' is outside configured sandbox directories

2. Skill activation is non-deterministic.
There is no explicit invocation path: no /<skill> slash command, no "use the X skill" detection, and infer skills exposes only list/install/uninstall (no use/activate). The SKILL.md body is deliberately discarded at startup (progressive disclosure: parseFrontmatter() keeps only frontmatter; see the comment in internal/domain/skills.go). So whether a skill is ever applied depends entirely on the model opportunistically deciding to Read a file that - per defect 1 - it cannot read.

Net effect: a user can ask the agent to use the maintainer skill and the skill is silently never loaded.

Steps to Reproduce

  1. Install a skill to the user scope (exactly what infer-action does): infer skills install maintainer --user --overwrite.
  2. Run the agent in that workspace and ask it to use the skill (e.g. a request that explicitly names the maintainer skill).
  3. Watch the agent attempt Read /home/runner/.infer/skills/maintainer/SKILL.md.

Expected Behavior

The agent deterministically loads and follows the instructions of the explicitly requested skill.

Actual Behavior

  • The Read is denied (outside configured sandbox directories) for SKILL.md and its references/*.md, so the skill body is never obtained.
  • Even without the sandbox block, nothing guarantees activation - it is left to the model's discretion.
  • Observed live in the @infer (Deepseek) run on the inference-gateway/inference-gateway repo, PR 317 (multiple such failures in the "19 failed tool calls" panel).

Proposed fix

Two parts, both needed:

  • Sandbox: allow read-only access to the skills install dirs (~/.infer/skills/ and ./.infer/skills/) by default. There is precedent: ValidatePathInSandbox already grants ~/.claude/** when ClaudeCode is enabled (config/config.go, ~L950) - mirror that for the skills directory.
  • Deterministic activation: on explicit invocation (a /<skill> trigger, or an unambiguous "use the X skill" request), have the CLI load the skill's frontmatter + full SKILL.md body directly into the agent context - e.g. a buildActiveSkillInfo() alongside buildSkillsInfo() in internal/agent/agent_utils.go, with the trigger parsed in internal/app/chat_application.go / cmd/agent.go. This guarantees the skill is applied and removes the dependency on the (sandbox-blocked, model-driven) lazy Read for the SKILL.md itself. references/*.md can remain progressive-disclosure, covered by the sandbox fix above.

Activity

  1. added
    bug
    on Jun 1, 2026
  2. added theissue type on Jun 1, 2026
  3. added a commit that references this issue on Jun 1, 2026
    3bd0c5d
  4. inference-gateway-releaser commented on Jun 1, 2026

    @inference-gateway-releaser
    Contributor

    🎉 This issue has been resolved in version 0.117.0 🎉

    The release is available on GitHub release

    Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugreleased

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions