본문으로 건너뛰기
Skillpedia
보안7.6k · #13180

security

하는 일

이 스킬은 앱 데이터, 액션, 경로, 업로드, 외부 요청에 대한 보안 규칙을 정리합니다. 로그인, 데이터베이스 접근, 파일 업로드, 사용자가 준 웹 주소로의 서버 호출을 바꾸는 개발자를 위한 스킬입니다.

사용하는 경우

  • ✓로그인, 권한 또는 데이터베이스 접근 코드를 바꿀 때.
  • ✓앱이 외부 사용자의 업로드나 콘텐츠를 받을 때.
  • ✓서버가 사용자가 제공한 웹 주소를 가져와야 할 때.

스킬 링크

https://github.com/BuilderIO/agent-native/blob/main/.agents/skills/security/SKILL.md

복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.

사용 방법

가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.

바로 붙여넣을 수 있는 메시지

Use this skill to help me: https://github.com/BuilderIO/agent-native/blob/main/.agents/skills/security/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
AI가 이런 스킬을 알아서 찾아 쓰길 원하시나요?무료 Skillpedia MCP를 설치하세요. 한 줄이면 작업마다 스킬 15,000+개 중에서 검색합니다.1분 만에 설치 →

AI에게 요청하는 예시

“사용자가 자신의 메모만 볼 수 있게 하고, 업로드된 파일은 저장하기 전에 검사해 주세요.”

매주 새 스킬 5개. 읽는 데 1분.

작동 방식

이 스킬은 에이전트에게 모든 입력을 검사하고, 매개변수화된 쿼리를 쓰며, 모든 읽기와 쓰기를 호출자의 접근 권한으로 걸러내고, 확인할 수 없으면 접근을 거부하라고 말합니다.

기술 내용 (원본 SKILL.md)

작성자의 영어 원문을 GitHub에서 그대로 가져왔습니다.

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, or assertAccess(type, id, role) before a read or write that requires access.
  • Use an action's authorize gate 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, or document.write.
  • Use ssrfSafeFetch from @agent-native/core/extensions/url-safety for 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.
자주 묻는 질문

접근을 확인할 수 없으면 어떻게 되나요?

요청을 거부하는 방식으로 실패하라고 이 스킬은 말합니다.

큰 업로드 파일은 어디에 저장하나요?

파일 저장소에 두고, 데이터베이스에는 반환된 ID나 URL만 보관합니다.

원시 SQL은 사용자 입력을 어떻게 처리하나요?

값은 항상 매개변수로 전달해야 하며, SQL 텍스트에 이어 붙이면 안 됩니다.

상세 정보

작성자의 원본 설명

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

인기도

GitHub 스타
7.6k
순위
#13180
라이선스
MIT
업데이트
2026. 11. 2.

이 스킬이 유용한가요?

0

로그인 투표하려면 로그인하세요.

댓글

  • …

이 저장소의 다른 스킬

비슷한 스킬