generate-sandbox-policy
Skill này làm gì
Skill này giúp AI biến những gì bạn muốn sandbox truy cập thành một file chính sách mạng hợp lệ. Skill dành cho người thiết lập sandbox OpenShell và muốn kiểm soát các trang web và lời gọi API được phép.
Khi nào nên dùng
- ✓Khi bạn muốn cho phép AI trong sandbox truy cập một trang web hoặc API cụ thể.
- ✓Khi bạn có tài liệu API và muốn chính sách chỉ giới hạn ở một số phương thức và đường dẫn nhất định.
- ✓Khi bạn cần thay đổi cách gắn middleware mạng vào sandbox hoặc điều gì xảy ra khi nó lỗi.
Liên kết skill
https://github.com/NVIDIA/OpenShell/blob/main/skills/generate-sandbox-policy/SKILL.mdSao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.
Cách dùng
Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.
Tin nhắn có sẵn để dán
Dành cho Claude Code, Codex hoặc Cursor: chạy lệnh trong thư mục dự án của bạn và skill sẽ được cài đặt.
Tải tệp SKILL.md về và thả vào thư mục skill của agent.
Ví dụ cách nhờ AI
“Viết chính sách sandbox cho phép AI của tôi đọc từ GitHub API và không được làm gì khác.”
5 skill mới mỗi tuần. Đọc chỉ 1 phút.
Cách hoạt động
AI thu thập các host và quyền bạn cần, chọn mức chi tiết phù hợp với thông tin bạn cung cấp, rồi viết một chính sách YAML theo định dạng chính sách sandbox để bạn xem lại.
Nội dung kỹ thuật (SKILL.md gốc)
Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.
Generate Sandbox Policy
Generate YAML sandbox network policies and network middleware configuration from API documentation and natural-language user requirements.
Overview
This skill translates a user's plain-language policy intent into a valid sandbox policy. The amount of detail the user provides determines the granularity of the generated policy — from broad L4 or preset-based policies (just a host:port) up to fine-grained per-endpoint L7 rules (full API docs).
The output is a network_policies YAML block, an optional network_middlewares block, and optionally a full policy file that conforms to the sandbox policy schema.
Step 1: Gather Inputs
Determine the Detail Tier
The user's input falls into one of three tiers. Work with whatever the user provides — do not require a higher tier than needed.
| Tier | User provides | What you can generate |
|---|---|---|
| Minimal | Host(s) and plain-language intent | L4-only policies, or L7 with access presets (read-only, read-write, full) |
| Moderate | Host(s) + some known URL paths or resources | L7 with targeted glob rules for known paths, presets for the rest |
| Full | Complete API docs (OpenAPI, Swagger, markdown, URL) | Fine-grained per-endpoint L7 rules with specific method+path combinations |
Minimal Tier (host + intent only)
The user provides API endpoints and a broad intent. No API docs needed.
Examples:
- "Allow curl to hit api.github.com, read-only"
- "Give claude full access to api.anthropic.com"
- "Let /usr/bin/myapp talk to internal-svc:8080 but only for reading"
This is sufficient for:
- L4-only policies (host:port + binary checks, no method or path rules)
- Preset-based L7 policies (
read-only,read-write,fullon all paths)
For this tier, default to:
access: read-onlywhen the user says "read", "browse", "view", "query", "fetch"access: read-writewhen the user says "read-write", "create", "update" (but not "delete")access: fullwhen the user says "full access", "everything", "unrestricted"- L4-only when the user says "just allow it", "pass through", or "no
inspection". Omit
protocolfor explicit-proxy clients. Useprotocol: tcponly when the workload must use native DNS and direct socket calls, the endpoint has a valid DNS hostname, and the selected runtime support (currently Docker and Podman).
Moderate Tier (host + partial path knowledge)
The user knows some API paths but doesn't have full docs.
Examples:
- "Allow GET on /api/v1/models and POST on /api/v1/completions at integrate.api.nvidia.com"
- "Read-only on /repos/** at api.github.com, but also allow POST on /repos///issues"
Generate explicit rules for the known paths. If the user also wants broader access beyond the specific paths, combine with a catch-all rule or suggest a preset instead.
Full Tier (complete API docs)
The user provides full API documentation. Accepted formats:
| Format | How to consume |
|---|---|
| URL | Fetch with the agent's web access and parse the endpoint list |
| File path | Read the file (OpenAPI JSON/YAML, markdown, etc.) |
| Pasted text | Parse inline from the conversation |
| OpenAPI/Swagger spec | Extract paths object for all method+path combinations |
From the API docs, build an endpoint inventory — a list of (method, path, description) tuples. Group them logically (e.g., by resource or tag). Then generate precise rules that allow only what the user's intent requires.
Policy Intent
Regardless of tier, extract (or infer) these from the user's description:
| Aspect | What to identify | Required? |
|---|---|---|
| Scope | Which API host(s) and port(s) | Yes — always needed |
| Access level | Broad intent: read-only, read-write, full, or custom | Yes — ask if unclear |
| Methods | Specific HTTP methods to allow | Only for custom/fine-grained |
| Paths | Specific URL paths or patterns | Only for custom/fine-grained |
| Enforcement | enforce or audit? Default to enforce. |
No — has a default |
| Binary | Which binary/process should have access | Yes — ask if not stated |
| Middleware | Whether admitted HTTP requests, final HTTP responses, or client WebSocket text messages need an ordered built-in or operator-run processing stage | No |
If the host and access level are clear but binaries are not specified, ask the user w
Câu hỏi thường gặp
Tôi có cần tài liệu API để dùng skill này không?
Không. Một host và mô tả đơn giản là đủ cho chính sách cơ bản. Tài liệu API đầy đủ giúp AI viết quy tắc chính xác hơn.
Access preset là gì?
Preset là mức truy cập soạn sẵn, chẳng hạn chỉ đọc, đọc-ghi hoặc toàn quyền, mà AI có thể dùng khi không cần quy tắc chi tiết.
Có thể viết quy tắc chỉ cho một số đường dẫn không?
Có. Nếu biết một số đường dẫn URL, AI có thể viết quy tắc nhắm tới các đường dẫn đó và dùng preset cho phần còn lại.
Chi tiết
Mô tả gốc của tác giả
Generate sandbox security policies from plain-language requirements and optional REST API documentation. Produces L4 or fine-grained L7 network policies and ordered network middleware configuration. Use for API access rules, middleware host selection, failure behavior, or built-in and operator-run middleware attachment. Trigger keywords - generate policy, create policy, update policy, change policy, sandbox policy, network policy, API policy, security policy, allow API, restrict API, network middleware, supervisor middleware.
repo: NVIDIA/OpenShell
Độ phổ biến
- Sao GitHub
- 21k
- Vị trí xếp hạng
- #10367
- Giấy phép
- Apache-2.0
- Cập nhật
- 2/11/2026
Bình luận
- …
Thêm skill từ kho mã này
create-github-issue
21kGiúp agent của bạn tạo issue GitHub cho lỗi, yêu cầu tính năng hoặc tác vụ, bằng công cụ dòng lệnh gh và mẫu của dự án.
create-github-pr
21kCho phép agent của bạn mở pull request trên GitHub cho nhánh của bạn bằng công cụ gh, sau khi kiểm tra công việc đã sẵn sàng để xem xét.
review-github-pr
21kHướng dẫn agent của bạn đọc pull request trên GitHub và giải thích các thay đổi, lựa chọn thiết kế chính và đoạn mã đáng chú ý bằng ngôn ngữ dễ hiểu.
watch-github-actions
21kCho phép agent của bạn kiểm tra các lần chạy GitHub Actions, theo dõi cho đến khi hoàn tất và đọc log của mọi job bị lỗi.
Skill tương tự
reverse-engineer-anything
422kGiúp agent của bạn xem bên trong các app và package đã phát hành để giải thích tính năng, so sánh phiên bản hoặc hướng dẫn dựng lại bằng công cụ REA.
1password
394kGiúp agent của bạn cài đặt CLI của 1Password, đăng nhập, và đọc hoặc đưa thông tin bí mật vào mà không in giá trị ra cuộc trò chuyện.
healthcheck
394kGiúp agent của bạn rà soát bảo mật máy tính hoặc máy chủ đang chạy OpenClaw, như SSH, tường lửa, cập nhật và sao lưu, rồi đề xuất cách sửa an toàn.