-
Notifications
You must be signed in to change notification settings - Fork 554
feat: add AllowAllKeys flag and fix virtual key config semantics #2008
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Pratham-Mishra04
wants to merge
1
commit into
graphite-base/2008
from
03-10-fix_backwards_compact_with_config.json_loading_for_vk_changes
Closed
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| package tables | ||
|
|
||
| import "github.com/maximhq/bifrost/core/schemas" | ||
|
|
||
| var logger schemas.Logger | ||
|
|
||
| // SetLogger sets the logger for the tables package. | ||
| func SetLogger(l schemas.Logger) { | ||
| logger = l | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,30 @@ | ||
| - feat: VK provider config key_ids now supports ["*"] wildcard to allow all keys; empty key_ids denies all; handler resolves wildcard to AllowAllKeys flag without DB key lookups | ||
| - feat: add option to disable automatic MCP tool injection per request | ||
| - feat: virtual key MCP configs now act as an execution-time allow-list — tools not permitted by the VK are blocked at inference and MCP tool execution | ||
|
|
||
| ## BREAKING CHANGES — explicit empty arrays now mean deny-all; absent inner fields now mean allow-all | ||
|
|
||
| The following fields in `governance.virtual_keys[*]` in config.json have changed semantics: | ||
|
|
||
| | Field | Old behaviour | New behaviour | Type | | ||
| |---|---|---|---| | ||
| | `provider_configs: []` | allow all providers | **deny all providers** | breaking | | ||
| | `provider_configs` absent | allow all providers | allow all providers — deprecated, see below | deprecated | | ||
| | `provider_configs[*].allowed_keys: []` | allow all keys | **deny all keys** | breaking | | ||
| | `provider_configs[*].allowed_keys` absent | deny all keys (bug) | **allow all keys** — deprecated, see below | breaking + deprecated | | ||
| | `mcp_configs: []` | allow all MCP clients | **deny all MCP clients** | breaking | | ||
| | `mcp_configs` absent | allow all MCP clients | allow all MCP clients — deprecated, see below | deprecated | | ||
| | `mcp_configs[*].tools_to_execute: []` | deny all tools | deny all tools | unchanged | | ||
| | `mcp_configs[*].tools_to_execute` absent | deny all tools (bug) | **allow all tools** — deprecated, see below | breaking + deprecated | | ||
|
|
||
| ### Migration guide | ||
|
|
||
| **`provider_configs: []` / `mcp_configs: []`** — previously allowed all; now deny all. To keep allow-all behaviour, list entries explicitly instead of using an empty array. | ||
|
|
||
| **`provider_configs[*].allowed_keys` absent** — previously (buggy) denied all keys; now allows all keys and emits a deprecation warning. If you intended deny-all, add `allowed_keys: []` explicitly. If you intended allow-all, add `allowed_keys: ["*"]` to silence the warning. | ||
|
|
||
| **`mcp_configs[*].tools_to_execute` absent** — previously (buggy) denied all tools for that client; now allows all tools and emits a deprecation warning. If you intended deny-all, add `tools_to_execute: []` explicitly. If you intended allow-all, add `tools_to_execute: ["*"]` to silence the warning. | ||
|
|
||
| ### Deprecation notice | ||
|
|
||
| Omitting `provider_configs`, `mcp_configs`, `allowed_keys`, or `tools_to_execute` entirely (absent key) currently defaults to allow-all and emits a startup warning. For `provider_configs` and `mcp_configs`, the implicit allow-all expands to whichever providers / MCP clients are present at startup — it is a boot-time snapshot, not a live wildcard. **This implicit allow-all will be removed in the next major version** — absent and `[]` will both mean deny-all (deny-by-default). Migrate by always specifying these fields explicitly in config.json. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
🏁 Script executed:
Repository: maximhq/bifrost
Length of output: 1008
🏁 Script executed:
Repository: maximhq/bifrost
Length of output: 6880
🏁 Script executed:
Repository: maximhq/bifrost
Length of output: 1501
🏁 Script executed:
Repository: maximhq/bifrost
Length of output: 913
🏁 Script executed:
Repository: maximhq/bifrost
Length of output: 245
🏁 Script executed:
Repository: maximhq/bifrost
Length of output: 115
🏁 Script executed:
Repository: maximhq/bifrost
Length of output: 10559
🏁 Script executed:
Repository: maximhq/bifrost
Length of output: 3996
🏁 Script executed:
Repository: maximhq/bifrost
Length of output: 121
🏁 Script executed:
Repository: maximhq/bifrost
Length of output: 733
🏁 Script executed:
Repository: maximhq/bifrost
Length of output: 3072
🏁 Script executed:
Repository: maximhq/bifrost
Length of output: 27179
🏁 Script executed:
Repository: maximhq/bifrost
Length of output: 118
🏁 Script executed:
Repository: maximhq/bifrost
Length of output: 50372
🏁 Script executed:
Repository: maximhq/bifrost
Length of output: 116
🏁 Script executed:
Repository: maximhq/bifrost
Length of output: 1824
🏁 Script executed:
Repository: maximhq/bifrost
Length of output: 1167
Initialize the tables logger to a safe default or add nil checks before logging calls.
loggeris an uninitialized package-global variable. TheUnmarshalJSONmethods invirtualkey.go(lines 89, 231) calllogger.Warn()unconditionally without nil guards. Any code that unmarshals virtual key configs beforetables.SetLogger()runs will panic on a nil interface method call. While the HTTP transport callstables.SetLogger()before bootstrap, other entry points (governance plugin, oauth2 framework, modelcatalog) may load configs without wiring the logger. Initialize this package logger to a no-op default implementation, or guard all logger calls with nil checks.🤖 Prompt for AI Agents