[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M735M9R050KT3H34PVXN2MKK":3,"skill-same:01M735M9R050KT3H34PVXN2MKK":51},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":29,"commitSha":30,"skillDirectory":31,"forksCount":14,"repositoryHtmlUrl":32,"repositoryHomepageUrl":6,"ownerHtmlUrl":33,"ownerBlogUrl":34,"ownerDescription":35,"updatedAt":36,"install":37,"resources":50},"01M735M9R050KT3H34PVXN2MKK","security-design",null,"Write specs\u002Fdesign\u002Fsecurity.json when a design has sign-in, permissions, roles or test users — the permission catalog every API operation is gated on.","wso2\u002Flabs-agentic-engineer","wso2","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F533043?v=4","01M6CDAFS40T9Y86DYXWE0NJES","WSO2","01M735EE4N2PP2ZR56AX7DNPNP",24,"Apache-2.0","https:\u002F\u002Fgithub.com\u002Fwso2\u002Flabs-agentic-engineer\u002Fblob\u002Fmain\u002Fskills\u002Fsecurity-design\u002FSKILL.md",[],[],"2026-11-11 15:11:14",false,"---\nname: security-design\ndescription: \"Write specs\u002Fdesign\u002Fsecurity.json when a design has sign-in, permissions, roles or test users — the permission catalog every API operation is gated on.\"\nmetadata:\n  aep:\n    kind: platform\n    audience: [design]\n---\n\n# Security design\n\nWrite `specs\u002Fdesign\u002Fsecurity.json` when the design has sign-in, permissions or\ntest users. It is the **permission catalog** for the project: every scope an\noperation requires and every role the platform provisions is authored here and\nreferenced everywhere else. `openapi.yaml` references handles from this file; it\nnever defines them. Nothing about screens is written here: a screen is gated by\nthe operation it loads, whose one handle is already in `openapi.yaml`\n(`authorization-model` states the invariants this file lives under).\n\nThere is exactly **one** control point. A caller's permissions are the\nintersection of the roles their groups hold with the resource server the token\nis asked for — group → role → granted permissions. Nothing else narrows: the\nOAuth client's own scope allowlist is written for truthfulness and is **not a\ngate** (the identity provider stores it, returns it, and ignores it), and an\nunknown or ungranted handle is dropped from a token silently — no error, no\nruntime signal. This file, and the gate that checks it, is the only defence\nagainst a scope nobody can hold.\n\nThe platform provisions from it at Build (resource server, actions, project\nroles, group bindings, test users) and the console renders it as the Security\npage. `architecture` declares the `thunder-app` dependency on the SPA and each\nprotected API; this file says what the people who sign in through it may do.\n\n---\n\n## Build the catalog from the PRD's capabilities\n\nWalk the PRD's capabilities, not its endpoints:\n\n- **One resource per business object** the app protects — `claims`, `reports`.\n  Each is owned by exactly **one** service component, named in `component`.\n  Moving an endpoint between services later does not rename a scope.\n- **One action per capability** — `submit`, `approve`, `reject`, `export`. The\n  grain is the capability, not the operation and not read\u002Fwrite per service.\n  Several operations may require the same handle; every operation requires\n  exactly one.\n- A handle is `\u003Cresource>:\u003Caction>`, unique in the project. Each segment is\n  `[a-z][a-z0-9-]*`.\n\n**An action says what a caller may do. Which rows it reaches is not in this\nfile.** Reach is the operation's **path** in `openapi.yaml`: an operation under\n`\u002Fme\u002F` reaches the caller's rows (or, through a relation noun, rows of theirs —\n`\u002Fme\u002Fteam\u002Fclaims`); an operation anywhere else reaches every row. So a\ncapability that exists at two reaches is **two actions** guarding two\noperations — `read` on `GET \u002Fme\u002Fclaims` and `read-all` on `GET \u002Fclaims` — and\nnothing about either action says so; the paths do. `openapi-conventions` owns\nthe rule and the gate that refuses one handle guarding both sides of `\u002Fme\u002F`.\nThere is no `ownership`, no `own`\u002F`any`, and no widening: a role that needs both\nreaches holds both handles, and nothing implies anything.\n\nName the every-row action so a reader can tell it from the caller's-rows one\n(`read-all`, `manage`, `export`), and keep the description honest about it —\n\"every claim\", not \"claims\". The Security page shows each handle's reach beside\nit, read off the contract; a description that contradicts the path is the one\nthing the page cannot catch.\n\n`openid`, `profile`, `email`, `group` and `ou` are reserved OIDC scopes. They\nride every access token, so one of them as a handle would admit every signed-in\nperson in the organisation. They can never be a resource or an action.\n\n## Reuse a group before you declare one\n\nA **role** is the project's: it is created per project, its permission set is\nreplaced on every build, and its name is a PRD actor noun (`Approver`), unique\nin the project, never a group name. A **group** is the organisation's: it is a\nset of people, shared across projects, and the platform creates it but never\nrenames or deletes it.\n\nThe binding between the two is `assignTo`, and it is a **declared decision**,\nnot a name match. So reuse is deliberate:\n\n**Call `list_groups` before you write a single `groups[]` entry.** It lists the\ndirectory's groups with `memberCount`, `projects` (how many projects already\nbind roles to it) and `platformCreated`. Reuse a name verbatim when the people\nthe role is for **already form that group** — `Finance` beats a fresh\n`Approvers` that means the same people — and declare a new group in `groups[]`\nonly when no existing one is those people. A group already in the directory is\nnever redeclared.\n\nThe tool's own description says what each field means; it is the contract\nbetween the tool and this skill, and it is not copied here — the two ship on\ndifferent clocks and a copy would go stale with nothing to catch it.\n\nA group with `platformCreated: false` was made by hand. Bind to one only when it\ngenuinely is the population the role is for.\n\n**Whether a new group may be introduced at all is the organisation's call, not\nthis skill's.** `organization`'s **Security & compliance** section holds it,\nalong with the groups this org prefers and the ones a role may never be assigned\nto. Read it before you write `groups[]`: a filled line there is the decision.\n\n## Every PRD actor gets a role, and no role exists without an actor\n\nRoles come from the PRD's Actors section. Define no role the PRD has no actor\nfor, and give every actor a row. **When the actor noun is also the group's name**\n— a PRD actor `Finance` whose people are the org's `Finance` group — the group\nkeeps the name and the role takes what the actor DOES here (`FinanceReviewer`),\nnaming the actor in its `description`. A role and a group cannot share a name,\nand the group's is the organisation's to keep. Each role cites in `stories` the IDs\nof the stories it serves (`\"F1.2\"`) — **at least one, and the build gate checks\none direction only**: every story a role cites must be a real story in the\nfeature files, or the design and the requirements have drifted. The reverse is\nnot checked here — a story no role names is not an error, because coverage is\ncarried by each component's\n`design.json` `stories`, not by this file. So read the stories once more before\nyou finish and ask whether an actor-bearing story is really served by the role\nyou gave it.\n\n## Grants follow the screens' loads\n\nScopes are compared as whole strings, everywhere — the gateway and the\ndirectory. Nothing implies anything: a token carrying `claims:read-all` is\nrefused by an operation that requires `claims:read`.\n\nA screen is reachable for whoever holds the scope of the operation it **loads**\n— the list or detail call whose answer the screen renders on open. Nothing\nabout that is written here: the SPA reads it off `openapi.yaml`. What this file\ndecides is whether each role holds that scope. So for a role's `grants`, walk\neach flow that the web application's prototype gives that role\n(`prototype.json` `flows`), open the `openapi.yaml` of the component behind\neach screen in it, and grant the handle of the operation each screen loads — at\nthe reach the screen shows. The design writes this file before the prototype\nand the contracts exist: grant then what each role's stories need, and the\ndesign's grants pass does this walk when the screens and the operations exist. An\nApprovals queue that lists every claim loads `GET \u002Fclaims`, so the Approver\nholds `claims:read-all`; a My Claims page loads `GET \u002Fme\u002Fclaims`, so the\nEmployee holds `claims:read`. Then grant the actions the screen's controls call.\n\nNo gate refuses a role that is one handle short at design time; the build's\nmock walk does, opening each flow's entry screen as its role and naming the\nscreen, the operation and the handle it wanted. On a plane where the gateway\nanswers **401** for every failure — no token, expired token, missing scope, all\nbyte-identical — the same omission in a deployed app is not a tidy 403 either:\nthe SPA hides the screen, or a typed URL lands on `Forbidden`, and the fix is\none more entry in `grants`.\n\n**One scope per operation is the invariant this guidance protects.** Never\npropose listing alternatives on an operation, and never ask for a handle to\nimply another.\n\n## Every user role gets a test user\n\nA test user is an account that exists so a role's behaviour can be exercised —\nthe validation agent signs in as one to judge role-gated acceptance criteria.\nThe platform generates its password at Build, seals it, and publishes it in the\nRoles gate ticket beside that role's granted scopes; that ticket is where the\nvalidation agent reads its login. A test user is a **disposable account for\nautomated agents**, readable by anyone who can read the repository — never a\nperson's account.\n\nEmit one per `kind: user` role, whatever its enrolment, named `test-\u003Crole-slug>`\n(`Compliance Admin` → `test-compliance-admin`), so the user sees them in\nSecurity and can rename them before Build. **The platform supplies any you\nomit**, so a missing test user is never a blocked build — but naming them\nyourself is what lets the user recognise and change them. `roles` is a list: a\nuser holding two roles is how the design exercises somebody who both files and\napproves.\n\n**A self-service role gets one too** — `enrolment` says how real accounts\narrive, never whether the role can be exercised (`authorization-model`).\nOnly `kind: service` roles get none: their principal is an application.\n\nA username the platform did not create (`jsmith`) is a refusal, not a password\nreset: that role has no working login, and a real person's name lands in a\npublished ticket. Invent no password anywhere in the design; there is no\nproperty at any level where one could go, and a write that adds one is rejected.\n\n## The file\n\n```json\n{\n  \"version\": 3,\n  \"permissions\": [\n    {\n      \"resource\": \"claims\",\n      \"component\": \"expense-api\",\n      \"description\": \"Expense claims and their approval\",\n      \"actions\": [\n        { \"handle\": \"read\",     \"description\": \"The caller's own claims\" },\n        { \"handle\": \"read-all\", \"description\": \"Every claim\" },\n        { \"handle\": \"submit\",   \"description\": \"Create and send a claim\" },\n        { \"handle\": \"approve\",  \"description\": \"Approve a submitted claim\" },\n        { \"handle\": \"reject\",   \"description\": \"Reject a submitted claim\" }\n      ]\n    },\n    {\n      \"resource\": \"reports\",\n      \"component\": \"expense-api\",\n      \"actions\": [\n        { \"handle\": \"read\",   \"description\": \"Monthly totals\" },\n        { \"handle\": \"export\", \"description\": \"Download CSV\" }\n      ]\n    }\n  ],\n  \"groups\": [\n    { \"name\": \"Employees\", \"description\": \"Everyone on payroll\" }\n  ],\n  \"roles\": [\n    {\n      \"name\": \"Employee\",\n      \"description\": \"Submits and follows their own claims.\",\n      \"stories\": [\"F1.1\", \"F1.2\", \"F1.3\"],\n      \"grants\": [\"claims:read\", \"claims:submit\"],\n      \"assignTo\": [\"Employees\"]\n    },\n    {\n      \"name\": \"Approver\",\n      \"description\": \"Approves or rejects submitted claims and reads monthly reports.\",\n      \"stories\": [\"F2.1\", \"F2.2\", \"F2.3\", \"F3.1\"],\n      \"grants\": [\"claims:read\", \"claims:read-all\", \"claims:approve\", \"claims:reject\", \"reports:read\"],\n      \"assignTo\": [\"Finance\"],\n      \"assignableBy\": [\"Approver\"]\n    }\n  ],\n  \"testUsers\": [\n    { \"username\": \"test-employee\", \"roles\": [\"Employee\"] },\n    { \"username\": \"test-approver\", \"roles\": [\"Approver\"] }\n  ]\n}\n```\n\n`Finance` is not in `groups[]`: `list_groups` returned it, so `Approver` is\nassigned to the people who already are Finance. `Employees` is new to this\nproject and is declared. `Approver` grants `claims:read-all` because the\nApprovals screen loads `GET \u002Fclaims` — every claim — and `claims:read` because\nan approver has claims of their own too; neither grant is implied by the other,\nand the `openapi.yaml` beside this file is where `GET \u002Fme\u002Fclaims` and\n`GET \u002Fclaims` say which rows each returns. No screen is named in this file: the\nSPA gates each one on the operation it loads.\n\n| Field | Rule |\n|---|---|\n| `version` | Always `3`. |\n| `permissions[]` | The catalog. `resource` unique in the project; `component` names a `service` in the cell; at least one action; action handles unique within their resource (`claims:read` and `reports:read` legally coexist). |\n| `groups[]` | Organisation groups this project introduces: `name`, `description`. Created if absent, never renamed or deleted. A group already in the directory is not redeclared. |\n| `roles[].name` | A PRD actor noun, unique in the project (case-insensitively), never a group name. It becomes `\u003Cproject>\u002F\u003Cname>` on the directory. |\n| `roles[].description` | What the role does and what it never sees or does, in plain words (see below). Project-owned: the platform writes it on every build. |\n| `roles[].stories` | Story IDs (`\"F2.3\"`) this role serves. At least one. |\n| `roles[].grants` | Handles from `permissions[]`. At least one. A handle no role grants is a warning (\"unreachable by any role\"); a handle no operation requires is a warning (\"declared, used nowhere\"). |\n| `roles[].assignTo` | Organisation groups the role is assigned to. Each must be declared in `groups[]` or exist in the directory (`list_groups`) — anything else is refused, so a typo cannot create a group. Required for `enrolment: admin` user roles; absent for self-service and service roles. |\n| `roles[].enrolment` | Optional. `admin` (default) or `self-service`. See **self-service actors**. |\n| `roles[].assignableBy` | Optional role names, validated against `roles[]`. Records who may hand this role out. |\n| `roles[].kind` | Optional. `user` (default) or `service`. A service role is assigned to an application principal, never to a group, and gets no test user. |\n| `testUsers[].username` | Lowercase letters, digits, `.`, `_`, `-`. |\n| `testUsers[].roles` | One or more declared `kind: user` roles, of either enrolment. The account is enrolled in every `assignTo` group of every role listed; a role with no `assignTo` is bound to the account directly. |\n\n**The descriptions are what a business reviewer checks.** The console shows\nRoles and permissions from the descriptions of the roles and the actions, above\nthe grants. So write each one in plain words, with its limits. A role's\n`description` says what the role does and what it never sees or does:\n\"Approves or rejects the claims of their own team, never their own. Sees no\nother team's claims.\" An action's `description` says what it lets a caller do,\nand to which records: \"Every claim\", \"The caller's own claims\". A limit that no\nscreen can show, such as what a role never sees, is written only here.\n\n**A role that reaches rows by path gets two test users, not one.** Where a role\ngrants a `\u002Fme\u002F` operation, the thing worth proving is that one caller cannot see\nanother's rows — and a single account per role makes that unprovable everywhere\ndownstream: the mock walk, a wired run and validation alike can only ever check\nthe caller against themselves. A second account is what gives the isolation\nsomething to fail against.\n\nA self-service role is usually the `\u002Fme\u002F` actor, and the platform supplies only\none login per role — so the pair is yours to author or isolation goes unproven.\n\nNothing else goes in the file. There is no `screens[]`, no `ownership`, no\n`coldStartRole`, no `publicComponents`, no `thunder` block, no `grantedBy`:\nwhich rows an operation reaches is its path, a component is protected because\nit depends on sign-in, an operation is public because its `security` is empty,\na screen is gated by the operation it loads and is public when its flow carries\nno `role`, the OAuth client's name and scope list are derived, and\n`assignableBy` records who hands a role out. A document that carries\n`screens[]` is refused with the key named.\n\n## The signed-in baseline\n\nThere is no role a caller falls back to. A person whose groups hold no project\nrole gets a valid token with the OIDC scopes and **no permission scopes** — and\nthat is a designed state, not a hole:\n\n- **Operations every signed-in person may call** are the baseline: an operation\n  with no `security` override inherits the document default and needs a valid\n  token and no scope. `GET \u002Fme` is the usual one. Nothing in this file declares\n  them; `openapi.yaml` does, by saying nothing.\n- **Screens** work the same way: a screen whose load operation is one of\n  those, or that loads nothing, is every signed-in user's.\n- A caller who can reach **nothing** sees the SPA's `NoAccess` page — signed in,\n  told which groups would help, given their username to quote — instead of an\n  empty shell. The API agrees with it: the same scope is missing at both ends.\n\nInferring a role from the absence of one is fail-open, which is why the platform\ndoes not do it. Real people are admin-created (somebody adds them to a group) or\nself-registered.\n\n## Self-service actors\n\nAn actor the organisation does not enrol — a Patient booking an appointment, a\ncustomer opening an account — gets `\"enrolment\": \"self-service\"` and **no**\n`assignTo`. A registration flow assigns the role at account creation, which is\nthe legitimate cold start and a concept every identity provider has. Such a role\ngets no group binding.\n\nIt still gets test users, two where the role reaches `\u002Fme\u002F` rows.\n\nUse it only where the PRD genuinely describes people who sign themselves up,\nand only where `organization`'s **Security & compliance** section permits it.\nEverything else is `admin`.\n\n**The platform provisions no registration flow today**, so those test logins are\nthe role's only principals and no sign-up affordance appears on the sign-in\npage. `authorization-model` invariant 11 has the consequence for criteria.\n\n## What the user has to know about a grant change\n\nA refresh **narrows and never widens**. A grant removed from a role disappears\nfrom the caller's token at the next silent renew; a grant **added** to a role —\nor a person added to a group — does not appear until they sign out and sign in\nagain. Say so wherever the design explains an access change; it is the first\nthing an operator hits after adding somebody to a group, and it looks exactly\nlike a broken deployment.\n\n---\n\nThe `organization` skill's Security & compliance and Authentication defaults\napply before you invent policy — a filled org entry is the decision. Nothing\nhere creates anything: the platform creates the resource server, the roles, the\ngroups and the test users when the user clicks Build. `openapi-conventions` owns\nhow an operation names a handle and which rows it reaches (its path),\n`prototype` owns which screens exist and which role's flow walks them,\n`thunder-authentication` owns how the SPA gates each screen on the operation it\nloads; this skill owns the decisions all three consume, and\n`authorization-model` states the invariants they share.\n","# Security design\n\nWrite `specs\u002Fdesign\u002Fsecurity.json` when the design has sign-in, permissions or\ntest users. It is the **permission catalog** for the project: every scope an\noperation requires and every role the platform provisions is authored here and\nreferenced everywhere else. `openapi.yaml` references handles from this file; it\nnever defines them. Nothing about screens is written here: a screen is gated by\nthe operation it loads, whose one handle is already in `openapi.yaml`\n(`authorization-model` states the invariants this file lives under).\n\nThere is exactly **one** control point. A caller's permissions are the\nintersection of the roles their groups hold with the resource server the token\nis asked for — group → role → granted permissions. Nothing else narrows: the\nOAuth client's own scope allowlist is written for truthfulness and is **not a\ngate** (the identity provider stores it, returns it, and ignores it), and an\nunknown or ungranted handle is dropped from a token silently — no error, no\nruntime signal. This file, and the gate that checks it, is the only defence\nagainst a scope nobody can hold.\n\nThe platform provisions from it at Build (resource server, actions, project\nroles, group bindings, test users) and the console renders it as the Security\npage. `architecture` declares the `thunder-app` dependency on the SPA and each\nprotected API; this file says what the people who sign in through it may do.\n\n---\n\n## Build the catalog from the PRD's capabilities\n\nWalk the PRD's capabilities, not its endpoints:\n\n- **One resource per business object** the app protects — `claims`, `reports`.\n  Each is owned by exactly **one** service component, named in `component`.\n  Moving an endpoint between services later does not rename a scope.\n- **One action per capability** — `submit`, `approve`, `reject`, `export`. The\n  grain is the capability, not the operation and not read\u002Fwrite per service.\n  Several operations may require the same handle; every operation requires\n  exactly one.\n- A handle is `\u003Cresource>:\u003Caction>`, unique in the project. Each segment is\n  `[a-z][a-z0-9-]*`.\n\n**An action says what a caller may do. Which rows it reaches is not in this\nfile.** Reach is the operation's **path** in `openapi.yaml`: an operation under\n`\u002Fme\u002F` reaches the caller's rows (or, through a relation noun, rows of theirs —\n`\u002Fme\u002Fteam\u002Fclaims`); an operation anywhere else reaches every row. So a\ncapability that exists at two reaches is **two actions** guarding two\noperations — `read` on `GET \u002Fme\u002Fclaims` and `read-all` on `GET \u002Fclaims` — and\nnothing about either action says so; the paths do. `openapi-conventions` owns\nthe rule and the gate that refuses one handle guarding both sides of `\u002Fme\u002F`.\nThere is no `ownership`, no `own`\u002F`any`, and no widening: a role that needs both\nreaches holds both handles, and nothing implies anything.\n\nName the every-row action so a reader can tell it from the caller's-rows one\n(`read-all`, `manage`, `export`), and keep the description honest about it —\n\"every claim\", not \"claims\". The Security page shows each handle's reach beside\nit, read off the contract; a description that contradicts the path is the one\nthing the page cannot catch.\n\n`openid`, `profile`, `email`, `group` and `ou` are reserved OIDC scopes. They\nride every access token, so one of them as a handle would admit every signed-in\nperson in the organisation. They can never be a resource or an action.\n\n## Reuse a group before you declare one\n\nA **role** is the project's: it is created per project, its permission set is\nreplaced on every build, and its name is a PRD actor noun (`Approver`), unique\nin the project, never a group name. A **group** is the organisation's: it is a\nset of people, shared across projects, and the platform creates it but never\nrenames or deletes it.\n\nThe binding between the two is `assignTo`, and it is a **declared decision**,\nnot a name match. So reuse is deliberate:\n\n**Call `list_groups` before you write a single `groups[]` entry.** It lists the\ndirectory's groups with `memberCount`, `projects` (how many projects already\nbind roles to it) and `platformCreated`. Reuse a name verbatim when the people\nthe role is for **already form that group** — `Finance` beats a fresh\n`Approvers` that means the same people — and declare a new group in `groups[]`\nonly when no existing one is those people. A group already in the directory is\nnever redeclared.\n\nThe tool's own description says what each field means; it is the contract\nbetween the tool and this skill, and it is not copied here — the two ship on\ndifferent clocks and a copy would go stale with nothing to catch it.\n\nA group with `platformCreated: false` was made by hand. Bind to one only when it\ngenuinely is the population the role is for.\n\n**Whether a new group may be introduced at all is the organisation's call, not\nthis skill's.** `organization`'s **Security & compliance** section holds it,\nalong with the groups this org prefers and the ones a role may never be assigned\nto. Read it before you write `groups[]`: a filled line there is the decision.\n\n## Every PRD actor gets a role, and no role exists without an actor\n\nRoles come from the PRD's Actors section. Define no role the PRD has no actor\nfor, and give every actor a row. **When the actor noun is also the group's name**\n— a PRD actor `Finance` whose people are the org's `Finance` group — the group\nkeeps the name and the role takes what the actor DOES here (`FinanceReviewer`),\nnaming the actor in its `description`. A role and a group cannot share a name,\nand the group's is the organisation's to keep. Each role cites in `stories` the IDs\nof the stories it serves (`\"F1.2\"`) — **at least one, and the build gate checks\none direction only**: every story a role cites must be a real story in the\nfeature files, or the design and the requirements have drifted. The reverse is\nnot checked here — a story no role names is not an error, because coverage is\ncarried by each component's\n`design.json` `stories`, not by this file. So read the stories once more before\nyou finish and ask whether an actor-bearing story is really served by the role\nyou gave it.\n\n## Grants follow the screens' loads\n\nScopes are compared as whole strings, everywhere — the gateway and the\ndirectory. Nothing implies anything: a token carrying `claims:read-all` is\nrefused by an operation that requires `claims:read`.\n\nA screen is reachable for whoever holds the scope of the operation it **loads**\n— the list or detail call whose answer the screen renders on open. Nothing\nabout that is written here: the SPA reads it off `openapi.yaml`. What this file\ndecides is whether each role holds that scope. So for a role's `grants`, walk\neach flow that the web application's prototype gives that role\n(`prototype.json` `flows`), open the `openapi.yaml` of the component behind\neach screen in it, and grant the handle of the operation each screen loads — at\nthe reach the screen shows. The design writes this file before the prototype\nand the contracts exist: grant then what each role's stories need, and the\ndesign's grants pass does this walk when the screens and the operations exist. An\nApprovals queue that lists every claim loads `GET \u002Fclaims`, so the Approver\nholds `claims:read-all`; a My Claims page loads `GET \u002Fme\u002Fclaims`, so the\nEmployee holds `claims:read`. Then grant the actions the screen's controls call.\n\nNo gate refuses a role that is one handle short at design time; the build's\nmock walk does, opening each flow's entry screen as its role and naming the\nscreen, the operation and the handle it wanted. On a plane where the gateway\nanswers **401** for every failure — no token, expired token, missing scope, all\nbyte-identical — the same omission in a deployed app is not a tidy 403 either:\nthe SPA hides the screen, or a typed URL lands on `Forbidden`, and the fix is\none more entry in `grants`.\n\n**One scope per operation is the invariant this guidance protects.** Never\npropose listing alternatives on an operation, and never ask for a handle to\nimply another.\n\n## Every user role gets a test user\n\nA test user is an account that exists so a role's behaviour can be exercised —\nthe validation agent signs in as one to judge role-gated acceptance criteria.\nThe platform generates its password at Build, seals it, and publishes it in the\nRoles gate ticket beside that role's granted scopes; that ticket is where the\nvalidation agent reads its login. A test user is a **disposable account for\nautomated agents**, readable by anyone who can read the repository — never a\nperson's account.\n\nEmit one per `kind: user` role, whatever its enrolment, named `test-\u003Crole-slug>`\n(`Compliance Admin` → `test-compliance-admin`), so the user sees them in\nSecurity and can rename them before Build. **The platform supplies any you\nomit**, so a missing test user is never a blocked build — but naming them\nyourself is what lets the user recognise and change them. `roles` is a list: a\nuser holding two roles is how the design exercises somebody who both files and\napproves.\n\n**A self-service role gets one too** — `enrolment` says how real accounts\narrive, never whether the role can be exercised (`authorization-model`).\nOnly `kind: service` roles get none: their principal is an application.\n\nA username the platform did not create (`jsmith`) is a refusal, not a password\nreset: that role has no working login, and a real person's name lands in a\npublished ticket. Invent no password anywhere in the design; there is no\nproperty at any level where one could go, and a write that adds one is rejected.\n\n## The file\n\n```json\n{\n  \"version\": 3,\n  \"permissions\": [\n    {\n      \"resource\": \"claims\",\n      \"component\": \"expense-api\",\n      \"description\": \"Expense claims and their approval\",\n      \"actions\": [\n        { \"handle\": \"read\",     \"description\": \"The caller's own claims\" },\n        { \"handle\": \"read-all\", \"description\": \"Every claim\" },\n        { \"handle\": \"submit\",   \"description\": \"Create and send a claim\" },\n        { \"handle\": \"approve\",  \"description\": \"Approve a submitted claim\" },\n        { \"handle\": \"reject\",   \"description\": \"Reject a submitted claim\" }\n      ]\n    },\n    {\n      \"resource\": \"reports\",\n      \"component\": \"expense-api\",\n      \"actions\": [\n        { \"handle\": \"read\",   \"description\": \"Monthly totals\" },\n        { \"handle\": \"export\", \"description\": \"Download CSV\" }\n      ]\n    }\n  ],\n  \"groups\": [\n    { \"name\": \"Employees\", \"description\": \"Everyone on payroll\" }\n  ],\n  \"roles\": [\n    {\n      \"name\": \"Employee\",\n      \"description\": \"Submits and follows their own claims.\",\n      \"stories\": [\"F1.1\", \"F1.2\", \"F1.3\"],\n      \"grants\": [\"claims:read\", \"claims:submit\"],\n      \"assignTo\": [\"Employees\"]\n    },\n    {\n      \"name\": \"Approver\",\n      \"description\": \"Approves or rejects submitted claims and reads monthly reports.\",\n      \"stories\": [\"F2.1\", \"F2.2\", \"F2.3\", \"F3.1\"],\n      \"grants\": [\"claims:read\", \"claims:read-all\", \"claims:approve\", \"claims:reject\", \"reports:read\"],\n      \"assignTo\": [\"Finance\"],\n      \"assignableBy\": [\"Approver\"]\n    }\n  ],\n  \"testUsers\": [\n    { \"username\": \"test-employee\", \"roles\": [\"Employee\"] },\n    { \"username\": \"test-approver\", \"roles\": [\"Approver\"] }\n  ]\n}\n```\n\n`Finance` is not in `groups[]`: `list_groups` returned it, so `Approver` is\nassigned to the people who already are Finance. `Employees` is new to this\nproject and is declared. `Approver` grants `claims:read-all` because the\nApprovals screen loads `GET \u002Fclaims` — every claim — and `claims:read` because\nan approver has claims of their own too; neither grant is implied by the other,\nand the `openapi.yaml` beside this file is where `GET \u002Fme\u002Fclaims` and\n`GET \u002Fclaims` say which rows each returns. No screen is named in this file: the\nSPA gates each one on the operation it loads.\n\n| Field | Rule |\n|---|---|\n| `version` | Always `3`. |\n| `permissions[]` | The catalog. `resource` unique in the project; `component` names a `service` in the cell; at least one action; action handles unique within their resource (`claims:read` and `reports:read` legally coexist). |\n| `groups[]` | Organisation groups this project introduces: `name`, `description`. Created if absent, never renamed or deleted. A group already in the directory is not redeclared. |\n| `roles[].name` | A PRD actor noun, unique in the project (case-insensitively), never a group name. It becomes `\u003Cproject>\u002F\u003Cname>` on the directory. |\n| `roles[].description` | What the role does and what it never sees or does, in plain words (see below). Project-owned: the platform writes it on every build. |\n| `roles[].stories` | Story IDs (`\"F2.3\"`) this role serves. At least one. |\n| `roles[].grants` | Handles from `permissions[]`. At least one. A handle no role grants is a warning (\"unreachable by any role\"); a handle no operation requires is a warning (\"declared, used nowhere\"). |\n| `roles[].assignTo` | Organisation groups the role is assigned to. Each must be declared in `groups[]` or exist in the directory (`list_groups`) — anything else is refused, so a typo cannot create a group. Required for `enrolment: admin` user roles; absent for self-service and service roles. |\n| `roles[].enrolment` | Optional. `admin` (default) or `self-service`. See **self-service actors**. |\n| `roles[].assignableBy` | Optional role names, validated against `roles[]`. Records who may hand this role out. |\n| `roles[].kind` | Optional. `user` (default) or `service`. A service role is assigned to an application principal, never to a group, and gets no test user. |\n| `testUsers[].username` | Lowercase letters, digits, `.`, `_`, `-`. |\n| `testUsers[].roles` | One or more declared `kind: user` roles, of either enrolment. The account is enrolled in every `assignTo` group of every role listed; a role with no `assignTo` is bound to the account directly. |\n\n**The descriptions are what a business reviewer checks.** The console shows\nRoles and permissions from the descriptions of the roles and the actions, above\nthe grants. So write each one in plain words, with its limits. A role's\n`description` says what the role does and what it never sees or does:\n\"Approves or rejects the claims of their own team, never their own. Sees no\nother team's claims.\" An action's `description` says what it lets a caller do,\nand to which records: \"Every claim\", \"The caller's own claims\". A limit that no\nscreen can show, such as what a role never sees, is written only here.\n\n**A role that reaches rows by path gets two test users, not one.** Where a role\ngrants a `\u002Fme\u002F` operation, the thing worth proving is that one caller cannot see\nanother's rows — and a single account per role makes that unprovable everywhere\ndownstream: the mock walk, a wired run and validation alike can only ever check\nthe caller against themselves. A second account is what gives the isolation\nsomething to fail against.\n\nA self-service role is usually the `\u002Fme\u002F` actor, and the platform supplies only\none login per role — so the pair is yours to author or isolation goes unproven.\n\nNothing else goes in the file. There is no `screens[]`, no `ownership`, no\n`coldStartRole`, no `publicComponents`, no `thunder` block, no `grantedBy`:\nwhich rows an operation reaches is its path, a component is protected because\nit depends on sign-in, an operation is public because its `security` is empty,\na screen is gated by the operation it loads and is public when its flow carries\nno `role`, the OAuth client's name and scope list are derived, and\n`assignableBy` records who hands a role out. A document that carries\n`screens[]` is refused with the key named.\n\n## The signed-in baseline\n\nThere is no role a caller falls back to. A person whose groups hold no project\nrole gets a valid token with the OIDC scopes and **no permission scopes** — and\nthat is a designed state, not a hole:\n\n- **Operations every signed-in person may call** are the baseline: an operation\n  with no `security` override inherits the document default and needs a valid\n  token and no scope. `GET \u002Fme` is the usual one. Nothing in this file declares\n  them; `openapi.yaml` does, by saying nothing.\n- **Screens** work the same way: a screen whose load operation is one of\n  those, or that loads nothing, is every signed-in user's.\n- A caller who can reach **nothing** sees the SPA's `NoAccess` page — signed in,\n  told which groups would help, given their username to quote — instead of an\n  empty shell. The API agrees with it: the same scope is missing at both ends.\n\nInferring a role from the absence of one is fail-open, which is why the platform\ndoes not do it. Real people are admin-created (somebody adds them to a group) or\nself-registered.\n\n## Self-service actors\n\nAn actor the organisation does not enrol — a Patient booking an appointment, a\ncustomer opening an account — gets `\"enrolment\": \"self-service\"` and **no**\n`assignTo`. A registration flow assigns the role at account creation, which is\nthe legitimate cold start and a concept every identity provider has. Such a role\ngets no group binding.\n\nIt still gets test users, two where the role reaches `\u002Fme\u002F` rows.\n\nUse it only where the PRD genuinely describes people who sign themselves up,\nand only where `organization`'s **Security & compliance** section permits it.\nEverything else is `admin`.\n\n**The platform provisions no registration flow today**, so those test logins are\nthe role's only principals and no sign-up affordance appears on the sign-in\npage. `authorization-model` invariant 11 has the consequence for criteria.\n\n## What the user has to know about a grant change\n\nA refresh **narrows and never widens**. A grant removed from a role disappears\nfrom the caller's token at the next silent renew; a grant **added** to a role —\nor a person added to a group — does not appear until they sign out and sign in\nagain. Say so wherever the design explains an access change; it is the first\nthing an operator hits after adding somebody to a group, and it looks exactly\nlike a broken deployment.\n\n---\n\nThe `organization` skill's Security & compliance and Authentication defaults\napply before you invent policy — a filled org entry is the decision. Nothing\nhere creates anything: the platform creates the resource server, the roles, the\ngroups and the test users when the user clicks Build. `openapi-conventions` owns\nhow an operation names a handle and which rows it reaches (its path),\n`prototype` owns which screens exist and which role's flow walks them,\n`thunder-authentication` owns how the SPA gates each screen on the operation it\nloads; this skill owns the decisions all three consume, and\n`authorization-model` states the invariants they share.\n",{"name":5,"metadata":24,"description":7},{"aep":25},{"kind":26,"audience":27},"platform",[28],"design","main","e3b5fc8668f26761380b2d4965719f2d8f2eb246","skills\u002Fsecurity-design","https:\u002F\u002Fgithub.com\u002Fwso2\u002Flabs-agentic-engineer","https:\u002F\u002Fgithub.com\u002Fwso2","https:\u002F\u002Fwso2.com","Welcome to the WSO2 source code! For info on working with the WSO2 repositories and contributing code, click the link below.","2026-11-11 15:36:27",{"source":8,"skillName":5,"commands":38,"prompt":48,"zipAvailable":49},[39,42,45],{"tool":40,"command":41},"npx","npx skills add wso2\u002Flabs-agentic-engineer --skill security-design",{"tool":43,"command":44},"bunx","bunx skills add wso2\u002Flabs-agentic-engineer --skill security-design",{"tool":46,"command":47},"pnpm","pnpm dlx skills add wso2\u002Flabs-agentic-engineer --skill security-design","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fwso2\u002Flabs-agentic-engineer\u002Fblob\u002Fmain\u002Fskills\u002Fsecurity-design\u002FSKILL.md",true,[],[52,59,66,73,80,87],{"skillNo":53,"name":54,"nameZh":6,"description":55,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":56,"categories":57,"keywords":58,"publishedAt":19},"01M735MP9NFFRPS260G9D16JQX","validation-task","Load when working a VALIDATION task dispatched by WSO2 Labs Agentic Engineer — judging a deployed version against its acceptance criteria.","https:\u002F\u002Fgithub.com\u002Fwso2\u002Flabs-agentic-engineer\u002Fblob\u002Fmain\u002Fskills\u002Fvalidation-task\u002FSKILL.md",[],[],{"skillNo":60,"name":61,"nameZh":6,"description":62,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":63,"categories":64,"keywords":65,"publishedAt":19},"01M735MJ8ZMRZR20A57TMF7R9Q","thunder-authentication","Apply when a component sits on the project's sign-in — a SPA whose users authenticate through the auth platform-resource dependency, or a protected backend those signed-in users call.","https:\u002F\u002Fgithub.com\u002Fwso2\u002Flabs-agentic-engineer\u002Fblob\u002Fmain\u002Fskills\u002Fthunder-authentication\u002FSKILL.md",[],[],{"skillNo":67,"name":68,"nameZh":6,"description":69,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":70,"categories":71,"keywords":72,"publishedAt":19},"01M735MFQMY8DY1EM7JKS784D3","task-planning","Use when planning a version's build from a design — the plan turn that writes the build's checklist with planBuild, one item per feature the version carries in build order, after a Foundation item when the version needs one.","https:\u002F\u002Fgithub.com\u002Fwso2\u002Flabs-agentic-engineer\u002Fblob\u002Fmain\u002Fskills\u002Ftask-planning\u002FSKILL.md",[],[],{"skillNo":74,"name":75,"nameZh":6,"description":76,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":77,"categories":78,"keywords":79,"publishedAt":19},"01M735MCJQ4EVH7G4ZFMC682Y4","start","Use when kicking off a project from its idea — the product pass that agrees the feature list and writes the product page, the product-wide page and a stub per feature — or re-running \u002Fstart on a project that already has requirements.","https:\u002F\u002Fgithub.com\u002Fwso2\u002Flabs-agentic-engineer\u002Fblob\u002Fmain\u002Fskills\u002Fstart\u002FSKILL.md",[],[],{"skillNo":81,"name":82,"nameZh":6,"description":83,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":84,"categories":85,"keywords":86,"publishedAt":19},"01M735M60CTW4S7XMS6XCX9A7Y","resolve-dependency","Use for taking one external dependency from open to resolved — `\u002Fresolve-dependency \u003Cname> [answer]` names it and may carry the provider the user chose; `\u002Fresolve-dependencies` walks every open one in turn. Ask which provider (their suggestions as options; never choose for them), get its interface on disk (found, uploaded from the card, or assumed under the authorization the card records), then derive the config keys.","https:\u002F\u002Fgithub.com\u002Fwso2\u002Flabs-agentic-engineer\u002Fblob\u002Fmain\u002Fskills\u002Fresolve-dependency\u002FSKILL.md",[],[],{"skillNo":88,"name":89,"nameZh":6,"description":90,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":91,"categories":92,"keywords":93,"publishedAt":19},"01M735M3Z74SVFNVXZB7R64NQB","register-external-resource","Use when registering a Registered External resource from Marketplace chat (`\u002Fregister-external-resource`).","https:\u002F\u002Fgithub.com\u002Fwso2\u002Flabs-agentic-engineer\u002Fblob\u002Fmain\u002Fskills\u002Fregister-external-resource\u002FSKILL.md",[],[]]