Logo: Security Permission Design

Security Permission Design

Communautéit
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.

Iwwersiicht

Editeurandrew0928
Repositoryandrew-skills
Skill-Nummsecurity-permission-design
Stären
36
Forks
6
Matgeliwwert Dateien
6
Linken
  • Instruktiounen am Markdown-Format

    Eng SKILL.md-Datei, déi de Modell bei Bedarf luet, soudatt nëmmen Token ufalen, wann eng Ufro tatsächlech dozou passt.

  • Funktionéiert mat all LLM

    KI-Skills si reng Markdown, keen ubidderspezifesche Code. Dofir funktionéiert dëse Skill mat GPT, Claude, Gemini, Grok oder engem lokale Modell.

  • 6 matgeliwwert Dateien

    Skripten, Virlagen a Referenzen, déi de Modell beim Schaffe liese kann. D'Dateie kënnen nëmme gelies ginn a ginn ni ausgeféiert.

  • Open Source

    andrew0928 huet de Skill op GitHub verëffentlecht. Liest de Quelltext, ier Dir de Skill installéiert.

Installatioun

Installéiert de KI-Skill Security Permission Design an TypingMind, fir e mat all LLM ze benotzen, oder setzt en an en anere KI-Agent an, deen SKILL.md liest.

1

An TypingMind installéieren

TypingMind installéiert e Skill direkt aus sengem GitHub-Dossier — dobäi gëtt SKILL.md gelies, d'Ressourcedateie gi gebëndelt an d'Resultat gëtt lokal gespäichert.

  1. Maacht d'App op a gitt op Plugins → Skills.
  2. Wielt „Vu GitHub installéieren“.
  3. Pecht d'URL vum Skill-Dossier, déi hei drënner steet, an a bestätegt d'Installatioun.
    https://github.com/andrew0928/andrew-skills/tree/main/plugins/architect/skills/security-permission-design
  4. Aktivéiert de Skill an all Chat, an deem Dir e benotze wëllt.
Plugins → Skills → Skill derbäisetzen → Iwwer eng GitHub-URL. Pecht dann d'URL vum Dossier an a klickt op Weider.
2

An engem anere KI-Agent installéieren

All KI-Agent, deen d'Format Agent Skills liest, kann dëse Skill benotzen — kopéiert den Dossier an d'Skill-Verzeechnes vun deem KI-Agent.

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
Start Claude Code nom Kopéieren nei, fir datt den neie Skill erkannt gëtt.

An TypingMind benotzen

Aktivéiert Security Permission Design an engem Chat vun TypingMind, an de Modell iwwerhëlt de Rescht. Den Numm an d'Beschreiwung stinn am System-Prompt. Soubal eng Ufro dozou passt, luet de Modell déi komplett Instruktioune selwer — Dir musst de Skill ni manuell opruffen, an et fale keng Token un, bis en tatsächlech benotzt gëtt.

De Modell luet Security Permission Design automatesch, soubal eng Ufro dozou passt.

Funktionéiert mat all KI-Modell

KI-Skills si reng Markdown-Instruktiounen amplaz vun ubidderspezifeschem Code. Dofir ass Security Permission Design net un de Modell gebonnen, fir deen de Skill geschriwwe gouf. Installéiert en eemol an TypingMind a benotzt e mat GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama oder engem lokale Modell, deen Dir selwer bedreift — alles mat Ären eegenen API-Schlësselen.

  • Gëtt nëmme gelueden, wann et néideg ass

    De System-Prompt enthält nëmmen den Numm an d'Beschreiwung. D'Instruktioune gi bei der éischter passender Ufro gelueden, soudatt en onbenotzte Skill näischt kascht.

  • De Modell am lafende Chat wiesselen

    Well de Skill aus Instruktiounen amplaz vu Code besteet, funktionéiert en och no engem Modellwiessel — den nächste Modell liest déi selwecht SKILL.md-Datei.

Skill-Instruktiounen

Dëst ass den Inhalt vu SKILL.md, deen de Modell luet. Liest e virun der Installatioun — e Skill besteet aus Instruktiounen, déi Äre Modell befollegt.

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.

Matgeliwwert Dateien

De Modell liest dës Dateie bei Bedarf, wärend de Skill gelueden ass. Si ginn als liesbar Dateie bereetgestallt a ginn ni ausgeféiert.

Heefeg gestallte Froen

Wat mécht de KI-Skill 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.

Firwat Security Permission Design op TypingMind benotzen?

Well Dir en eemol installéiert a mat all Modell benotze kënnt. Security Permission Design besteet aus einfachem Markdown amplaz vun ubidderspezifeschem Code. Dee selwechte Skill funktionéiert also mat GPT-5, Claude, Gemini, Grok oder engem lokale Modell – an Dir kënnt de Modell matzen am Chat wiesselen, ouni datt de Skill ophält ze funktionéieren. TypingMind benotzt Är eegen API-Schlësselen, sou datt Dir d'Ubidder direkt bezuelt, amplaz en Abonnement pro Benotzerplaz ze bezuelen. Är Skills a Chats bleiwen an Ärem eegene Späicher.

Wéi installéieren ech Security Permission Design an TypingMind?

Maacht an TypingMind Plugins → Skills → Vu GitHub installéieren op a setzt https://github.com/andrew0928/andrew-skills/tree/main/plugins/architect/skills/security-permission-design an. TypingMind liest d'Datei SKILL.md, bëndelt déi zougehéiereg Dateien an installéiert dat Ganzt als Skill, deen Dir pro Chat aktivéiere kënnt.

Wéi eng KI-Modeller kënnen Security Permission Design benotzen?

All Modell, deen Dir an TypingMind verbënnt. KI-Skills sinn einfach Markdown-Instruktiounen an net ubidderspezifesche Code. Dofir kënne GPT, Claude, Gemini, Grok a lokal Modeller dëse Skill lueden, wann eng Ufro dozou passt.

Wéi vill KI-Modeller kann ech mat Security Permission Design benotzen?

Esou vill wéi Dir wëllt. Soulaang e Modell Skills ënnerstëtzt, kënnt Dir Security Permission Design domat benotzen – zum Beispill mat GPT, Claude, Gemini, Grok, DeepSeek, Mistral oder Llama – alles op TypingMind mat Ären eegenen API-Schlësselen.

Ass de KI-Skill Security Permission Design gratis?

andrew0928 huet de Skill op GitHub publizéiert. Kuckt am Repository no de Lizenzbedéngungen. Dir bezuelt nëmmen Ären eegene KI-Ubidder fir d'Token, déi Dir benotzt.

Wat si KI-Skills?

E KI-Skill ass e weiderverwendbare Pak vun Instruktiounen, deen engem KI-Modell bäibréngt, wéi en eng bestëmmt Aufgab erfëllt. E follegt dem oppenen Agent Skills-Format: eng Datei SKILL.md mat engem Numm an enger Beschreiwung, plus all Scripten, Virlagen oder Referenzdateien, déi de Modell eventuell brauch. De Modell liest d'Instruktiounen eréischt, wann Är Ufro zum Skill passt. En installéierte Skill kascht also näischt, bis e benotzt gëtt.

Wéi ënnerscheede sech KI-Skills vu Plugins oder MCP-Serveren?

E Plugin oder MCP-Server gëtt engem Modell nei Tools, déi en opruffe kann – Code, deen iergendwou leeft an e Resultat zeréckgëtt. E KI-Skill gëtt dem Modell dogéint Wëssen an eng Virgoensweis: wéi en eng Aufgab ugeet, wéi eng Schrëtt e maache soll a wéi eng gutt Ausgab ausgesäit. Skills bestinn aus einfachem Markdown, brauche kee Server, keen API-Schlëssel a kee Lafzäitëmfeld a funktionéiere mat all Modell.

Alleguer weisen

Elo Ären eegene KI-Aarbechtsberäich ariichten

Abonnéiert Iech op eisen Newsletter, fir iwwer nei Funktiounen an zukünfteg Gewënnspiller informéiert ze ginn 👇