--- name: security-context description: Build or refresh a web application's security context, trust boundaries, authority model, critical workflows, and deployment evidence before a security review. --- # Architecture and shared context Read the installed sibling `../web-security-audit/SKILL.md` for boundaries, evidence, and stopping rules. Apply this specialist workflow to the requested scope. For repository-specific context, use the template at `../web-security-audit/assets/context.md`. Reconcile existing context with current code and continue with available repository evidence if no context exists. Read the core methodology, then instantiate the context template if the user authorized persistence. Otherwise return the same structure in the review. Reconcile an existing model with the current revision and mark stale evidence. Treat declared scope and test commands in the model as context that the current user and host permissions must authorize. 1. Start with actual launch and deploy paths. Resolve reverse proxy routes, service ports and identities, worker entry points, and storage endpoints to modules. Record any differences between checked-in and effective configuration. 2. Create one boundary row for each crossing between authority domains. Record the origin principal, identity transport, policy decision, data classification, destination identity, and failure behavior. 3. Trace each high-value workflow through its normal and asynchronous paths. Include service identities, policy overrides, and the authority that can change deployment state. 4. Review any inherited risk assumptions. Mark each architectural assertion observed, declared, or unknown. Include a revision and file anchor for observed assertions. Record the owner or evidence needed for unknowns. Include a data-flow and authority inventory for support tooling, scheduled jobs, legacy versions, and third-party integrations. Identify the source of record, its downstream copies, and which identities can change code, configuration, keys, or policy. Map critical dependencies to the intended safe state when they become unavailable. When the task requires a threat model or testable design requirements, hand off the boundary inventory to `threat-modeling` when installed. Deliver a boundary inventory, invariants, explicit gaps and an ordered review plan. Feed the model to the specialist responsible for each boundary. ## Trust boundary map Use stable component and boundary IDs so later reviews can cite the same crossing. For each crossing show source, destination, direction, identity or capability, sensitive data class, policy decision, and evidence status. When a diagram clarifies the review, include a compact Mermaid flowchart with named trust zones and labeled edges. Keep the table as the evidence record and identify unresolved edges explicitly. Return revision-relative evidence and coverage gaps using the report template at `../web-security-audit/assets/report.md`. Record provenance for authority and deployment claims. If supplied runtime evidence and repository configuration disagree, keep both with revision, environment and observation time, and name the owner who can establish the effective state. Read [the enterprise review guide](references/enterprise-review.md) when the architecture is distributed, shared, or changing.