feat: provide boundary support for agent modules#780
Conversation
|
@matifali @zedkipp @evgeniy-scherbina I believe this is now ready for review, if I have missed anything in the code or as part of the contributing process please just let me know and I will resolve, this is my first contribution. Also, I was thinking it might be better to remove the Codex changes, and implement those in a separate PR once the new version of AgentAPI with the changes is released. But I will wait for your guidance before proceeding on that. Thanks! |
|
@shanewhite97 We made some changes to how Codex starts in #781. Would be nice to take a look and rebase on |
|
@matifali yh I saw those, I think I will remove them out of this PR to keep things simple. Let me do that now. I will also try to resolve the other pipeline errors |
There was a problem hiding this comment.
Pull request overview
Adds optional Coder Boundary network filtering support to the shared agentapi module and wires it through to the Codex module so the Codex CLI can be executed behind boundary (nsjail/landjail), with documentation for how to enable it.
Changes:
- Add new Terraform inputs (
enable_boundary,boundary_jail_type,boundary_proxy_port,boundary_config_path) to theagentapimodule and pass them into the runtime script. - Implement boundary setup in
agentapi’smain.sh(config generation + exported wrapper) and update Codex start logic to invoke Codex via the wrapper when present. - Bump the Codex module’s dependency on
coder/agentapito2.2.0and document boundary usage in the Codex README.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
registry/coder/modules/agentapi/scripts/main.sh |
Adds boundary setup (config + exported wrapper) prior to running the module’s start script. |
registry/coder/modules/agentapi/main.tf |
Adds boundary-related variables and passes them as script args into main.sh. |
registry/coder-labs/modules/codex/scripts/start.sh |
Wraps the Codex invocation with BOUNDARY_WRAPPER when boundary is enabled. |
registry/coder-labs/modules/codex/main.tf |
Exposes boundary variables and forwards them to the agentapi module; bumps agentapi module version. |
registry/coder-labs/modules/codex/README.md |
Documents how to enable Boundary network filtering for Codex. |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
|
@matifali I have added some changes based on the feedback, if you could run another review that would be appreciated :) |
…ent-api-boundary-support
…shanewhite97/registry into feat/agent-api-boundary-support
…y the boundary config, renamed BOUNDARY_PREFIX to AGENTAPI_BOUNDARY_PREFIX
Yes, the plan is to centralise the boundary bits. This way any of the modules can use/enable it with minimal changes. |
|
@shanewhite97 can you also raise a PR for codex to use boundary ? This way we can validate both the codex PR and the agentapi PR and make sure everything works perfectly. when you make the PR for codex, you can use these agentapi changes (temporarily) in the same way I have done here: https://github.com/coder/registry/pull/705/changes#diff-e7adc2da34facfd5d16deb23876fca7ae4cb11c8a68a0cfbe37a044bb69932f0R358-R361 |
Co-authored-by: 35C4n0r <70096901+35C4n0r@users.noreply.github.com>
Co-authored-by: 35C4n0r <70096901+35C4n0r@users.noreply.github.com>
|
Codex PR created: |
|
@shanewhite97 can you run this script and push
|
|
@35C4n0r Is it normal for that script to pick up changes from a load of other modules? |
No it shouldn't do that, anyhow just push the readme update for the agentapi module. |
|
@35C4n0r Roger, that is done now :) |
35C4n0r
left a comment
There was a problem hiding this comment.
Just one minor change, otherwise LGTM.
Co-authored-by: 35C4n0r <70096901+35C4n0r@users.noreply.github.com>
|
@35C4n0r Accepted your change |
|
@35C4n0r @matifali I don't have merge permissions it seems. When merging, please can you squash the commits with the following message: feat: provide boundary support for agent modules Enable any agent module to run its AI agent inside Coder's Agent Boundaries. Users must provide a boundary config.yaml with their allowlist and |
…ule (#795) ## Description Adds boundary support to the Codex module by passing boundary variables through to the agentapi module and using AGENTAPI_BOUNDARY_PREFIX in the start script. Depends on #780 ## Type of Change - [x] Feature/enhancement ## Module Information **Path:** `registry/coder-labs/modules/codex` **Breaking change:** No --------- Co-authored-by: Shane White <shane.white@cloudsecure.ltd> Co-authored-by: 35C4n0r <70096901+35C4n0r@users.noreply.github.com>




Description
Enable any agent module to run its AI agent inside Coder's Agent Boundaries.
The agentapi module handles boundary installation, config setup, and wrapper
script creation, then exports AGENTAPI_BOUNDARY_PREFIX for consuming modules
to use in their start scripts.
Supports three boundary installation modes:
Users must provide a boundary config.yaml with their allowlist and
settings when enabling boundary.
Closes #457
Type of Change
Module Information
Path:
registry/coder/modules/agentapiBreaking change: No
Testing & Validation
bun test)bun fmt)