-
Notifications
You must be signed in to change notification settings - Fork 155
docs(registry/coder/modules/agent-firewall): add Codex MCP TLS workaround note #931
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
35C4n0r
wants to merge
3
commits into
main
Choose a base branch
from
35C4n0r/agent-firewall-codex-mcp-note
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.
+44
−5
Open
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -21,7 +21,7 @@ This module: | |
| ```tf | ||
| module "agent-firewall" { | ||
| source = "registry.coder.com/coder/agent-firewall/coder" | ||
| version = "0.0.1" | ||
| version = "0.0.2" | ||
| agent_id = coder_agent.main.id | ||
| } | ||
| ``` | ||
|
|
@@ -40,7 +40,7 @@ network-isolated environment. | |
| ```tf | ||
| module "agent-firewall" { | ||
| source = "registry.coder.com/coder/agent-firewall/coder" | ||
| version = "0.0.1" | ||
| version = "0.0.2" | ||
| agent_id = coder_agent.main.id | ||
| } | ||
|
|
||
|
|
@@ -65,7 +65,7 @@ resource "coder_script" "claude_with_agent_firewall" { | |
| ```tf | ||
| module "agent-firewall" { | ||
| source = "registry.coder.com/coder/agent-firewall/coder" | ||
| version = "0.0.1" | ||
| version = "0.0.2" | ||
| agent_id = coder_agent.main.id | ||
| } | ||
|
|
||
|
|
@@ -82,6 +82,45 @@ resource "coder_app" "claude_with_agent_firewall" { | |
| } | ||
| ``` | ||
|
|
||
| ### With Codex | ||
|
|
||
| Use agent-firewall alongside the `codex` module the same way as other AI modules. | ||
|
Member
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. link to module page here on |
||
|
|
||
| > [!WARNING] | ||
| > **MCP subprocesses and TLS verification** | ||
| > | ||
| > Codex clears the subprocess environment when spawning MCP stdio servers, stripping | ||
| > the CA cert and proxy vars that agent-firewall injects into the Codex process. | ||
| > This causes MCP subprocesses to fail TLS verification against agent-firewall's | ||
| > intercepting proxy. This is a known upstream issue: | ||
| > [openai/codex#29124](https://github.com/openai/codex/issues/29124). | ||
| > | ||
| > **Workaround:** pass the required vars through explicitly via `env_vars` in each | ||
| > `[mcp_servers.*]` block in `~/.codex/config.toml`: | ||
| > | ||
| > ```toml | ||
| > [mcp_servers.memory] | ||
| > command = "npx" | ||
| > args = ["-y", "@modelcontextprotocol/server-memory"] | ||
| > env_vars = ["NODE_EXTRA_CA_CERTS", "HTTPS_PROXY"] | ||
| > ``` | ||
| > | ||
| > This must be repeated for every MCP server. There is no global default in Codex. | ||
| > | ||
| > **All vars agent-firewall injects** (from [`landjail/child.go`](https://github.com/coder/boundary/blob/main/landjail/child.go)): | ||
| > | ||
| > | Variable | Description | | ||
| > | ---------------------------- | ---------------------------------------- | | ||
| > | `NODE_EXTRA_CA_CERTS` | CA cert for Node.js TLS verification | | ||
| > | `SSL_CERT_FILE` | CA cert for OpenSSL/LibreSSL-based tools | | ||
| > | `SSL_CERT_DIR` | CA cert directory for OpenSSL | | ||
| > | `CURL_CA_BUNDLE` | CA cert for curl | | ||
| > | `GIT_SSL_CAINFO` | CA cert for Git | | ||
| > | `REQUESTS_CA_BUNDLE` | CA cert for Python requests | | ||
| > | `HTTPS_PROXY` / `HTTP_PROXY` | Proxy address for HTTPS/HTTP traffic | | ||
| > | `https_proxy` / `http_proxy` | Lowercase aliases for the above | | ||
| > | `NO_PROXY` / `no_proxy` | Cleared to prevent bypassing the proxy | | ||
|
|
||
|
Comment on lines
+110
to
+123
Member
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. It is not clear if the user needs to pass all of them or the two shown in the example above. |
||
| ## Configuration | ||
|
|
||
| The module ships with a comprehensive default config based on the | ||
|
|
@@ -104,7 +143,7 @@ Pass the full YAML content directly: | |
| ```tf | ||
| module "agent-firewall" { | ||
| source = "registry.coder.com/coder/agent-firewall/coder" | ||
| version = "0.0.1" | ||
| version = "0.0.2" | ||
| agent_id = coder_agent.main.id | ||
|
|
||
| agent_firewall_config = <<-YAML | ||
|
|
@@ -128,7 +167,7 @@ your path. The file must exist on disk before agent-firewall starts. | |
| ```tf | ||
| module "agent-firewall" { | ||
| source = "registry.coder.com/coder/agent-firewall/coder" | ||
| version = "0.0.1" | ||
| version = "0.0.2" | ||
| agent_id = coder_agent.main.id | ||
|
|
||
| agent_firewall_config_path = "/workspace/my-agent-firewall-config.yaml" | ||
|
|
||
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.
I see the version has been bumped here to 0.0.2 but in main.tf the version is still 0.0.1 so maybe the version bump script hasn't ran yet. Just wanted to point out the version mismatch