Repository navigation
Closed
Labels
kind/bugSomething isn't working
Description
Describe the bug
Comments on the sandbox policy deployments/openshell/agents/claude-sdk-agent/policy-data.yaml indicate it can be used to enable sandbox-to-in-cluster communication, but it can't.
For example, curl httpbin.team1.svc.cluster.local:8080/status/418 is denied.
Steps To Reproduce
openshell sandbox create --policy deployments/openshell/agents/claude-sdk-agent/policy-data.yaml --name try-sandbox -- bash- (in second window)
openshell sandbox get try-sandbox --policy-only - (in second window)
oc -n team1 logs try-sandbox -f | grep DENIED - (in OpenShell window)
curl httpbin.team1.svc.cluster.local:8080/status/418- receive
{"detail":"GET httpbin.team1.svc.cluster.local:8080/status/418 not permitted by policy","error":"policy_denied"} - logged
OCSF HTTP:GET [MED] DENIED -(0) -> GET http://httpbin.team1.svc.cluster.local:8080/status/418 [policy:- engine:opa] [reason:FORWARD denied GET httpbin.team1.svc.cluster.local:8080/status/418]
- receive
- (in OpenShell window)
curl httpbin.team1:8080/status/418- receive
{"detail":"GET httpbin.team1:8080/status/418 not permitted by policy","error":"policy_denied"} - logged
CSF HTTP:GET [MED] DENIED -(0) -> GET http://httpbin.team1:8080/status/418 [policy:- engine:opa] [reason:FORWARD denied GET httpbin.team1:8080/status/418]
- receive
Expected Behavior
A policy for in-cluster communications should be provided, and it should allow in-cluster communications.
Additional Context
- Sandboxes start with an
$HTTP_PROXYbut I have this problem either way. - Adding explicit entries for hosts I wish to make available, such as
otel-collector.kagenti-system.svc.cluster.local, also fail, so the problem is not wildcards. - The rules in deployments/openshell/agents/claude-sdk-agent/policy-data.yaml seem wrong, the refer to
"*.svc.cluster.local"not"**.svc.cluster.local" - Note that there doesn't need to be a running httpbin service in the cluster to reproduce the problem -- outbound is blocked for any hostname with the same message.
- Note that the endpoint
*.team1will prevent the shell from even starting -- OpenShell treats "team1" as a TLD, which is confusing.
Metadata
Metadata
Assignees
Labels
kind/bugSomething isn't working
Type
Projects
- StatusShow more project fieldsDone
Activity
esnible commentedon May 22, 2026
Note that https://github.com/kagenti/OpenShell provides many tests, but no native OPA tests, no *_test.rego files, no
opa test --coverage, making it hard to determine which OPA files are blocking the traffic.To test this issue, I removed all the internal rules and added a policy specific to this issue:
This shows that even with zero endpoint wildcards and a binary wildcard, policy is blocked in the same way with the same message.
Without OPA tests, it feels difficult to maintain them, and to ask Claude how to fix policy YAML to allow the desired traffic.
Ladas commentedon May 27, 2026
This directly affects our PR #1498 — the same policy file (
deployments/openshell/agents/claude-sdk-agent/policy-data.yaml) uses*.svc.cluster.localwildcards that don't match in the OPA evaluator.Root cause: the OPA rego at
sandbox-policy.regousesglob.match()where*matches a single path segment (no dots).*.svc.cluster.localwon't matchlitellm-model-proxy.team1.svc.cluster.localbecause there are multiple dot-separated segments before.svc.Fix options:
**.svc.cluster.local(if OPA glob supports**)litellm-model-proxy.team1.svc.cluster.localIn our PR we work around this by having the supervisor not enforce network policy on the sandbox base image (teleport sandboxes use
sleep 3600command, not the supervised entry point). But for production agents (claude-sdk-agent, adk-agent), this blocks in-cluster LLM access.Related: #1669 (port vs ports normalization)
fix(openshell): replace TLD wildcards with explicit service endpoints
esnible commentedon May 27, 2026
@Ladas , I agree. The changes suggested work when I test the code using
Although local testing of the policy worked, it didn't work within the Sandbox, which suggests something is being modified as part of normalization.
docs(research): OpenShell fork analysis — patches, drivers, upgrade path
fix(hermes): config persistence, model default, policy wildcards
feat(openshell): upgrade to mvp-v2 branch (upstream v0.0.49+)
fix(openshell): replace TLD wildcards with explicit service endpoints
docs(research): OpenShell fork analysis — patches, drivers, upgrade path
fix(hermes): config persistence, model default, policy wildcards
feat(openshell): upgrade to mvp-v2 branch (upstream v0.0.49+)
fix(openshell): replace TLD wildcards with explicit service endpoints
docs(research): OpenShell fork analysis — patches, drivers, upgrade path
fix(hermes): config persistence, model default, policy wildcards
feat(openshell): upgrade to mvp-v2 branch (upstream v0.0.49+)
fix(ci): add push-to-main trigger for HyperShift OpenShell workflow