|
| 1 | +# SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. |
| 2 | +# SPDX-License-Identifier: Apache-2.0 |
| 3 | + |
| 4 | +version: 1 |
| 5 | + |
| 6 | +# --- Sandbox setup configuration (queried once at startup) --- |
| 7 | + |
| 8 | +filesystem_policy: |
| 9 | + include_workdir: true |
| 10 | + read_only: |
| 11 | + - /usr |
| 12 | + - /lib |
| 13 | + - /proc |
| 14 | + - /dev/urandom |
| 15 | + - /app |
| 16 | + - /etc |
| 17 | + - /var/log |
| 18 | + read_write: |
| 19 | + - /sandbox |
| 20 | + - /tmp |
| 21 | + - /dev/null |
| 22 | + |
| 23 | +landlock: |
| 24 | + compatibility: best_effort |
| 25 | + |
| 26 | +process: |
| 27 | + run_as_user: sandbox |
| 28 | + run_as_group: sandbox |
| 29 | + |
| 30 | +# --- Network policies (queried per-CONNECT request) --- |
| 31 | +# |
| 32 | +# Each named policy maps a set of allowed (binary, endpoint) pairs. |
| 33 | +# Binary identity is resolved via /proc/net/tcp inode lookup + /proc/{pid}/exe. |
| 34 | +# Ancestors (/proc/{pid}/status PPid walk) and cmdline paths are also matched. |
| 35 | +# SHA256 integrity is enforced in Rust via trust-on-first-use, not here. |
| 36 | + |
| 37 | +network_policies: |
| 38 | + pi: |
| 39 | + name: pi |
| 40 | + endpoints: |
| 41 | + # API-key providers |
| 42 | + - { host: api.anthropic.com, port: 443 } |
| 43 | + - { host: api.openai.com, port: 443 } |
| 44 | + - { host: api.deepseek.com, port: 443 } |
| 45 | + - { host: generativelanguage.googleapis.com, port: 443 } |
| 46 | + - { host: api.mistral.ai, port: 443 } |
| 47 | + - { host: api.groq.com, port: 443 } |
| 48 | + - { host: api.cerebras.ai, port: 443 } |
| 49 | + - { host: api.x.ai, port: 443 } |
| 50 | + - { host: openrouter.ai, port: 443 } |
| 51 | + - { host: ai-gateway.vercel.sh, port: 443 } |
| 52 | + - { host: router.huggingface.co, port: 443 } |
| 53 | + - { host: api.fireworks.ai, port: 443 } |
| 54 | + - { host: api.together.ai, port: 443 } |
| 55 | + - { host: api.kimi.com, port: 443 } |
| 56 | + - { host: api.moonshot.ai, port: 443 } |
| 57 | + - { host: api.moonshot.cn, port: 443 } |
| 58 | + - { host: api.minimax.io, port: 443 } |
| 59 | + - { host: api.minimaxi.com, port: 443 } |
| 60 | + - { host: api.xiaomimimo.com, port: 443 } |
| 61 | + - { host: token-plan-cn.xiaomimimo.com, port: 443 } |
| 62 | + - { host: token-plan-ams.xiaomimimo.com, port: 443 } |
| 63 | + - { host: token-plan-sgp.xiaomimimo.com, port: 443 } |
| 64 | + - { host: api.z.ai, port: 443 } |
| 65 | + - { host: opencode.ai, port: 443 } |
| 66 | + # Cloud providers |
| 67 | + - { host: bedrock-runtime.us-east-1.amazonaws.com, port: 443 } |
| 68 | + - { host: bedrock-runtime.eu-central-1.amazonaws.com, port: 443 } |
| 69 | + - { host: api.cloudflare.com, port: 443 } |
| 70 | + - { host: gateway.ai.cloudflare.com, port: 443 } |
| 71 | + # Add region-specific Vertex AI hosts here if needed, e.g.: |
| 72 | + # - { host: us-central1-aiplatform.googleapis.com, port: 443 } |
| 73 | + # Subscription login / token refresh endpoints |
| 74 | + - { host: claude.ai, port: 443 } |
| 75 | + - { host: platform.claude.com, port: 443 } |
| 76 | + - { host: auth.openai.com, port: 443 } |
| 77 | + - { host: chatgpt.com, port: 443 } |
| 78 | + - { host: github.com, port: 443 } |
| 79 | + - { host: api.github.com, port: 443 } |
| 80 | + # pi downloads managed fd/ripgrep binaries from GitHub release assets. |
| 81 | + - { host: release-assets.githubusercontent.com, port: 443 } |
| 82 | + - { host: api.githubcopilot.com, port: 443 } |
| 83 | + - { host: api.individual.githubcopilot.com, port: 443 } |
| 84 | + - { host: api.business.githubcopilot.com, port: 443 } |
| 85 | + - { host: api.enterprise.githubcopilot.com, port: 443 } |
| 86 | + - { host: copilot-proxy.githubusercontent.com, port: 443 } |
| 87 | + - { host: default.exp-tas.com, port: 443 } |
| 88 | + binaries: |
| 89 | + - { path: /usr/bin/pi } |
| 90 | + - { path: /usr/local/bin/pi } |
| 91 | + - { path: /usr/lib/node_modules/@earendil-works/pi-coding-agent/dist/cli.js } |
| 92 | + - { path: /usr/local/lib/node_modules/@earendil-works/pi-coding-agent/dist/cli.js } |
| 93 | + - { path: /usr/bin/node } |
| 94 | + - { path: /usr/local/bin/node } |
| 95 | + |
| 96 | + github_ssh_over_https: |
| 97 | + name: github-ssh-over-https |
| 98 | + endpoints: |
| 99 | + - host: github.com |
| 100 | + port: 443 |
| 101 | + protocol: rest |
| 102 | + tls: terminate |
| 103 | + enforcement: enforce |
| 104 | + rules: |
| 105 | + # Git Smart HTTP read-only: allow clone, fetch, pull |
| 106 | + # Discovery (query string is included in path matching) |
| 107 | + - allow: |
| 108 | + method: GET |
| 109 | + path: "/**/info/refs*" |
| 110 | + # Data transfer for reads (all repos) |
| 111 | + - allow: |
| 112 | + method: POST |
| 113 | + path: "/**/git-upload-pack" |
| 114 | + # Data transfer for writes |
| 115 | + # - allow: |
| 116 | + # method: POST |
| 117 | + # path: "/**/git-receive-pack" |
| 118 | + binaries: |
| 119 | + - { path: /usr/bin/git } |
| 120 | + |
| 121 | + nvidia_inference: |
| 122 | + name: nvidia-inference |
| 123 | + endpoints: |
| 124 | + - { host: integrate.api.nvidia.com, port: 443 } |
| 125 | + binaries: |
| 126 | + - { path: /usr/bin/curl } |
| 127 | + - { path: /bin/bash } |
| 128 | + |
| 129 | + # --- GitHub REST API (read-only) --- |
| 130 | + github_rest_api: |
| 131 | + name: github-rest-api |
| 132 | + endpoints: |
| 133 | + - host: api.github.com |
| 134 | + port: 443 |
| 135 | + protocol: rest |
| 136 | + tls: terminate |
| 137 | + enforcement: enforce |
| 138 | + access: read-only |
| 139 | + binaries: |
| 140 | + - { path: /usr/bin/gh } |
| 141 | + |
| 142 | + pypi: |
| 143 | + name: pypi |
| 144 | + endpoints: |
| 145 | + - { host: pypi.org, port: 443 } |
| 146 | + - { host: files.pythonhosted.org, port: 443 } |
| 147 | + # uv python install downloads from python-build-standalone on GitHub |
| 148 | + - { host: github.com, port: 443 } |
| 149 | + - { host: objects.githubusercontent.com, port: 443 } |
| 150 | + # uv resolves python-build-standalone release metadata via the GitHub API |
| 151 | + - { host: api.github.com, port: 443 } |
| 152 | + - { host: downloads.python.org, port: 443 } |
| 153 | + binaries: |
| 154 | + - { path: /sandbox/.venv/bin/python } |
| 155 | + - { path: /sandbox/.venv/bin/python3 } |
| 156 | + - { path: /sandbox/.venv/bin/pip } |
| 157 | + - { path: /app/.venv/bin/python } |
| 158 | + - { path: /app/.venv/bin/python3 } |
| 159 | + - { path: /app/.venv/bin/pip } |
| 160 | + - { path: /usr/local/bin/uv } |
| 161 | + # Managed Python installations from uv python install |
| 162 | + - { path: "/sandbox/.uv/python/**" } |
| 163 | + |
| 164 | + vscode: |
| 165 | + name: vscode |
| 166 | + endpoints: |
| 167 | + - { host: update.code.visualstudio.com, port: 443 } |
| 168 | + # NOTE: OPA host matching uses exact equality, not glob — list hosts explicitly. |
| 169 | + - { host: az764295.vo.msecnd.net, port: 443 } |
| 170 | + - { host: vscode.download.prss.microsoft.com, port: 443 } |
| 171 | + - { host: marketplace.visualstudio.com, port: 443 } |
| 172 | + - { host: gallerycdn.vsassets.io, port: 443 } |
| 173 | + binaries: |
| 174 | + - { path: /usr/bin/curl } |
| 175 | + - { path: /usr/bin/wget } |
| 176 | + - { path: "/sandbox/.vscode-server/**" } |
| 177 | + - { path: "/sandbox/.vscode-remote-containers/**" } |
| 178 | + |
| 179 | + cursor: |
| 180 | + name: cursor |
| 181 | + endpoints: |
| 182 | + - { host: cursor.blob.core.windows.net, port: 443 } |
| 183 | + # NOTE: OPA host matching uses exact equality, not glob — list hosts explicitly. |
| 184 | + - { host: api2.cursor.sh, port: 443 } |
| 185 | + - { host: repo.cursor.sh, port: 443 } |
| 186 | + - { host: download.cursor.sh, port: 443 } |
| 187 | + - { host: cursor.download.prss.microsoft.com, port: 443 } |
| 188 | + binaries: |
| 189 | + - { path: /usr/bin/curl } |
| 190 | + - { path: /usr/bin/wget } |
| 191 | + - { path: "/sandbox/.cursor-server/**" } |
0 commit comments