Security Permission Designのロゴ

Security Permission Design

コミュニティ
andrew0928
security-permission-design

アプリケーションやAPI向けに、Andrew流の認証、認可、権限、信頼境界の仕組みを設計します。Codexで、セキュリティ・バイ・デザインの考え方、トークンまたはキーに基づく信頼モデル、権限システムのアーキテクチャ、RBACやポリシーの設計、リプレイ攻撃対策と署名方式の選択、マルチテナントの認可境界、運用上の強制措置や監査の検討が必要な場合に使用してください。

概要

公開者andrew0928
リポジトリandrew-skills
スキル名security-permission-design
スター
36
フォーク
6
同梱ファイル
6
リンク
  • Markdown形式の指示

    モデルが必要に応じて読み込むSKILL.mdファイルです。関連するリクエストがあったときだけトークンを消費します。

  • どのLLMでも利用可能

    AIスキルはプロバイダー固有のコードではなく、通常のMarkdownなので、GPT、Claude、Gemini、Grok、ローカルモデルで利用できます。

  • 6個の同梱ファイル

    モデルが作業中に読み取れるスクリプト、テンプレート、参考資料です。ファイルは読み取り専用で、実行されることはありません。

  • オープンソース

    andrew0928がGitHubで公開しています。インストールする前にソースを確認してください。

インストール

AIスキル「Security Permission Design」をTypingMindにインストールすれば、どのLLMでも利用できます。SKILL.mdを読み取れる別のAIエージェントに追加することもできます。

1

TypingMindにインストール

TypingMindはGitHubフォルダから直接スキルをインストールします。SKILL.mdを読み取り、リソースファイルをまとめてローカルに保存します。

  1. アプリを開き、「プラグイン」→「スキル」に移動します。
  2. 「GitHubからインストール」を選択します。
  3. 以下のスキルフォルダのURLを貼り付けて確定します。
    https://github.com/andrew0928/andrew-skills/tree/main/plugins/architect/skills/security-permission-design
  4. スキルを利用したいチャットごとに、そのスキルを有効にしてください。
「プラグイン」→「スキル」→「スキルを追加」→「GitHubのURLから」を選択し、フォルダのURLを貼り付けて「続行」を押します。
2

別のAIエージェントにインストール

Agent Skills形式を読み取れるAIエージェントなら、このスキルを利用できます。フォルダをそのAIエージェントのスキルディレクトリにコピーしてください。

Claude Code — .claude/skills
git clone --depth 1 https://github.com/andrew0928/andrew-skills.git /tmp/andrew-skills
mkdir -p .claude/skills
cp -r /tmp/andrew-skills/plugins/architect/skills/security-permission-design .claude/skills/security-permission-design
コピー後、新しいスキルを読み込むためにClaude Codeを再起動してください。

TypingMindで使用

TypingMindのチャットでSecurity Permission Designを有効にするだけで、あとはモデルが対応します。名前と説明がシステムプロンプトに含まれ、関連するリクエストがあると、モデルが指示の全文を自動で読み込みます。手動で呼び出す必要はなく、実際に使用されるまでトークンを消費しません。

関連するリクエストがあるとすぐに、モデルが自動的にSecurity Permission Designを読み込みます。

どのAIモデルでも利用可能

AIスキルはプロバイダー固有のコードではなく、通常のMarkdownで書かれた指示です。そのため、Security Permission Designは作成時に想定されたモデルに縛られません。TypingMindに一度インストールすれば、ご自身のAPIキーを使って、GPT-5、Claude、Gemini、Grok、DeepSeek、Mistral、Llama、またはご自身で実行するローカルモデルで利用できます。

  • 必要なときだけ読み込み

    システムプロンプトには名前と説明だけが含まれます。関連するリクエストが初めてあったときに指示を取得するため、スキルを使わない間は指示の読み込みにトークンを消費しません。

  • チャットの途中でモデルを切り替え

    スキルはコードではなく指示なので、モデルを切り替えてもそのまま使えます。次のモデルも同じSKILL.mdを読み込みます。

スキルの指示

モデルが読み込むSKILL.mdの内容です。スキルはモデルが従う指示なので、インストールする前に確認してください。

Andrew Security Permission Design

Overview

Use this skill when the problem is about who can be trusted, who can do what, what evidence proves it, and where that decision must be enforced.

Treat security as a design-quality problem, not as a bolt-on feature. Start from business risk and trust boundaries, then separate authentication, authorization, access control, and audit clearly. Prefer standard cryptographic and authorization models over clever custom mechanisms.

Working Style

  • Write in Traditional Chinese when the user or repo context is Chinese.
  • Treat security requirements as product quality requirements, not optional implementation detail.
  • Start from threat model and trust boundary before selecting libraries or protocols.
  • Separate clearly:
    • authentication
    • authorization
    • access control
    • audit
  • Prefer standard, proven cryptographic mechanisms and frameworks over custom crypto.
  • Protect secrets and keys; assume code and algorithms may be visible.
  • Design security control points so developers can use them consistently with low friction.
  • Prefer centralized or reusable enforcement over one-off checks scattered through pages or handlers.
  • Treat multi-tenant and third-party integration scenarios as first-class security cases.
  • Make enforcement explicit at API, service, and data boundaries.

Workflow

1. Problem Analysis

  • State what must be protected:
    • identity
    • money-like value
    • personal data
    • business data
    • service capability
    • licensed feature
  • Define the threat boundary:
    • trusted server
    • untrusted client
    • partner system
    • third-party integrator
    • tenant boundary
    • offline or closed-network environment
  • Identify what can realistically be stolen, replayed, tampered with, or overused.
  • Distinguish feature requirement from quality requirement. Security usually belongs to quality and must survive hostile conditions, not only happy-path tests.
  • Clarify whether the main problem is:
    • proving identity
    • proving source integrity
    • limiting capability
    • scoping data access
    • preventing replay
    • simplifying permission management

2. Trust Boundary And Threat Model

  • Map who trusts whom and on what evidence.
  • Decide which parties can be fully trusted, partially trusted, or not trusted at all.
  • Model offline verification separately from online verification.
  • Distinguish integrity, confidentiality, authenticity, and authorization; do not solve one and assume the others are solved too.
  • Assume anything delivered to client side or partner-controlled infrastructure is inspectable and potentially replayable.
  • If code can be copied or modified, account for that instead of assuming license or token logic alone is enough.

3. Identity And Authentication

  • Define what identifies the subject:
    • user
    • service
    • device
    • tenant
    • partner application
  • Define how that identity is authenticated.
  • Keep authentication output explicit as a principal or equivalent identity object.
  • Record authentication strength and source when they matter to later decisions.
  • Reuse framework identity abstractions when they fit, instead of inventing new ones without need.
  • For service-to-service trust, decide whether signed tokens, mutual trust anchors, or online verification is the primary mechanism.

4. Authorization Model

  • Define the minimal authorization question clearly:
    • who is requesting
    • what action is requested
    • on what scope or resource
    • under what policy or environment
  • Choose the management model that matches the problem:
    • role-based
    • permission-based
    • policy-based
    • attribute-based
    • access-control-list
    • contract or entitlement based
  • Treat permissions as business-facing capability boundaries, not only code-level toggles.
  • Group permissions deliberately to balance management cost and precision.
  • Distinguish action permission from data-scope permission.
  • Separate subject, role, permission, session, and operation in the model even if some layers collapse in implementation.
  • For third-party delegation, model intention and delegation scope explicitly instead of pretending every caller is the same first-party actor.

5. Token, Key, And Credential Design

  • Decide whether the token or credential is proving:
    • identity
    • integrity
    • entitlement
    • expiry
    • execution scope
  • Prefer signed tokens when the core need is authenticity and integrity rather than secrecy.
  • Use hashes for password verification; do not store raw passwords.
  • Distinguish signature use from encryption use.
  • Include only the claims needed for downstream decisions.
  • Add replay defenses when a stolen valid token would still be dangerous:
    • short expiry
    • client binding
    • device binding
    • nonce
    • server-side revocation or usage tracking
  • Protect private keys aggressively.
  • Decide how public keys or trust roots are distributed and updated.
  • If offline verification is required, design for local verification of integrity and expiry.
  • If key substitution is possible, account for trust-anchor protection, not only token format correctness.

6. Enforcement Boundaries

  • Place enforcement where the resource is actually exposed:
    • page or UI
    • API endpoint
    • service method
    • message handler
    • query boundary
    • data filter
  • Do not rely on menus or UI visibility alone.
  • Prefer enforcing once at a shared boundary instead of repeating ad hoc checks.
  • Keep identity extraction, permission lookup, and decision logic reusable.
  • Ensure the same permission rule cannot be bypassed through an alternate entry path.
  • For APIs, define method-level, scope-level, and environment-level control points separately when needed.
  • For multi-tenant systems, ensure tenant scoping is safe by default.

7. Permission Management And Scaling

  • Evaluate permission design on two axes:
    • management complexity
    • decision precision
  • Avoid designs that are perfectly precise but operationally impossible to maintain.
  • Avoid designs that are easy to manage but cannot express critical business boundaries.
  • Cache or precompute permission sets when repeated high-frequency checks would otherwise explode combinatorially.
  • Prefer session-context plus module-context or equivalent coarse-grained decision surfaces when per-action checks are too expensive.
  • Use groups, roles, or policy composition to reduce management load deliberately.
  • Keep the permission-definition model stable enough that new features do not require redesigning the whole matrix.

8. Operational Controls And Audit

  • Design for key rotation, token expiry, revocation, and incident response.
  • Log enough evidence to answer:
    • who acted
    • what was attempted
    • what was allowed or denied
    • what scope was involved
    • what credential or policy version was used
  • Define how administrators manage permissions without accidentally granting excessive power.
  • Consider rate limit, source restriction, and environment checks when they materially reduce risk.
  • Treat secret storage, trust-root distribution, and deployment updates as part of the architecture.
  • If the system must work offline, define what validation still works and what must fail closed.

9. POC And Evaluation

  • Build the smallest validation slice that proves the security model, not just the happy path.
  • Test hostile or misuse scenarios:
    • tampered token
    • expired token
    • replayed token
    • wrong tenant
    • alternate entry path
    • delegated third party exceeding scope
    • replaced or untrusted public key
  • Validate both correctness and operational usability.
  • Compare candidate models by:
    • expressiveness
    • management cost
    • developer friction
    • runtime cost
    • blast radius of mistakes
  • Prefer the model that removes whole classes of mistakes rather than one that depends on every developer remembering every check.

Design Checks

  • Revisit the design if authentication and authorization are being treated as the same thing.
  • Revisit the design if security depends on hiding a custom algorithm.
  • Revisit the design if private-key protection is vague or hand-waved.
  • Revisit the design if a valid token can be replayed freely and that still causes damage.
  • Revisit the design if permission checks exist only in UI or menu code.
  • Revisit the design if the same data can be reached through two paths with inconsistent permission behavior.
  • Revisit the design if tenant isolation depends on every caller remembering the right filter.
  • Revisit the permission model if management complexity is exploding faster than feature count.
  • Revisit the caching strategy if permission checks are too frequent and too granular to scale.
  • Revisit the ops model if you cannot rotate keys, audit decisions, or revoke compromised credentials cleanly.

Default Output Shape

When the user asks for security or permission design, respond in this order unless they request another structure:

  1. Problem Analysis
  2. Trust Boundary And Threat Model
  3. Identity And Authentication
  4. Authorization Model
  5. Token, Key, And Credential Design
  6. Enforcement Boundaries
  7. Permission Management And Scaling
  8. Operational Controls And Audit
  9. POC
  10. Evaluation
  11. Risks And Refactor Triggers

Use these expectations for each section:

  • Problem Analysis: define what is protected, the hostile scenarios, and the key quality requirement.
  • Trust Boundary And Threat Model: define who is trusted, what is untrusted, and what attacks or misuse matter.
  • Identity And Authentication: define subject types and how identity is established.
  • Authorization Model: define subject, role, permission, policy, scope, and delegation shape.
  • Token, Key, And Credential Design: define token contents, signing or hashing approach, expiry, replay defense, and key distribution.
  • Enforcement Boundaries: define where decisions are enforced and how alternate paths are covered.
  • Permission Management And Scaling: define management structure, caching or grouping strategy, and precision-vs-cost tradeoff.
  • Operational Controls And Audit: define rotation, revocation, logging, and admin operations.
  • POC: propose hostile-path validation, not only normal-path checks.
  • Evaluation: compare options and state why one model should be adopted.
  • Risks And Refactor Triggers: name assumptions that would invalidate the current model later.

References

  • Read references/credential-and-signature-principles.md when the task involves license tokens, API tokens, signatures, key management, replay defense, or offline trust verification.
  • Read references/security-by-design-principles.md when the task is about security as a quality requirement, framework choice, or why standard mechanisms beat custom shortcuts.
  • Read references/api-security-model-principles.md when the task is about public APIs, multi-tenant authorization, partner access, or choosing control dimensions for API security.
  • Read references/permission-model-principles.md when the task is about RBAC, permission systems, policy design, management complexity, caching, or application-level authorization interfaces.
  • Keep article-specific notes in references/.
  • Promote only stable cross-article guidance back into this SKILL.md.

同梱ファイル

スキルが読み込まれている間、モデルは必要に応じてこれらを読み取ります。読み取り可能なファイルとして提供され、実行されることはありません。

よくある質問

AIスキル「Security Permission Design」では何ができますか?

アプリケーションやAPI向けに、Andrew流の認証、認可、権限、信頼境界の仕組みを設計します。Codexで、セキュリティ・バイ・デザインの考え方、トークンまたはキーに基づく信頼モデル、権限システムのアーキテクチャ、RBACやポリシーの設計、リプレイ攻撃対策と署名方式の選択、マルチテナントの認可境界、運用上の強制措置や監査の検討が必要な場合に使用してください。

TypingMindでSecurity Permission Designを使うメリットは何ですか?

一度インストールすれば、どのモデルでも使えるからです。Security Permission Designはプロバイダー固有のコードではなく、通常のMarkdownで記述されているため、同じスキルをGPT-5、Claude、Gemini、Grok、ローカルモデルで利用できます。チャットの途中でモデルを切り替えても、そのまま使い続けられます。TypingMindは自分のAPIキーで動作するため、シート単位のサブスクリプションではなく、プロバイダーに直接料金を支払います。スキルとチャットは自分のストレージに保持されます。

TypingMindにSecurity Permission Designをインストールするにはどうすればよいですか?

TypingMindで「プラグイン」→「スキル」→「GitHubからインストール」を開き、https://github.com/andrew0928/andrew-skills/tree/main/plugins/architect/skills/security-permission-designを貼り付けてください。TypingMindがSKILL.mdを読み込み、関連ファイルをまとめて、チャットごとに有効にできるスキルとしてインストールします。

Security Permission Designを使えるAIモデルはどれですか?

TypingMindに接続したどのモデルでも利用できます。AIスキルはプロバイダー固有のコードではなく、通常のMarkdownで書かれた指示です。そのため、GPT、Claude、Gemini、Grok、ローカルモデルのいずれも、リクエストの内容がこのスキルの用途に合ったときに、このスキルを読み込めます。

Security Permission Designで使えるAIモデルの数に制限はありますか?

数に制限はありません。スキルに対応したモデルであれば、GPT、Claude、Gemini、Grok、DeepSeek、Mistral、Llamaなど、どのモデルでもSecurity Permission Designを利用できます。すべてTypingMind上で、自分のAPIキーを使って利用できます。

AIスキル「Security Permission Design」は無料ですか?

andrew0928がGitHubで公開しています。ライセンス条件はリポジトリでご確認ください。ご利用のAIプロバイダーに支払うのは、使用したトークンの料金だけです。

AIスキルとは何ですか?

AIスキルは、特定のタスクの実行方法をAIモデルに教える、再利用可能な指示のセットです。オープンなAgent Skills形式に従い、名前と説明を含むSKILL.mdファイルに加え、モデルが必要とするスクリプト、テンプレート、参照ファイルで構成されます。モデルはリクエストがスキルに合致したときだけ指示を読み込むため、インストール済みのスキルも、使うまでは費用がかかりません。

AIスキルは、プラグインやMCPサーバーとどう違いますか?

プラグインやMCPサーバーは、モデルが呼び出せる新しいツールを提供します。ツールとは、どこかで実行され、結果を返すコードです。一方、AIスキルは、タスクへの取り組み方、従うべき手順、望ましい出力の例といった知識や進め方をモデルに伝えます。スキルは通常のMarkdownで記述されているため、サーバー、APIキー、実行環境は不要で、どのモデルでも利用できます。

すべて見る

今すぐ自分専用のAIワークスペースを作成

ニュースレターに登録すると、新機能や今後のプレゼント企画のお知らせが届きます👇