Security Permission Design logo

Security Permission Design

Community
andrew0928
security-permission-design

Design Andrew-style authentication, authorization, permission, and trust-boundary mechanisms for applications and APIs. Use when Codex needs security-by-design thinking, token or key-based trust models, permission-system architecture, RBAC or policy design, anti-replay and signature choices, multi-tenant authorization boundaries, or operational enforcement and audit considerations.

Overview

Publisherandrew0928
Repositoryandrew-skills
Skill namesecurity-permission-design
Stars
36
Forks
6
Bundled files
6
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • 6 bundled files

    Scripts, templates, and references the model can read while it works. Files are read-only and never executed.

  • Open source

    Published by andrew0928 on GitHub. Read the source before you install it.

Installation

Install the Security Permission Design AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/andrew0928/andrew-skills/tree/main/plugins/architect/skills/security-permission-design
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

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
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Security Permission Design in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Security Permission Design on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Security Permission Design is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

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.

Bundled files

The model reads these on demand while the skill is loaded. They are exposed as readable files and are never executed.

Frequently asked questions

What does the Security Permission Design AI skill do?

Design Andrew-style authentication, authorization, permission, and trust-boundary mechanisms for applications and APIs. Use when Codex needs security-by-design thinking, token or key-based trust models, permission-system architecture, RBAC or policy design, anti-replay and signature choices, multi-tenant authorization boundaries, or operational enforcement and audit considerations.

Why use Security Permission Design on TypingMind?

Because you install it once and use it with any model. Security Permission Design is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Security Permission Design in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/andrew0928/andrew-skills/tree/main/plugins/architect/skills/security-permission-design. TypingMind reads its SKILL.md and bundles its files and installs it as a skill you can enable per chat.

Which AI models can use Security Permission Design?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Security Permission Design?

As many as you like. As long as a model supports skills, you can use Security Permission Design with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Security Permission Design AI skill free?

It is published on GitHub by andrew0928. Check the repository for licensing terms. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇