Repository navigation
Description
Summary
Follow-up to #569 / #571 (shipped in v0.117.0). The sandbox carve-out for ~/.infer/skills and ./.infer/skills is currently conditional on c.Agent.Skills.Enabled being true at ValidatePathInSandbox time (config/config.go:1041). When that flag isn't set — running with default config, before infer config agent skills enable has run, or when the INFER_AGENT_SKILLS_ENABLED override hasn't reached the validator — the carve-out silently does not fire and reads of SKILL.md are denied with outside configured sandbox directories.
Skills directories are a well-known, read-only allowlist under ~/.infer/. Gating their sandbox visibility on a runtime feature flag re-introduces the failure mode #569 was meant to remove.
Proposed fix
Move the skills directories into the default Sandbox.Directories in DefaultConfig() (config/config.go:619-625), unconditionally:
// resolve user-scope skills dir at config-build time
homeDir, _ := os.UserHomeDir()
dirs := []string{".", "/tmp", ConfigDirName + "/tmp", ConfigDirName + "/skills"}
if homeDir != "" {
dirs = append(dirs, filepath.Join(homeDir, ConfigDirName, "skills"))
}
Sandbox: SandboxConfig{
Directories: dirs,
ProtectedPaths: []string{ConfigDirName + "/", ".git/", "*.env"},
},Then drop the isWithinSkillsDir-gated branch of the carveOut expression in ValidatePathInSandbox (lines 1041-1050). Keep isWithinConfigSubdir(absPath, "tmp", "plans") — that's an orthogonal carve-out for project .infer/{tmp,plans} and unrelated to skills.
Protected-paths interaction
protected_paths: [.infer/] will currently match ~/.infer/skills/foo/SKILL.md via the substring/prefix logic in checkProtectedPaths (config/config.go:1127-1149). Two options:
- Recognize an explicit, more-specific
Sandbox.Directoriesentry (e.g.~/.infer/skills) as an override of a broaderprotected_pathsentry (.infer/). Generalizes today'scarveOut-skip-.infer/trick at line 1131 into something declarative. - Add an
isWithinSkillsDir(absPath)short-circuit incheckProtectedPaths(always allow, no flag) — narrower but simpler than option 1.
Either way, the agent's Read of SKILL.md and references/*.md succeeds with default config; ~/.infer/config.yaml, ~/.infer/conversations.db, etc. remain protected because they're outside skills/.
Why this is better than the v0.117.0 carve-out
- One source of truth for what is readable:
Sandbox.Directories. No second runtime predicate to keep in sync. agent.skills.enabledgoes back to meaning exactly "load skill metadata into the prompt and offer them to the agent" — purely about discovery/loading, no sandbox semantics.- No env-var plumbing required from
infer-actionor any other consumer:INFER_AGENT_SKILLS_ENABLED=truebecomes optional for reading (still useful for enabling skill loading). - Behavior is identical across
chat,infer agent, channels, and heartbeat — no per-mode flag drift.
Repro
Failed run that prompted this: @infer on inference-gateway/adl (2026-06-02), CLI v0.116.0 via inference-gateway/[email protected]'s pin. v0.116.0 has no carve-out at all, so this exact failure is also resolved by the centralized workflow bumping its cli-version to v0.117.0+ — but the conditional design means even after that bump the failure can re-appear if agent.skills.enabled isn't true at validation time.
Tests
Update config/config_test.go:
- New:
ValidatePathInSandboxof~/.infer/skills/foo/SKILL.mdsucceeds withDefaultConfig()andAgent.Skills.Enabled = false. - New: same for
./.infer/skills/foo/SKILL.md. - New:
~/.infer/config.yamland~/.infer/conversations.dbstill rejected (protected-paths still applies). - Remove or rewrite the existing
isWithinSkillsDir/agent.skills.enabled-gated cases.
Follow-up
Once this lands and a new CLI is cut:
inference-gateway/infer-action— bumpinputs.version.defaultinaction.ymlto the new CLI release.inference-gateway/.github— bumpcli-versiondefault in the centralized infer workflow (currently v0.116.0) so existing consumers like adl pick up the fix.
[DOCS] ticket: a one-line update to the skills/sandbox doc explaining that skills dirs are read-allowed by default (no flag required).
Metadata
Metadata
Assignees
Type
Projects
- StatusShow more project fieldsDone
Activity
inference-gateway-maintainer commentedon Jun 2, 2026
Todos
Pull Request
#578
✅ Infer Result: Success
Model:
deepseek/deepseek-v4-flash· Exit Code:0· View JobTokens: 1,378,854 in · 14,627 out · 1,393,481 total (27 requests)
Cost: $0.193 in · $0.0041 out · $0.1971 total
Agent output (tail)
Triggered by edenreich · Infer Action
inference-gateway-maintainer commentedon Jun 2, 2026
Todos
Pull Request
#578
✅ Infer Result: Success
Model:
deepseek/deepseek-v4-flash· Exit Code:0· View JobTokens: 2,814,823 in · 17,786 out · 2,832,609 total (50 requests)
Cost: $0.3941 in · $0.005 out · $0.3991 total
Possible matches found:
Near line 617:
Tools: ToolsConfig{
Enabled: true,
Sandbox: SandboxConfig{
Directories: []string{".", "/tmp", ConfigDirName + "/tmp"},
ProtectedPaths: []string{
ConfigDirName + "/",
".git/",
"*.env",
},
},
Near line 809:
Tools: A2AToolsConfig{
QueryAgent: QueryAgentToolConfig{
Enabled: true,
RequireApproval: &[]bool{false}[0],
},
QueryTask: QueryTaskToolConfig{
Enabled: true,
RequireApproval: &[]bool{false}[0],
},
SubmitTask: SubmitTaskToolConfig{
Hint: Earlier edits may have changed the content. Ensure the text still matches exactly after previous modifications.
Tips for fixing this:
Possible matches found:
Near line 554:
func DefaultConfig() Config { //nolint:funlen
return &Config{
ContainerRuntime: ContainerRuntimeConfig{
Type: "docker",
},
Gateway: GatewayConfig{
URL: "http://localhost:8080",
APIKey: "",
Timeout: 200,
OCI: "ghcr.io/inference-gateway/inference-gateway:latest",
Run: true,
StandaloneBinary: true,
IncludeModels: []string{},
ExcludeModels: []string{
"ollama_cloud/cogito-2.1:671b",
"ollama_cloud/kimi-k2:1t",
"ollama_cloud/kimi-k2-thinking",
"ollama_cloud/deepseek-v3.1:671b",
"groq/whisper-large-v3",
"groq/whisper-large-v3-turbo",
"groq/playai-tts",
"groq/playai-tts-arabic",
},
VisionEnabled: true,
},
ClaudeCode: ClaudeCodeConfig{
Enabled: false,
CLIPath: "claude",
Timeout: 600,
MaxOutputTokens: 32000,
ThinkingBudget: 10000,
MaxTurns: 10,
},
SpeechToText: SpeechToTextConfig{
Enabled: false,
Engine: "whisper.cpp",
BinaryPath: "",
Model: "tiny",
ModelsDir: "",
Language: "",
AutoDownload: true,
Timeout: 120,
MaxRecordingSeconds: 30,
SilenceTimeout: 2,
FFmpegPath: "",
InputDevice: "",
},
Client: ClientConfig{
Timeout: 200,
Retry: RetryConfig{
Enabled: true,
MaxAttempts: 3,
InitialBackoffSec: 5,
MaxBackoffSec: 60,
BackoffMultiplier: 2,
RetryableStatusCodes: []int{400, 408, 429, 500, 502, 503, 504},
},
},
Logging: LoggingConfig{
Debug: false,
Dir: "",
Stdout: false,
},
Tools: ToolsConfig{
Enabled: true,
Sandbox: SandboxConfig{
Directories: []string{".", "/tmp", ConfigDirName + "/tmp"},
ProtectedPaths: []string{
ConfigDirName + "/",
".git/",
".env",
},
Hint: Ensure exact whitespace and indentation match. Use the Read tool to see the current file content.
Agent output (tail)
Triggered by edenreich · Infer Action
fix(sandbox): move skills dirs into default Sandbox.Directories uncon…
chore(release): 0.117.1 [skip ci]
inference-gateway-releaser commentedon Jun 2, 2026
🎉 This issue has been resolved in version 0.117.1 🎉
The release is available on GitHub release
Your semantic-release bot 📦🚀