Repository navigation
Description
Summary
Move the tools: section out of config.yaml into a userspace-only ~/.infer/tools.yaml that infer's file tools and infer config set never write, the same way sandbox.yaml already works. Today every approval knob lives in config.yaml: tools.safety.*, each tool's require_approval, and tools.bash.mode.<mode>.allow. config.yaml sits in the config dir, which the default sandbox only guards with on_violation: approval, so a single approved Write (or any infer config set tools.bash.mode.default.allow ... run through the Bash tool, which never hits ValidateWrite) lets the agent allow-list its own commands. A project .infer/config.yaml can widen approvals for whoever opens the repo for the same reason.
This is the first prerequisite of the /config skill (#1499): once the agent is allowed to edit config.yaml on request, nothing that decides WHETHER a tool needs approval may remain in that file.
Split out of #1499. Sibling prerequisite: #1502 (config reload in chat).
Proposed shape
config/tools.go:ToolsFileName = "tools.yaml",DefaultToolsConfig,LoadToolsviaconfigutils.LoadYAMLMerged,UserToolsPath()returning~/.infer/tools.yaml. Mirrorconfig/sandbox.go, not a new pattern.Config.Toolsbecomesyaml:"-" mapstructure:"-", loaded incmd/runtime/config.gonext toloadSandboxConfigfrom the userspace path only (no project copy, nosidecarPathlookup).Tools.Sandboxkeeps its own file.sandbox.ValidateWriterefuses the file unconditionally, next to theisSandboxPolicyFilecheck (generalize that helper to a list of protected policy files rather than adding a second copy).infer config get/setrejecttools.*keys with a message namingtools.yaml;resolveConfigKeyKindalready walks the struct, so dropping the field fromConfigyaml tags should make the key unknown for free. Verify, and add a clearer error than "unknown config key".INFER_TOOLS_*env overrides keep working (applySidecarEnv(&cfg.Tools, "tools")).infer initseeds the defaulttools.yamlthe same way it seedssandbox.yaml. Atools:key inconfig.yamlis simply ignored, with no migration and no warning, since the CLI is pre-stable.- Docs:
docs/configuration-reference.md,docs/tool-approval.md,docs/directory-structure.md, and theinfer config sethelp text.
Open question
Whole tools: section vs only the approval knobs. Recommended: the whole section. Splitting tools.bash.timeout from tools.bash.require_approval across two files is more code and more surprise than making tools.* restart-only, and sandbox.yaml already set the precedent that security-relevant tool settings are not agent-editable.
Acceptance Criteria
-
tools.yamlis read from~/.infer/only. A project.infer/tools.yamland atools:key in anyconfig.yamlhave no effect. -
Write,Edit,MultiEdit,Deleteand the Bash path gate refuse~/.infer/tools.yamlregardless of sandbox rules or granted approvals, with the same message style assandbox.yaml. -
infer config set tools.<anything>fails with an error namingtools.yaml;infer config get tools.bashstill prints the effective value. -
infer initseedstools.yamlfrom the defaults, and--overwriteregenerates it likesandbox.yaml. -
INFER_TOOLS_*overrides behave as before;go test ./...and the golden tool-definition tests pass. - Docs updated.
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsDone
Activity
edenreich commentedon Oct 2, 2026
@infer can you work on this? use /cobra-viper /go
inference-gateway-maintainer commentedon Oct 2, 2026
Model:
ollama_cloud/glm-5.3-flash· View JobTodos
Pull Request
#1507
❌ Infer Result: Failed
Tests green. Let me commit increment 2:
Model:
ollama_cloud/glm-5.3-flash· Exit Code:1· Duration: 14m 22sTokens: 12,399,720 in · 72,086 out · 12,471,806 total (71 requests)
Tool calls: 99 total · 100% success rate
Traces
Stats
Triggered by edenreich · Infer Action · OSS
fix: resolve #1501
inference-gateway-releaser commentedon Oct 3, 2026
🎉 This issue has been resolved in version 0.223.0 🎉
The release is available on:
Your semantic-release bot 📦🚀