feat(sandbox): enforce a network deny rule on a host the open default covers

Open
#1,277 0 comments 0 reactions 1 assignee View on GitHub

Maintainers usually reply within 1 day

@LivXue is already working on this.

Since Nov 12, 2026.

Assessment

This issue has not been assessed yet.

Description

Reserved for @LivXue: waiting for LivXue to resolve this. Please do not pick it up.

Summary

Under permissions.network.default: open, a deny rule in permissions.network cannot block, inside the sandbox, a host of three or more labels. The open default compiles to an OpenShell endpoint **.*.* on every port, and OpenShell refuses a deny endpoint that overlaps it. PR #1269 ships without that enforcement and warns instead.

What was measured

OpenShell 0.1.8 on an Ubuntu 24.04 host, 2026-11-12:

  • An L7 deny endpoint (protocol: rest, access: full, deny_rules: [* /**]) for a host the **.*.* wildcard covers is refused: FAILED_PRECONDITION network endpoint ambiguity validation failed: ... overlap on port(s) 443 with conflicting metadata: tls=0 vs 1; protocol=.... Overlapping endpoints must share tls and protocol.
  • tls: terminate is not an accepted value ("omit the field to keep automatic TLS termination"), and protocol without rules or access is refused.
  • Partial label wildcards cannot cut the open set into pieces that leave a denied host out: a single a*.* endpoint makes the policy ConfigurationInvalid, and the sandbox never becomes ready.
  • Against Raven's full open policy (about 181 KB), every rejected merge surfaces as RESOURCE_EXHAUSTED ... received metadata size exceeds hard limit (value length 290789 vs. 16384): the gateway echoes the policy in its error trailer, so the real reason is lost.

What stands after PR #1269

  • A denied host on the built-in two-label list is left out of the open set, so the sandbox blocks it.
  • A deny rule always stops Raven from opening a host: the mode, the reviewer and an approval all refuse it.
  • A host of three or more labels that **.*.* covers stays reachable under the open default. Compiling the policy warns once per such rule (unenforced_denials in raven/sandbox/network_policy.py).
  • A hard block needs permissions.network.default: closed.

Directions considered

  • A wildcard that terminates TLS and inspects HTTP, so a deny endpoint can share its metadata. Every HTTPS connection of the sandbox would be intercepted, and non-HTTP traffic on 443 would break. Not taken so far.
  • An upstream change in OpenShell: deny precedence over an overlapping allow, or a deny endpoint without L7 metadata.
  • Separately, an upstream report about the RESOURCE_EXHAUSTED error trailer hiding the real validation error.
Dominant language
Python
Stars
4.1k
Forks
94
Avg merge
2d 7h
Merged PRs (30d)
216

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from EverMind-AI/Raven

All issues in EverMind-AI/Raven

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.