security-patterns

Enforce zero-trust security patterns across frontend and backend systems.

Updated Aug 27, 2026
One-click install
npx skills add https://github.com/LawrenceWebon/eins --skill security-patterns-lawrencewebon
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: security-patterns
Source: https://github.com/LawrenceWebon/eins/tree/main/ph-gov-platform/.agent/skills/security-patterns
Command: npx skills add https://github.com/LawrenceWebon/eins --skill security-patterns-lawrencewebon

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Modern web apps struggle to securely authenticate, authorize, and protect data across frontend and backend; this Skill provides a consolidated pattern library to enforce zero-trust principles.

Core Features & Use Cases

  • Frontend: in-memory token storage, XSS mitigation, auto-logout on inactivity, and clear PII on logout
  • Backend: method-level authorization, PII masking, audit logging, input validation, rate limiting, and security headers
  • Use Case: Apply these patterns to a multi-tenant web app that handles sensitive data and needs strong access controls, audit trails, and encrypted data in transit and at rest.

Quick Start

Configure the frontend to store tokens in memory, enable CSP, and implement auto-logout, while the backend applies method-level authorization, PII masking, audit logging, and input validation.

Frequently Asked Questions about security-patterns

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I implement zero-trust security across frontend and backend applications?

Zero-trust security is enforced by applying in-memory token storage, XSS mitigation, and auto-logout on the frontend, while the backend uses method-level authorization, audit logging, and input validation.

What is the best way to handle authentication tokens securely in a web app?

Secure token handling requires storing authentication tokens in memory rather than local storage, implementing auto-logout on user inactivity, and clearing sensitive PII upon logout to prevent unauthorized access.

How do I protect sensitive data and prevent XSS in multi-tenant web applications?

Protect sensitive data in multi-tenant applications by enabling Content Security Policy for XSS mitigation, applying PII masking on the backend, and enforcing strict method-level authorization and audit logging.

Does this zero-trust security approach require specific frameworks or dependencies?

No specific dependencies are required to apply these zero-trust security patterns; the approach provides a consolidated pattern library for enforcing authentication, authorization, and data protection across standard web applications.

How do I secure API endpoints with rate limiting and input validation?

Secure API endpoints by enforcing backend rate limiting to prevent abuse, applying strict input validation to block malicious payloads, and configuring security headers and TLS for encrypted data in transit.

When should I use in-memory token storage instead of local storage for authentication?

Use in-memory token storage instead of local storage when enforcing zero-trust security to mitigate XSS attacks, ensuring authentication tokens are automatically cleared during auto-logout and inactivity.