# Secure defaults out of the box

> In published tests of AI-generated apps the common failures were not SQL injection or XSS, which modern frameworks block by default. They were missing authorisation and broken business logic: a user reading another company’s records, an action without a permission check. The defaults of Meadowstack 3.0 target exactly that.

Updated 2 December 2026. https://meadowstack.com/security/

## What every app gets

In Meadowstack 3.0 a missing permission check fails the build, and the rest of these defaults are in place when your coding tool writes the first screen.

- Permissions: One policy file per app says who may read and change what. It generates the database’s row-level policies and the interface’s guards, and a test fails when a table, role or action has no rule.
- Input: One schema per form or endpoint, used by the client and checked again on the server.
- Sign-in: E-mail with a magic link or a password, two-factor sign-in with TOTP and passkeys, a session timeout and signing out everywhere.
- Audit trail: Sign-ins, permission changes, exports and deletions are recorded with who, what, when and from where, without personal data in the message.
- Headers: A Content Security Policy, HSTS, frame-ancestors 'none', nosniff, a strict referrer policy and a minimal permissions policy.
- Secrets: Only in environment variables. A check fails when a secret lands in the repository or in the client bundle.
- Dependencies: npm audit on every run of the standard checks, and a CycloneDX SBOM with every release.
- Errors: People see what to do next and a request ID. Stack traces stay in the logs.

Meadowstack 3.0 arrives as an update to every licence. Today, 2.1 has the parts that live in the interface: permissions in one table per module, actions a person cannot take hidden, a confirmation before irreversible steps, a reason for every rejection and the history of every change. Its starter signs in for development only; real sign-in, the server side, headers and secrets are yours.

## What people and coding tools must follow

The rules sit in AGENTS.md, so Claude Code, Cursor and Codex read them before they write a line.

- Add or change data access only through the policy file. Never query a table without a rule for the current role.
- Validate every input on the server with the shared schema, even when the client already did.
- Never put secrets, tokens or personal data in client code, URLs, logs or error messages.
- Never use dangerouslySetInnerHTML, eval or string-built SQL. Use the query builder and React rendering.
- Check ownership on every record action: the record belongs to the user’s organisation, and the user’s role allows the action.
- Log security events through the audit trail helper, not console.log.
- Add a dependency only when the standard library or the kit cannot do it, and check it with npm audit.
- Run the standard checks before you finish. They run the security checks too.

## Built to support the technical measures in NIS2 Article 21

NIS2 obliges organisations, not software, so no framework makes you compliant. For each measure of Article 21(2) the table shows what the framework provides and what stays with you; use it as evidence in your own risk assessment. The Czech Cybersecurity Act (Act No. 264/2025 Coll.) asks for the same measures.

- (a) Risk analysis and security policies. What the framework provides: Threat notes per screen archetype in the docs, the security defaults listed above. What you do: Write your own policy and risk register.
- (b) Incident handling. What the framework provides: An audit trail of security events, an incident template, request IDs in errors. What you do: Run the process and report within 24 hours, 72 hours and one month (Article 23).
- (c) Business continuity and backups. What the framework provides: Backup and restore steps for the database host in the deployment guide. What you do: Schedule backups, test a restore, plan your crisis contacts.
- (d) Supply chain security. What the framework provides: A CycloneDX SBOM per release, pinned dependencies, npm audit in the checks. What you do: Assess your hosting and data processors.
- (e) Secure development and vulnerability handling. What the framework provides: The standard checks, the policy coverage test, shared validation schemas, a disclosure process for the framework. What you do: Keep the framework updated and fix what the checks report.
- (f) Assessing the measures. What the framework provides: The checks’ report and the policy coverage test as repeatable evidence. What you do: Review the reports on a schedule.
- (g) Cyber hygiene and training. What the framework provides: Secure-coding rules for people and coding tools in AGENTS.md. What you do: Train your staff.
- (h) Cryptography and encryption. What the framework provides: TLS only with HSTS, password hashing and tokens left to the auth provider, no custom crypto. What you do: Choose a host with encryption at rest.
- (i) Access control and asset management. What the framework provides: Roles and permissions in one policy file, signing out everywhere, permission changes in the audit trail. What you do: Remove leavers and review roles.
- (j) Multi-factor authentication. What the framework provides: TOTP and passkeys, with two-factor sign-in required per role if you choose. What you do: Require it at least for admins.

Have a lawyer confirm which regime applies to your organisation and which obligations follow from it.

## Mapped to OWASP ASVS 5.0

Level 1 for every app, Level 2 for apps that hold personal or financial data. Where each chapter is handled, gaps included:

- V1 Encoding and sanitization: React escaping, a lint ban on dangerouslySetInnerHTML and eval, a query builder instead of string SQL
- V2 Validation and business logic: Shared schemas checked on the server, limits on bulk actions and exports
- V3 Web frontend security: Security headers and a CSP in the deployment config, noopener on external links
- V4 API and web service: Every endpoint checks its input and the policy, errors without internals
- V5 File handling: Size and type allow-lists, storage outside the app’s origin, signed links that expire
- V6 Authentication: An auth provider with password rules, magic links, TOTP and passkeys
- V7 Session management: Provider sessions with a timeout, rotation on sign-in, signing out everywhere
- V8 Authorization: The policy file to row-level policies and interface guards, with a coverage test
- V9 Self-contained tokens: Provider JWTs verified on the server, short expiry
- V10 OAuth and OIDC: Provider OAuth with PKCE when social sign-in is on
- V11 Cryptography: No custom crypto, provider and platform primitives only
- V12 Secure communication: HTTPS only, HSTS
- V13 Configuration: Secrets in environment variables, a secret scan in the checks, debug off in production
- V14 Data protection: Personal data fields marked in the schema, left out of logs and exports by default
- V15 Secure coding and architecture: npm audit, an SBOM, pinned versions, the standard checks
- V16 Security logging and error handling: The audit trail helper, request IDs, no stack traces for users
- V17 WebRTC: Not used

## Report a vulnerability

E-mail hello@meadowstack.com with the affected version, steps to reproduce and the impact you see. Please don’t open a public issue.

- Within 2 working days: We confirm that we received your report.
- Within 10 working days: You get our assessment.
- The fix: Critical and high issues get a fix or a mitigation in the latest release as fast as we can make it safe, and every buyer gets a security notice. Lifetime updates bring the fix to everyone.
- Actively exploited: Reported as the EU Cyber Resilience Act requires: an early warning within 24 hours, a notification within 72 hours and a final report within 14 days after a fix is available.

We credit reporters who want it once a fix is out. In scope: the framework repository, the starter, the MCP server and this website. Apps you build with the framework are yours to secure; the defaults above help.
