Skip to content

Self-evolving Context Database for AI Agents. Unify Agent Memory, Knowledge RAG and Skills.

docs(config): document allow_private_networks and code-hosting domain allowlist (#2483)

Evoa9b72351df28
diff --git a/docs/en/guides/01-configuration.md b/docs/en/guides/01-configuration.md
index c119102d9..92b535afa 100644
--- a/docs/en/guides/01-configuration.md
+++ b/docs/en/guides/01-configuration.md
@@ -783,6 +783,30 @@ AST extraction supports: Python, JavaScript/TypeScript, Rust, Go, Java, C/C++. O
See [Code Skeleton Extraction](../concepts/06-extraction.md#code-skeleton-extraction-ast-mode) for details.
+#### Remote resource network guard
+
+When ingesting a resource from a URL, OpenViking rejects loopback, link-local, private, and other non-public destinations, plus any host not on the code-hosting allowlist, raising `PermissionDeniedError`. To ingest code from self-hosted GitHub Enterprise / GitLab / Azure DevOps, add the host to the matching allowlist under `code`:
+
+| Field | Type | Description | Default |
+|-------|------|-------------|---------|
+| `github_domains` | list[str] | Allowed GitHub hosts (add your GitHub Enterprise host here) | `["github.com", "www.github.com"]` |
+| `gitlab_domains` | list[str] | Allowed GitLab hosts (add your self-hosted GitLab host here) | `["gitlab.com", "www.gitlab.com"]` |
+| `azure_devops_domains` | list[str] | Allowed Azure DevOps hosts | `["dev.azure.com", "ssh.dev.azure.com", "vs-ssh.visualstudio.com"]` |
+| `code_hosting_domains` | list[str] | Additional generic code-hosting hosts | `["github.com", "gitlab.com"]` |
+
+To ingest from private/internal network addresses (e.g. an internal mirror), set the top-level `allow_private_networks` to `true` (disabled by default, so only public addresses are allowed):
+
+```json
+{
+ "allow_private_networks": false,
+ "code": {
+ "github_domains": ["github.com", "github.example.com"]
+ }
+}
+```
+
+The `PermissionDeniedError` message names the exact key to add for the blocked host.
+
### rerank
Reranking model for search result refinement. Supports VikingDB (Volcengine), Cohere, and OpenAI-compatible APIs.
diff --git a/docs/zh/guides/01-configuration.md b/docs/zh/guides/01-configuration.md
index e1b68c833..a5321c3bb 100644
--- a/docs/zh/guides/01-configuration.md
+++ b/docs/zh/guides/01-configuration.md
@@ -754,6 +754,30 @@ AST 提取支持:Python、JavaScript/TypeScript、Rust、Go、Java、C/C++。
详见 [代码骨架提取](../concepts/06-extraction.md#代码骨架提取ast-模式)。
+#### 远程资源网络防护
+
+通过 URL 拉取资源时,OpenViking 会拒绝环回、链路本地、私有及其他非公网目标,以及不在代码托管白名单中的主机,并抛出 `PermissionDeniedError`。要从自建 GitHub Enterprise / GitLab / Azure DevOps 拉取代码,请将主机加入 `code` 下对应的白名单:
+
+| 字段 | 类型 | 说明 | 默认值 |
+|------|------|------|--------|
+| `github_domains` | list[str] | 允许的 GitHub 主机(在此添加你的 GitHub Enterprise 主机) | `["github.com", "www.github.com"]` |
+| `gitlab_domains` | list[str] | 允许的 GitLab 主机(在此添加你的自建 GitLab 主机) | `["gitlab.com", "www.gitlab.com"]` |
+| `azure_devops_domains` | list[str] | 允许的 Azure DevOps 主机 | `["dev.azure.com", "ssh.dev.azure.com", "vs-ssh.visualstudio.com"]` |
+| `code_hosting_domains` | list[str] | 额外的通用代码托管主机 | `["github.com", "gitlab.com"]` |
+
+要从私有/内网地址(例如内部镜像)拉取,请将顶层的 `allow_private_networks` 设为 `true`(默认关闭,因此仅允许公网地址):
+
+```json
+{
+ "allow_private_networks": false,
+ "code": {
+ "github_domains": ["github.com", "github.example.com"]
+ }
+}
+```
+
+`PermissionDeniedError` 的报错信息会指明针对被拦截主机应添加的具体配置键。
+
### rerank
用于搜索结果精排的 Rerank 模型。支持 VikingDB (火山引擎)、Cohere 和 OpenAI 兼容接口。