security
Skill này làm gì
Skill này liệt kê các quy tắc bảo mật cho dữ liệu, action, route, tải lên và yêu cầu bên ngoài của ứng dụng. Skill dành cho lập trình viên thay đổi đăng nhập, quyền truy cập cơ sở dữ liệu, tải file lên hoặc các lời gọi máy chủ tới địa chỉ web do người dùng cung cấp.
Khi nào nên dùng
- ✓Khi bạn thay đổi code đăng nhập, phân quyền hoặc truy cập cơ sở dữ liệu.
- ✓Khi một ứng dụng chấp nhận tải lên hoặc nội dung từ người dùng bên ngoài.
- ✓Khi máy chủ sẽ lấy một địa chỉ web do người dùng cung cấp.
Liên kết skill
https://github.com/BuilderIO/agent-native/blob/main/.agents/skills/security/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
“Đảm bảo người dùng chỉ thấy ghi chú của chính họ, và kiểm tra tệp tải lên trước khi lưu.”
5 skill mới mỗi tuần. Đọc chỉ 1 phút.
Cách hoạt động
Skill yêu cầu agent kiểm tra mọi đầu vào, dùng truy vấn tham số hóa, và lọc mỗi lần đọc và ghi theo quyền của người gọi, đồng thời từ chối truy cập bất cứ khi nào không xác nhận được.
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.
Security
Rule
Treat each action, route, query, and external request as a trust boundary. Validate inputs, check the caller's authority for every row, and fail closed when access cannot be established.
Validate input and queries
- Define action inputs with a Zod
schema; validate data from forms, URLs, providers, and files before using it. - Build database queries with Drizzle. For raw SQL, bind values as parameters; never concatenate user input into SQL text.
- Keep large uploads and file contents in file storage. Store only their returned ids or URLs in SQL.
Authorize rows and actions
Choose a table's access model when designing its data:
| Data | Access model |
|---|---|
| Private user rows | Store owner_email and filter every read and write by the current caller. |
| Organization-wide catalog | Store org_id and scope action queries to the active org; gate restricted mutations by org or app role. |
| Team-shared or individually shareable resources | Use ownableColumns(), register the resource type, and check access with the sharing helpers. |
| Child rows | Check access to the parent before reading or changing children; add any child-specific rules in the action. |
Do not make a team-wide catalog private by adding a per-user owner filter. For
an organization-owned catalog, org_id without owner_email is valid: scoped
database tools expose only the active organization's rows, while app actions
still need their own org filter and authorization. For resources users can
share, use these helpers:
- Add
accessFilter(table, sharesTable)to list and read-many queries. - Use
resolveAccess(type, id)for an optional read by id, orassertAccess(type, id, role)before a read or write that requires access. - Use an action's
authorizegate for role-wide restrictions. It decides who may call the operation; it does not replace row-level access checks.
Prefer actions for normal app data. A custom HTTP route is appropriate for protocols such as uploads, streaming, webhooks, OAuth callbacks, or public unauthenticated resources. An authenticated custom route must establish the session/request context and apply the same row-level access checks as an action.
Handle untrusted content and URLs
- React escapes rendered text. Do not pass untrusted content to
dangerouslySetInnerHTML,innerHTML,eval, ordocument.write. - Use
ssrfSafeFetchfrom@agent-native/core/extensions/url-safetyfor server-side requests to user- or agent-controlled URLs. It checks private network destinations and redirects. - Treat provider error bodies and uploaded files as untrusted input. Return a useful, bounded error to the user without exposing internal details.
Protect credentials and consequential actions
Never put credential values in source, prompts, action arguments or results,
application state, client bundles, logs, or error messages. Use the shared
credential flow in the secrets skill.
For a genuinely high-consequence outward action, such as sending a message,
charging a payment method, or publishing publicly, use needsApproval to ask
the user to approve that call. Approval does not grant access: keep the normal
authorize and row-level checks as well.
Related skills
actions— define validated operations shared by the agent and UI.secrets— connect external services and resolve credentials safely.sharing— configure access to shareable resources.
Câu hỏi thường gặp
Nếu không xác nhận được quyền truy cập thì sao?
Skill nói nên fail closed, nghĩa là yêu cầu bị từ chối.
File tải lên lớn nên được lưu ở đâu?
Vào bộ nhớ file, chỉ giữ ID hoặc URL trả về trong cơ sở dữ liệu.
Truy vấn SQL thô nên xử lý đầu vào người dùng thế nào?
Giá trị phải được truyền như tham số, không bao giờ được nối vào văn bản SQL.
Chi tiết
Mô tả gốc của tác giả
Secure app data, actions, routes, and external input. Use when changing authentication, authorization, database access, uploads, untrusted content, or server-side requests to user-provided URLs.
repo: BuilderIO/agent-native
Độ phổ biến
- Sao GitHub
- 7.6k
- Vị trí xếp hạng
- #13180
- Giấy phép
- MIT
- Cập nhật
- 2/11/2026
Bình luận
- …
Thêm skill từ kho mã này
design-exploration
7.6kGiúp agent của bạn khám phá nhiều hướng thiết kế giao diện song song, để bạn chọn một hướng rồi tinh chỉnh thiết kế đã chọn.
visual-edit
7.6kGiúp agent của bạn mở một ứng dụng cục bộ đang chạy trong trình chỉnh sửa trực quan, để bạn xem và sửa các màn hình thật cùng nhau.
turn-into-app
7.6kBiến quy trình, bảng tính hoặc dự án thành ứng dụng trực quan có màn hình đầy đủ dữ liệu, với agent làm việc phía sau các điều khiển.
visual-plan
7.6kBiến một kế hoạch viết bằng văn bản thuần thành kế hoạch trực quan tương tác, có sơ đồ, bản đồ file, đoạn code và các câu hỏi còn mở.
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.