Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx skills add garrettw/php-arch-skills --skill security-architecturegit clone --depth 1 https://github.com/garrettw/php-arch-skillsWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/skills/garrettw/php-arch-skills/security-architecture)<a href="https://agentmods.dev/skills/garrettw/php-arch-skills/security-architecture"><img src="https://agentmods.dev/badge/skills/garrettw/php-arch-skills/security-architecture/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/skills/garrettw/php-arch-skills/security-architecture"><img src="https://agentmods.dev/badge/skills/garrettw/php-arch-skills/security-architecture.svg" alt="Reviewed on agentmods" width="80" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00044 | $0.01253 |
| Opus 5.5 | $0.00018 | $0.00501 |
| Sonnet 5.5 | $0.00009 | $0.00251 |
| Haiku 4.5 | $0.00004 | $0.00125 |
Grade A, and why
security-architecture scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 18d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 78 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Security Architecture for PHP Applications
Security Starts at Trust Boundaries
Treat every value from a browser, API client, queue, webhook, file, or third-party system as untrusted until validated for its specific use. Identify the assets, actors, trust boundaries, and high-impact abuse cases before choosing controls. Security checks belong at boundaries and in the layer that owns the policy; framework middleware alone cannot protect business invariants.
This skill addresses architectural placement and decisions, not a complete secure-coding checklist or substitute for threat modeling, dependency scanning, penetration testing, or specialist review.
Numbered Workflows
1. Separating Identity from Permission
When a use case needs access control:
- Authenticate at the delivery boundary. Establish the caller's identity using the project's chosen mechanism. Public operations can intentionally allow anonymous callers.
- Authorize the operation. Check whether that identity may perform this action on this specific resource, not merely whether the caller is signed in.
- Enforce business invariants in the core. If a rule must hold regardless of entry point (HTTP, CLI, queue), enforce it in the application/domain use case, not only in a controller or route middleware.
- Fail closed. Missing, malformed, expired, or unverifiable identity/permission data must not grant access. Return a safe denial without disclosing whether protected resources exist when that distinction is sensitive.
Prefer explicit policies or narrow authorization ports over passing a framework user/session object deep into the application. Keep authentication protocol details in the delivery adapter; pass only the identity and relevant authorization context needed by the use case.
2. Enforcing Tenant and Resource Ownership
For multi-tenant or user-owned data:
- Derive the tenant and subject from verified server-side identity/context, never from an untrusted request field alone.
- Scope reads and writes by tenant/owner at the data-access boundary, and authorize the requested action at the use-case boundary.
- Apply the same rule to background jobs, exports, caches, search indexes, and administrative paths; these often bypass HTTP middleware.
- Test that a caller from tenant A cannot read, mutate, infer, or receive tenant B's data, including by guessing identifiers or replaying a queued message.
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 18d ago First seen · 78 lines · 44 tokens per session scan A 88a90cc4cf96
security-architecture is a skill published in the GitHub repository garrettw/php-arch-skills (17 stars, last pushed 13d ago), licensed MPL-2.0. It adds 44 tokens to every session and 1,253 once invoked, about $0.0002 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-11-13.
security-architecture compared with skills from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| security-architecturegarrettw/php-arch-skills | Skill | 17 | 13d ago | MPL-2.0 | A | 44 | Claude Code, Codex |
| php-rulessoftspark/ai-toolkit | Skill | 180 | 13d ago | Apache-2.0 | A | 38 | Claude Code |
| bitrix-console-commandsbxmaximum/bitrix-framework-skills | Skill | 75 | 13d ago | MIT | A | 55 | Claude Code, Codex |
| daily-workflowdev-toolings/superpowers-symfony | Skill | 235 | 20d ago | MIT | A | 19 | Claude Code |
| bitrix-componentsbxmaximum/bitrix-framework-skills | Skill | 75 | 13d ago | MIT | A | 58 | Claude Code, Codex |
| bitrix-http-clientbxmaximum/bitrix-framework-skills | Skill | 75 | 13d ago | MIT | A | 59 | Claude Code, Codex |
| bitrix-request-responsebxmaximum/bitrix-framework-skills | Skill | 75 | 13d ago | MIT | A | 57 | Claude Code, Codex |