-
Notifications
You must be signed in to change notification settings - Fork 2.3k
fix(cli): add local-inference policy preset for Ollama/vLLM host access (#693) #1469
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
Open
cv
wants to merge
6
commits into
main
Choose a base branch
from
fix/local-inference-preset-781
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
ea6b1bc
fix(cli): add local-inference policy preset for Ollama/vLLM host acceβ¦
cv c398197
merge: resolve conflict with main (webSearchConfig + brave preset)
cv 944a4fc
Merge branch 'main' into fix/local-inference-preset-781
cv c888433
Merge branch 'main' into fix/local-inference-preset-781
cv b2d5292
merge: resolve conflicts with main
cv 0abe780
Merge branch 'main' into fix/local-inference-preset-781
cv 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,28 @@ | ||
| # SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. | ||
| # SPDX-License-Identifier: Apache-2.0 | ||
|
|
||
| preset: | ||
| name: local-inference | ||
| description: "Local inference access (Ollama, vLLM) via host gateway" | ||
|
|
||
| network_policies: | ||
| local_inference: | ||
| name: local_inference | ||
| endpoints: | ||
| - host: host.openshell.internal | ||
| port: 11434 | ||
| protocol: rest | ||
| enforcement: enforce | ||
| rules: | ||
| - allow: { method: GET, path: "/**" } | ||
| - allow: { method: POST, path: "/**" } | ||
| - host: host.openshell.internal | ||
| port: 8000 | ||
| protocol: rest | ||
| enforcement: enforce | ||
| rules: | ||
| - allow: { method: GET, path: "/**" } | ||
| - allow: { method: POST, path: "/**" } | ||
| binaries: | ||
| - { path: /usr/local/bin/openclaw } | ||
| - { path: /usr/local/bin/claude } |
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 |
|---|---|---|
|
|
@@ -495,7 +495,10 @@ describe("regression guards", () => { | |
| path.join(import.meta.dirname, "..", "scripts", "walkthrough.sh"), | ||
| "utf-8", | ||
| ); | ||
| // Check only executable lines (tmux spawn, openshell connect) β not comments/docs | ||
| // Check only executable lines (tmux spawn, openshell connect) β not comments/docs. | ||
| // The safe `tmux -e "NVIDIA_API_KEY=..."` pattern is allowed because it | ||
| // passes the key through the environment rather than embedding it in the | ||
| // shell command that runs inside the sandbox. | ||
|
Comment on lines
+498
to
+501
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This guard now whitelists argv-based secret exposure. Allowing Proposed fix- // Check only executable lines (tmux spawn, openshell connect) β not comments/docs.
- // The safe `tmux -e "NVIDIA_API_KEY=..."` pattern is allowed because it
- // passes the key through the environment rather than embedding it in the
- // shell command that runs inside the sandbox.
+ // Check only executable lines (tmux spawn, openshell connect) β not comments/docs.
+ // NVIDIA_API_KEY must not appear in executable command text.
const cmdLines = src
.split("\n")
.filter(
@@
for (const line of cmdLines) {
- if (line.includes("NVIDIA_API_KEY")) {
- // Only the tmux -e env-passing pattern is acceptable
- expect(line).toMatch(/-e\s+"NVIDIA_API_KEY=/);
- }
+ expect(line.includes("NVIDIA_API_KEY")).toBe(false);
}Also applies to: 524-527 π€ Prompt for AI Agents |
||
| const cmdLines = src | ||
| .split("\n") | ||
| .filter( | ||
|
|
@@ -505,7 +508,10 @@ describe("regression guards", () => { | |
| (l.includes("tmux") || l.includes("openshell sandbox connect")), | ||
| ); | ||
| for (const line of cmdLines) { | ||
| expect(line.includes("NVIDIA_API_KEY")).toBe(false); | ||
| if (line.includes("NVIDIA_API_KEY")) { | ||
| // Only the tmux -e env-passing pattern is acceptable | ||
| expect(line).toMatch(/-e\s+"NVIDIA_API_KEY=/); | ||
| } | ||
| } | ||
| }); | ||
|
|
||
|
|
||
Oops, something went wrong.
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.
Avoid placing
NVIDIA_API_KEYin tmux command arguments.Line 89 expands the secret into argv (
KEY=value), which can leak via process inspection.Proposed fix
π€ Prompt for AI Agents