本文へスキップ
Skillpedia
セキュリティ7.6k · #13180

security

できること

このスキルは、アプリのデータ、操作、ルート、アップロード、外部からのリクエストに関する安全の規則を定めます。ログイン、データベースへのアクセス、ファイルのアップロード、利用者が指定したWebアドレスへのサーバーからの呼び出しを変更する開発者向けです。

使う場面

  • ✓ログイン、権限、データベースへのアクセスのコードを変更するとき。
  • ✓外部の利用者からのアップロードや内容を受け付けるアプリのとき。
  • ✓利用者が指定したWebアドレスを、サーバーが取得するとき。

スキルのリンク

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

コピーしてAI(Claude、ChatGPT、Cursor)に貼り付け、指示に従うよう頼んでください。

使い方

いちばん簡単な方法:メッセージをコピーしてAIに貼り付けるだけ。AIがスキルを読んで指示に従います。

貼り付け用メッセージ

このスキルを使って手伝ってください:https://github.com/BuilderIO/agent-native/blob/main/.agents/skills/security/SKILL.md このリンクのSKILL.mdファイルを読んで、私の作業でその指示に従ってください。
こういうスキルを、AIが自分で見つけてくれたら?無料のSkillpedia MCPをインストール。1行で、作業の前に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

ログイン して投票しましょう。

コメント

  • …

このリポジトリの他のスキル

似ているスキル