Proxy: allow denying /ai per project (capability check like /email)

Đang mở
#718 0 bình luận 1 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
55/100
Loại issue
Tính năng
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
typescript
Lĩnh vực
api, backend

Hướng nghiên cứu

Start with platform/packages/proxy/src/index.ts, comparing the /ai usage check near line 288 with the /email capability gate near line 305; the provisioning path is also cited at platform/packages/api/src/provisioning/provision.ts. Choose and implement a way to deny project AI calls before model execution, then verify denied calls cannot reach the model while allowed projects still can.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

Request

Let an operator deny the proxy's /ai routes to a project (or at least honour the installation's ai capability there), the same way /email is already gated.

Why

We host agent-built apps in one Void project (lumi-apps) and serve them through our own dispatch Worker. Those apps must not use AI: our platform meters and approves every AI call, and an app calling Workers AI directly bypasses that. Other projects on the same installation do need AI, so turning it off installation-wide isn't an option.

Today every deployed Worker gets the __VOID_PROXY service binding plus __PROJECT_ID and __VOID_PROXY_TOKEN (platform/packages/api/src/provisioning/provision.ts:170-178 at v1.5.0), so app code can call /ai/* whether or not its manifest declares AI. The proxy checks PLATFORM_CAPABILITIES only for email (platform/packages/proxy/src/index.ts:305); /ai has only the monthly-usage block (index.ts:288), which is written asynchronously after usage is counted, so a plan quota limits spend but doesn't deny calls.

What would solve it

Any of these, in order of preference:

  1. A per-project capability setting (for example void project capabilities set ai=false) that the proxy enforces on /ai before running the model.
  2. The proxy honouring the installation-level ai capability on /ai, matching /email.
  3. Not injecting __VOID_PROXY into Workers whose manifest uses none of the proxy-backed features.

Happy to test a pre-release. Related context: #692.

Ngôn ngữ chính
TypeScript
Star
627
Fork
66
Merge trung bình
14 giờ 17 phút
Pull request đã merge (30 ngày)
200

Chuẩn bị môi trường

Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của voidzero-dev/void

Tất cả issue của voidzero-dev/void

Issue tương tự

Thêm issue về TypeScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.