Uh oh!
There was an error while loading. Please reload this page.
feat(coder/modules/boundary): add agent-firewall module - #840
Conversation
There was a problem hiding this comment.
Pull request overview
Adds a new coder/boundary registry module intended to set up Boundary-related tooling for Coder workspaces.
Changes:
- Introduces a Boundary install/setup shell script that can compile from source, install from release, or rely on
coder boundary. - Adds a Terraform module (
main.tf) that deploys and runs the install script on an agent. - Adds module README and Terraform native tests (
.tftest.hcl).
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 7 comments.
| File | Description |
|---|---|
registry/coder/modules/boundary/scripts/install.sh | Installs Boundary (or validates coder boundary) and generates a wrapper script. |
registry/coder/modules/boundary/main.tf | Defines module variables and a coder_script to deliver/execute install.sh. |
registry/coder/modules/boundary/README.md | Documents module usage and examples. |
registry/coder/modules/boundary/boundary.tftest.hcl | Adds Terraform plan-time assertions for basic module wiring. |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
…lation and execution
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
…missing mock support Three root causes: 1. boundary_script_destination used 'install.sh' - same filename that coder-utils writes to. This caused the running script to overwrite itself, corrupting bash's incremental read and producing empty install.log / no wrapper. Fix: rename to 'boundary-install.sh'. 2. coder-mock.sh didn't handle 'coder exp sync' commands used by coder-utils for script ordering. With set -o errexit, scripts failed immediately. Fix: add exp sync as no-op (exit 0). 3. Test setup used setupUtil which only extracts ONE coder_script, but coder-utils creates multiple (pre_install, install, post_install). Fix: extract all coder_scripts from terraform state and run them sequentially in lifecycle order. 4. wrapper-script-execution test called 'wrapper.sh --help' which the mock couldn't handle after the '--' separator (tried to exec '--help'). Fix: test with 'echo boundary-test' instead.
The boundary command (both 'coder boundary' and standalone 'boundary') expects a '--' separator before the command to execute. The wrapper scripts were passing arguments directly without this separator, causing the wrapper-script-execution test to fail. 🤖 Generated by Coder Agents
This reverts commit 81df58f.
The boundary wrapper scripts pass arguments directly without a '--' separator. Updated the coder mock to match this behavior and adjusted the test comment accordingly. 🤖 Generated by Coder Agents
DevelopmentCats
commented
May 7, 2026
Reviewing and testing this morning. |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
…n config at runtime - Rename all public input variables: boundary_* -> agent_firewall_* - Rename outputs: boundary_wrapper_path -> agent_firewall_wrapper_path, boundary_config_path -> agent_firewall_config_path - Set log_dir to $HOME/.coder-modules/coder/boundary/logs/boundary_logs in default config template - Expand $HOME in config content via sed at runtime before writing to disk, so the config contains absolute paths - Internals (locals, template vars, script logic) unchanged
This comment was marked as duplicate.
This comment was marked as duplicate.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
matifali
commented
May 7, 2026
Lets rename the module path to |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
f58688c to
f255d6cCompareUh oh!
There was an error while loading. Please reload this page.
Description
Extracts boundary installation and wrapper logic into a standalone
coder/agent-firewallmodule, decoupling it fromagentapi.Why
Boundary is currently embedded inside
agentapi(scripts/boundary.sh) and duplicated inclaude-code. This couples network isolation to the AI/Tasks stack, but boundary is a general-purpose primitive — users running a plain agent with no agentapi or tasks should be able to use it too.What this adds
registry/coder/modules/agent-firewall/— a new first-class module that:coder boundarysubcommand (default, zero-install)use_agent_firewall_directly = true)compile_agent_firewall_from_source = true)data.coder_workspace.me.access_urlagent_firewall_config) or external file (agent_firewall_config_path), mutually exclusive with cross-variable validation$HOME/.coder-modules/coder/agent-firewall/scripts/agent-firewall-wrapper.shCAP_NET_ADMINfrom the coder binary (copies tocoder-no-caps) to allow execution inside network namespaces withoutsys_adminpre_install_script/post_install_scripthooksagent_firewall_wrapper_path,agent_firewall_config_path, andscriptsoutputs for script coordinationUsage
Works standalone with any agent — no agentapi dependency required.
Testing
agent-firewall.tftest.hcl): default outputs, compile from source, use directly, custom hooks, custom module directory, inline config, external config path, mutual exclusion validationmain.test.ts): state verification, coder subcommand happy path, inline config, config path skip, custom hooks, env var absence, wrapper execution, idempotent installationType of Change
Module Information
Path:
registry/coder/modules/agent-firewallNew version:
v0.0.1Breaking change: No
Related Issues
Closes#844
🤖 Generated by Coder Agents