Network Policy

Network policies define allowed connections in transparent mode. The proxy intercepts all network traffic via iptables DNAT and enforces these rules.

Schema

network:
  outbound:
    - name: string
      domains: [string]      # glob patterns
      ports: [integer]
      protocol: tcp|udp
      rate_limit:
        requests_per_minute: integer
        burst: integer
      taint_labels: [string]
  inbound:
    - name: string
      container_port: integer
      host_port: integer
      allowed_sources: [string]  # CIDR notation
  dns:
    mode: allowlist|passthrough
    additional_domains: [string]
  runtime:
    runtime_type: node|binary|container
    entrypoint: string
    env: {key: value}
    volumes:
      - name: string
        mount_path: string
        size_limit_mib: integer

Sections

outbound

Rules for outgoing connections.

FieldDescription
nameRule identifier
domainsAllowed domain patterns. * matches subdomains.
portsAllowed destination ports
protocoltcp or udp
rate_limitConnection rate limit
taint_labelsLabels for data from these connections

inbound

Rules for incoming connections (optional).

FieldDescription
nameRule identifier
container_portPort inside the sandbox
host_portPort exposed on host
allowed_sourcesCIDR ranges allowed to connect

dns

DNS resolution policy.

FieldDescription
modeallowlist only resolves domains in outbound rules; passthrough allows all DNS
additional_domainsExtra domains to resolve in allowlist mode

runtime

Agent execution configuration.

FieldDescription
runtime_typenode, binary, or container
entrypointCommand to run
envEnvironment variables
volumesMounted volumes with size limits

Example

network:
  outbound:
    - name: openai
      domains: ["api.openai.com"]
      ports: [443]
      protocol: tcp
      rate_limit:
        requests_per_minute: 100
    - name: slack
      domains: ["*.slack.com"]
      ports: [443]
      protocol: tcp
  dns:
    mode: allowlist
  runtime:
    runtime_type: node
    entrypoint: "node /app/bot.js"
    env:
      NODE_ENV: production
    volumes:
      - name: data
        mount_path: /data
        size_limit_mib: 256