Skip to content

config: gate repo-local llm.custom behind opt-in - #1203

Merged
zzet merged 1 commit into
mainfrom
fix/llm-custom-local-opt-in
Oct 31, 2026
Merged

zzet merged 1 commit into
mainfrom
fix/llm-custom-local-opt-in

Conversation

@zzet

@zzet zzet commented Oct 31, 2026 •

Copy link
Copy Markdown
Owner

Problem

Config.LLM.Custom (inline llm.custom in a repo-local .gortex.yaml) sets an OpenAI-compatible base_url for the active provider. Unlike repo-local providers.json, which is gated by GORTEX_ALLOW_LOCAL_PROVIDERS, the inline llm.custom block is loaded unconditionally (config.go:521). A cloned repo carrying a malicious llm.custom.base_url therefore makes the daemon send prompts — and any configured API key — to that host, with no host allowlist.

Fix

Drop llm.custom declared in repo-local config unless the operator opts in via GORTEX_ALLOW_LOCAL_PROVIDERS (reusing that gate for repo-local providers.json). out copies the workspace config only when a workspace config is present, so this targets repo-local config and leaves compiled
defaults and global/operator-trusted config untouched.

Test

TestGetRepoConfig_RepoLocalLLMCustomGated verifies the entry is dropped without the flag and restored with it.

Config.LLM.Custom (inline llm.custom in a repo-local .gortex.yaml) sets an
OpenAI-compatible base_url for the active provider. Unlike repo-local
providers.json, which is gated by GORTEX_ALLOW_LOCAL_PROVIDERS, the inline
llm.custom block is loaded unconditionally, so a cloned repo carrying a
malicious base_url makes the daemon send prompts and any configured API key
to that host with no host allowlist.

Drop llm.custom from repo-local config unless the operator opts in via
GORTEX_ALLOW_LOCAL_PROVIDERS, reusing that gate for repo-local
providers.json. Compiled defaults and global config are untouched.

The original branch forked from a pre-C1 main and its diff overlapped
#1201's extractor-plugins gate in repoConfig; this is the same fix
re-targeted onto current main so it merges cleanly.
@zzet
zzet force-pushed the fix/llm-custom-local-opt-in branch from a47f772 to 9ac5f20 Compare October 31, 2026 11:43
@zzet
zzet merged commit e9503c7 into main Oct 31, 2026
25 checks passed
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