Skip to content

Commit be685d6

Browse files
maruiz93claude
andcommitted
fix: remove allowed_ips from host-side API server policies
Per NVIDIA/OpenShell#1560, allowed_ips is no longer required when endpoints are explicitly declared with host+port in the policy. Validated by creating a sandbox with the updated policy and curling both host servers (builder :9090, provisioner :9091) successfully. - Remove allowed_ips from full-access and restricted policies - Remove HOST_IP resolution and policy template rendering from run.sh - Point harness files to raw policy files instead of rendered ones - Add required role field to all harness files (new fullsend requirement) Refs: NVIDIA/OpenShell#1633 Co-Authored-By: Claude Opus 4.6 <[email protected]> Signed-off-by: Marta Anon <[email protected]>
1 parent bafeb37 commit be685d6

10 files changed

Lines changed: 36 additions & 43 deletions

‎host-side-api-server/README.md‎

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,28 @@ See [HOW_TO.md](HOW_TO.md).
3232
- **Repo provisioner depends on OpenShell#1272**: if content inspection hooks
3333
ship in OpenShell, the scan-before-copy flow could be handled natively
3434

35+
## Changelog
36+
37+
### 2026-07-16: Remove `allowed_ips` requirement
38+
39+
OpenShell maintainer [johntmyers confirmed](https://github.com/NVIDIA/OpenShell/issues/1633#issuecomment-1)
40+
that PR [NVIDIA/OpenShell#1560](https://github.com/NVIDIA/OpenShell/pull/1560) removed
41+
the `allowed_ips` requirement when endpoints are explicitly declared with host+port in
42+
the policy. Validated locally on OpenShell v0.0.83 (rootless Podman + pasta, Fedora 44):
43+
44+
- Both builder (`:9090`) and provisioner (`:9091`) reachable from sandbox without `allowed_ips`
45+
- Undeclared endpoints still blocked by the proxy
46+
47+
Changes:
48+
- Removed `allowed_ips: ["{{HOST_IP}}/32"]` from both policies
49+
- Removed HOST_IP resolution and policy template rendering from `run.sh`
50+
- Harness files now reference raw policies directly (no rendered copies)
51+
- Added `role: experiment` to all harness files (required by current fullsend)
52+
53+
Servers still bind to `0.0.0.0` — the remaining motivation for
54+
[NVIDIA/OpenShell#1633](https://github.com/NVIDIA/OpenShell/issues/1633) (`host.local`
55+
supervisor-proxied endpoints) is eliminating `0.0.0.0` binding in favor of `127.0.0.1`.
56+
3557
## Findings
3658

3759
See [results/findings.md](results/findings.md) (populated after running).

‎host-side-api-server/harness/baked-instructions-full.yaml‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
agent: agents/test-agent.md
2+
role: experiment
23
model: opus
3-
policy: policies/rendered-full-access.yaml
4+
policy: policies/full-access.yaml
45

56
providers:
67
- api-server

‎host-side-api-server/harness/baked-instructions-restricted.yaml‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
agent: agents/test-agent.md
2+
role: experiment
23
model: opus
3-
policy: policies/rendered-restricted.yaml
4+
policy: policies/restricted.yaml
45

56
providers:
67
- api-server

‎host-side-api-server/harness/openapi-discovery-full.yaml‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
agent: agents/test-agent.md
2+
role: experiment
23
model: opus
3-
policy: policies/rendered-full-access.yaml
4+
policy: policies/full-access.yaml
45

56
providers:
67
- api-server

‎host-side-api-server/harness/openapi-discovery-restricted.yaml‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
agent: agents/test-agent.md
2+
role: experiment
23
model: opus
3-
policy: policies/rendered-restricted.yaml
4+
policy: policies/restricted.yaml
45

56
providers:
67
- api-server

‎host-side-api-server/harness/tooluse-discovery-full.yaml‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
agent: agents/test-agent.md
2+
role: experiment
23
model: opus
3-
policy: policies/rendered-full-access.yaml
4+
policy: policies/full-access.yaml
45

56
providers:
67
- api-server

‎host-side-api-server/harness/tooluse-discovery-restricted.yaml‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
agent: agents/test-agent.md
2+
role: experiment
23
model: opus
3-
policy: policies/rendered-restricted.yaml
4+
policy: policies/restricted.yaml
45

56
providers:
67
- api-server

‎host-side-api-server/policies/full-access.yaml‎

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,6 @@ network_policies:
4848
- allow:
4949
method: GET
5050
path: /tools.json
51-
allowed_ips:
52-
- "{{HOST_IP}}/32"
5351
binaries:
5452
- path: "**/curl"
5553
provisioner:
@@ -72,7 +70,5 @@ network_policies:
7270
- allow:
7371
method: GET
7472
path: /tools.json
75-
allowed_ips:
76-
- "{{HOST_IP}}/32"
7773
binaries:
7874
- path: "**/curl"

‎host-side-api-server/policies/restricted.yaml‎

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,6 @@ network_policies:
3434
- allow:
3535
method: POST
3636
path: /build
37-
allowed_ips:
38-
- "{{HOST_IP}}/32"
3937
binaries:
4038
- path: "**/curl"
4139
provisioner:
@@ -52,7 +50,5 @@ network_policies:
5250
- allow:
5351
method: GET
5452
path: /repo/status/*
55-
allowed_ips:
56-
- "{{HOST_IP}}/32"
5753
binaries:
5854
- path: "**/curl"

‎host-side-api-server/run.sh‎

Lines changed: 2 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,6 @@ cleanup() {
6565
[[ -n "$PROVISIONER_PID" ]] && kill "$PROVISIONER_PID" 2>/dev/null && wait "$PROVISIONER_PID" 2>/dev/null && echo "Stopped provisioner (pid $PROVISIONER_PID)"
6666
openshell provider delete api-server 2>/dev/null && echo "Deleted provider api-server" || true
6767
rm -f "$ENV_FILE"
68-
rm -f policies/rendered-full-access.yaml policies/rendered-restricted.yaml
6968
echo "Cleanup done."
7069
}
7170
trap cleanup EXIT
@@ -91,28 +90,6 @@ API_TOKEN="$(uuidgen)"
9190
echo "=== Host-Side API Server Experiment ==="
9291
echo "Harness: $HARNESS_NAME"
9392

94-
# ---------------------------------------------------------------------------
95-
# Resolve host IP (needed before starting servers for bind address)
96-
# ---------------------------------------------------------------------------
97-
98-
HOST_IP=""
99-
if out=$(getent hosts host.openshell.internal 2>/dev/null); then
100-
HOST_IP=$(echo "$out" | awk '{print $1}')
101-
echo "Host IP (via host.openshell.internal): $HOST_IP"
102-
fi
103-
104-
if [[ -z "$HOST_IP" ]]; then
105-
HOST_IP=$(podman network inspect podman 2>/dev/null | python3 -c "import sys,json; print(json.load(sys.stdin)[0]['subnets'][0]['gateway'])" 2>/dev/null)
106-
if [[ -n "$HOST_IP" ]]; then
107-
echo "Host IP (via podman bridge gateway): $HOST_IP"
108-
fi
109-
fi
110-
111-
if [[ -z "$HOST_IP" ]]; then
112-
echo "ERROR: Could not resolve host IP"
113-
exit 1
114-
fi
115-
11693
# ---------------------------------------------------------------------------
11794
# Start API servers (bound to all interfaces — rootless Podman can't bind to
11895
# the bridge gateway IP since it lives inside the container namespace)
@@ -158,14 +135,10 @@ for port in 9090 9091; do
158135
done
159136

160137
# ---------------------------------------------------------------------------
161-
# Render policies
138+
# Policies (no rendering needed — allowed_ips removed per #1560)
162139
# ---------------------------------------------------------------------------
163140

164-
echo "Rendering policies..."
165-
sed "s/{{HOST_IP}}/$HOST_IP/g" policies/full-access.yaml > policies/rendered-full-access.yaml
166-
sed "s/{{HOST_IP}}/$HOST_IP/g" policies/restricted.yaml > policies/rendered-restricted.yaml
167-
echo " policies/rendered-full-access.yaml"
168-
echo " policies/rendered-restricted.yaml"
141+
echo "Using policies directly (no HOST_IP templating needed)."
169142

170143
# ---------------------------------------------------------------------------
171144
# Generate env file (server URLs only — token is handled by provider)

0 commit comments

Comments
 (0)