celestial-skills / threat-modelling-engineering
AGENTS.md1 starsChanged 18 days agoApache-2.0View on GitHub
Spend thirty minutes before building a feature asking what could go wrong, so security controls are designed in rather than bolted on after launch. Generated from the Celestial engineering practice “Threat modelling”.
Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about code style.
Of the AGENTS.md files we read, the 31,774 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.
In this repository182 other files it gives its agents.
- skills/accessibility-audit-engineering/AGENTS.mdAGENTS.md
- skills/angular-app-engineering/AGENTS.mdAGENTS.md
- skills/aspnet-core-api-engineering/AGENTS.mdAGENTS.md
- skills/chrome-extension-engineering/AGENTS.mdAGENTS.md
- skills/ci-cd-pipelines-engineering/AGENTS.mdAGENTS.md
- skills/code-review-engineering/AGENTS.mdAGENTS.md
- skills/compose-android-app-engineering/AGENTS.mdAGENTS.md
- skills/context-engineering-engineering/AGENTS.mdAGENTS.md
- skills/database-migrations-engineering/AGENTS.mdAGENTS.md
- skills/dbt-analytics-engineering/AGENTS.mdAGENTS.md
- skills/dependency-supply-chain-engineering/AGENTS.mdAGENTS.md
- skills/deprecation-and-removal-engineering/AGENTS.mdAGENTS.md
- skills/design-tokens-to-code-engineering/AGENTS.mdAGENTS.md
- skills/django-app-engineering/AGENTS.mdAGENTS.md
- skills/end-to-end-testing-engineering/AGENTS.mdAGENTS.md
- skills/expo-react-native-app-engineering/AGENTS.mdAGENTS.md
- skills/fastapi-service-engineering/AGENTS.mdAGENTS.md
- skills/fastify-api-engineering/AGENTS.mdAGENTS.md
- skills/feature-flags-engineering/AGENTS.mdAGENTS.md
- skills/flutter-app-engineering/AGENTS.mdAGENTS.md
- skills/framework-upgrades-engineering/AGENTS.mdAGENTS.md
- skills/git-workflow-engineering/AGENTS.mdAGENTS.md
- skills/go-http-service-engineering/AGENTS.mdAGENTS.md
- skills/graphql-api-engineering/AGENTS.mdAGENTS.md
- skills/incident-response-engineering/AGENTS.mdAGENTS.md
- skills/incremental-implementation-engineering/AGENTS.mdAGENTS.md
- skills/internationalisation-engineering/AGENTS.mdAGENTS.md
- skills/kubernetes-helm-engineering/AGENTS.mdAGENTS.md
- skills/laravel-app-engineering/AGENTS.mdAGENTS.md
- skills/launch-readiness-engineering/AGENTS.mdAGENTS.md
- skills/llm-features-and-evals-engineering/AGENTS.mdAGENTS.md
- skills/marketing-site-engineering/AGENTS.mdAGENTS.md
- skills/nestjs-service-engineering/AGENTS.mdAGENTS.md
- skills/nextjs-app-engineering/AGENTS.mdAGENTS.md
- skills/nuxt-app-engineering/AGENTS.mdAGENTS.md
- skills/observability-engineering/AGENTS.mdAGENTS.md
- skills/privacy-by-design-engineering/AGENTS.mdAGENTS.md
- skills/python-ml-service-engineering/AGENTS.mdAGENTS.md
- skills/rails-app-engineering/AGENTS.mdAGENTS.md
- skills/react-web-app-engineering/AGENTS.mdAGENTS.md
- skills/release-and-versioning-engineering/AGENTS.mdAGENTS.md
- skills/requirements-interview-engineering/AGENTS.mdAGENTS.md
- skills/rest-api-design-engineering/AGENTS.mdAGENTS.md
- skills/rust-axum-service-engineering/AGENTS.mdAGENTS.md
- skills/rust-cli-tool-engineering/AGENTS.mdAGENTS.md
- skills/safe-refactoring-engineering/AGENTS.mdAGENTS.md
- skills/secure-code-review-engineering/AGENTS.mdAGENTS.md
- skills/source-grounded-development-engineering/AGENTS.mdAGENTS.md
- skills/spec-before-code-engineering/AGENTS.mdAGENTS.md
- skills/spec-driven-development-engineering/AGENTS.mdAGENTS.md
- skills/spring-boot-service-engineering/AGENTS.mdAGENTS.md
- skills/sveltekit-app-engineering/AGENTS.mdAGENTS.md
- skills/swiftui-ios-app-engineering/AGENTS.mdAGENTS.md
- skills/systematic-debugging-engineering/AGENTS.mdAGENTS.md
- skills/task-breakdown-engineering/AGENTS.mdAGENTS.md
- skills/tauri-desktop-app-engineering/AGENTS.mdAGENTS.md
- skills/technical-documentation-engineering/AGENTS.mdAGENTS.md
- skills/terraform-infrastructure-engineering/AGENTS.mdAGENTS.md
- skills/test-first-development-engineering/AGENTS.mdAGENTS.md
- skills/typescript-library-engineering/AGENTS.mdAGENTS.md
- The first 60 shown.
The file
We split this AGENTS.md into the rules it gives an agent
3 rules. About 0 are common, 3 are distinctive, and 0 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈3
Distinctive · estimate
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 26
Write abuse cases as concrete sentences naming the actor, the action and the asset.
- Distinctive: line 27
Every mitigation must point to a place in the code and a test that proves it works.
- Distinctive: line 28
Keep the model in the repository beside the feature and update it in the same pull request as design changes.
≈ “Common” is an estimate: at least 1 in 5 of the 40,246 AGENTS.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
AGENTS.md — Threat modelling
Spend thirty minutes before building a feature asking what could go wrong, so security controls are designed in rather than bolted on after launch.
How to do it
- Describe the feature in one diagram — Draw the actors, processes, data stores and external services, and the arrows of data between them. Mark each trust boundary (browser to server, service to third party, tenant to tenant). Keep it to one page.
- List the assets — Name what an attacker would want or what would hurt if lost: credentials, personal data, payment state, admin capability, availability, audit history. Rate each as high, medium or low impact.
- List the entry points — For every arrow that crosses a trust boundary, write down the entry point: route, webhook, file upload, queue, admin tool, support process. Note who can reach it (anonymous, signed-in, internal, partner).
- Write abuse cases — For each entry point, ask how each actor could spoof identity, tamper with data, deny having acted, read data they should not, exhaust resources or gain extra privilege. Write each as a sentence: 'A signed-in user changes the account id in the request to read another tenant's invoices.'
- Rank by likelihood and impact — Score each abuse case low, medium or high on both axes. Anything high on either must have a mitigation before release; low-and-low cases can be accepted with a written reason.
- Choose a mitigation for each ranked case — Name the specific control (object-level authorisation, rate limit, signed webhook, idempotency key, audit log, input schema) and where it lives in the code. Prefer controls the framework already provides.
- Turn mitigations into tickets and tests — Each mitigation becomes an acceptance criterion with a test that exercises the abuse case. Link the tickets from the model.
- Revisit when the design changes — Store the model next to the code (for example docs/threat-models/
<feature>.md) and update it whenever a new entry point, data store or third party is added.
Checklist (before a pull request)
- A one-page diagram shows actors, data stores and trust boundaries
- Assets are listed with an impact rating
- Every boundary-crossing entry point is listed with who can reach it
- Each entry point has at least one written abuse case
- Every high-likelihood or high-impact case has a named mitigation
- Accepted risks have a written reason and an owner
- Mitigations are linked to tickets with tests that exercise the abuse case
Rules
- Model before the first line of feature code for anything that crosses a trust boundary or handles sensitive data. (Design flaws are cheap to fix on a whiteboard and expensive once data has shipped.)
- Write abuse cases as concrete sentences naming the actor, the action and the asset. (Vague threats produce vague controls that nobody can test.)
- Every mitigation must point to a place in the code and a test that proves it works. (A control that only exists in a document does not exist.)
- Keep the model in the repository beside the feature and update it in the same pull request as design changes. (A model that drifts from the system gives false confidence.)
- Include availability abuse (floods, huge payloads, expensive queries) alongside data theft. (Resource exhaustion is the easiest attack to launch and the one most often forgotten.)
Checks
| Gate | Tool | Threshold | When |
| Threat model present | Pull request template check | Features that add an entry point or a sensitive data store link a threat model file | Before the feature's first pull request merges |
Generated from the Celestial engineering practice “Threat modelling”.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

