Skip to content

Commit a83328c

Browse files
docs: improve boundary docs (#20806)
Update docs for boundary v0.2.0 release.
1 parent a272843 commit a83328c

File tree

1 file changed

+65
-11
lines changed

1 file changed

+65
-11
lines changed

docs/ai-coder/agent-boundary.md

Lines changed: 65 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -16,32 +16,86 @@ Agent Boundaries offer network policy enforcement, which blocks domains and HTTP
1616

1717
The easiest way to use Agent Boundaries is through existing Coder modules, such as the [Claude Code module](https://registry.coder.com/modules/coder/claude-code). It can also be ran directly in the terminal by installing the [CLI](https://github.com/coder/boundary).
1818

19-
Below is an example of how to configure Agent Boundaries for usage in your workspace.
19+
There are two supported ways to configure Boundary today:
20+
21+
1. **Inline module configuration** – fastest for quick testing.
22+
2. **External `config.yaml`** – best when you need a large allow list or want everyone who launches Boundary manually to share the same config.
23+
24+
### Option 1: Inline module configuration (quick start)
25+
26+
Put every setting directly in the Terraform module when you just want to experiment:
2027

2128
```tf
2229
module "claude-code" {
2330
source = "dev.registry.coder.com/coder/claude-code/coder"
31+
version = "4.1.0"
2432
enable_boundary = true
25-
boundary_version = "main"
26-
boundary_log_dir = "/tmp/boundary_logs"
33+
boundary_version = "v0.2.0"
34+
boundary_log_dir = "/tmp/boundary_logs"
2735
boundary_log_level = "WARN"
28-
boundary_additional_allowed_urls = ["GET *google.com"]
36+
boundary_additional_allowed_urls = ["domain=google.com"]
2937
boundary_proxy_port = "8087"
30-
version = "3.2.1"
3138
}
3239
```
3340

34-
- `boundary_version` defines what version of Boundary is being applied. This is set to `main`, which points to the main branch of `coder/boundary`.
41+
All Boundary knobs live in Terraform, so you can iterate quickly without creating extra files.
42+
43+
### Option 2: Keep policy in `config.yaml` (extensive allow lists)
44+
45+
When you need to maintain a long allow list or share a detailed policy with teammates, keep Terraform minimal and move the rest into `config.yaml`:
46+
47+
```tf
48+
module "claude-code" {
49+
source = "dev.registry.coder.com/coder/claude-code/coder"
50+
version = "4.1.0"
51+
enable_boundary = true
52+
boundary_version = "v0.2.0"
53+
}
54+
```
55+
56+
Then create a `config.yaml` file in your template directory with your policy:
57+
58+
```yaml
59+
allowlist:
60+
- "domain=google.com"
61+
- "method=GET,HEAD domain=api.github.com"
62+
- "method=POST domain=api.example.com path=/users,/posts"
63+
log_dir: /tmp/boundary_logs
64+
proxy_port: 8087
65+
log_level: warn
66+
```
67+
68+
Add a `coder_script` resource to mount the configuration file into the workspace filesystem:
69+
70+
```tf
71+
resource "coder_script" "boundary_config_setup" {
72+
agent_id = coder_agent.dev.id
73+
display_name = "Boundary Setup Configuration"
74+
run_on_start = true
75+
76+
script = <<-EOF
77+
#!/bin/sh
78+
mkdir -p ~/.config/coder_boundary
79+
echo '${base64encode(file("${path.module}/config.yaml"))}' | base64 -d > ~/.config/coder_boundary/config.yaml
80+
chmod 600 ~/.config/coder_boundary/config.yaml
81+
EOF
82+
}
83+
```
84+
85+
Boundary automatically reads `config.yaml` from `~/.config/coder_boundary/` when it starts, so everyone who launches Boundary manually inside the workspace picks up the same configuration without extra flags. This is especially convenient for managing extensive allow lists in version control.
86+
87+
- `boundary_version` defines what version of Boundary is being applied. This is set to `v0.2.0`, which points to the v0.2.0 release tag of `coder/boundary`.
3588
- `boundary_log_dir` is the directory where log files are written to when the workspace spins up.
3689
- `boundary_log_level` defines the verbosity at which requests are logged. Boundary uses the following verbosity levels:
3790
- `WARN`: logs only requests that have been blocked by Boundary
3891
- `INFO`: logs all requests at a high level
3992
- `DEBUG`: logs all requests in detail
40-
- `boundary_additional_allowed_urls`: defines the URLs that the agent can access, in additional to the default URLs required for the agent to work
41-
- `github.com` means only the specific domain is allowed
42-
- `*.github.com` means only the subdomains are allowed - the specific domain is excluded
43-
- `*github.com` means both the specific domain and all subdomains are allowed
44-
- You can also also filter on methods, hostnames, and paths - for example, `GET,HEAD *github.com/coder`.
93+
- `boundary_additional_allowed_urls`: defines the URLs that the agent can access, in addition to the default URLs required for the agent to work. Rules use the format `"key=value [key=value ...]"`:
94+
- `domain=github.com` - allows the domain and all its subdomains
95+
- `domain=*.github.com` - allows only subdomains (the specific domain is excluded)
96+
- `method=GET,HEAD domain=api.github.com` - allows specific HTTP methods for a domain
97+
- `method=POST domain=api.example.com path=/users,/posts` - allows specific methods, domain, and paths
98+
- `path=/api/v1/*,/api/v2/*` - allows specific URL paths
4599

46100
You can also run Agent Boundaries directly in your workspace and configure it per template. You can do so by installing the [binary](https://github.com/coder/boundary) into the workspace image or at start-up. You can do so with the following command:
47101

0 commit comments

Comments
 (0)