What We Mean by Secure-by-Default Postgres

D

Dan Lynch

Feb 11

What We Mean by Secure-by-Default Postgres

Every database has security settings: Default passwords. Encryption out of the box. Some are even enabling RLS on tables. But security settings and secure architecture are not the same thing.

That’s why we’re introducing the first secure-by-default Postgres platform.

“Secure-by-default” means that the secure state is the starting state. There is no gap between when your data exists and when it's protected.

Here’s how Constructive works: you choose an access model, and we compile and apply Row-Level Security at table creation—real, enforceable access rules from the moment your data exists, not an “RLS enabled” checkbox that leaves developers to bolt protections on later in application code.

The Gap Where Breaches Live

In a traditional Postgres workflow, security arrives after the fact. Teams create tables, ship features, and only later—if they know how and if they remember—add Row-Level Security policies, configure roles, and tighten grants.

By then, the database has already spent time in its most dangerous state: real data, incomplete protections. That gap between “data exists” and “data is protected” is where breaches happen.

This isn’t an edge case anymore. Two weeks ago, the viral AI-agent social network Moltbook exposed 1.5 million API keys because RLS was never enabled. A critical CVE impacted hundreds of applications built on a popular vibe-coding platform. The pattern is consistent: security was treated as a follow-up step. The follow-up never happened.

What Secure-by-Default Actually Means

Let’s be precise, because “secure by default” is an overloaded phrase.

We don’t mean RLS is simply enabled on every table. Flipping RLS on without real policies either locks everyone out, or worse, creates a false sense of safety with no enforceable access rules behind it. That’s a checkbox. We’ve built a security model.

Here’s what that means: In Constructive, you choose an access model before you create your schema. We compile that model into concrete Postgres enforcement—RLS policies, role configuration, and permission grants—and apply it at table creation, not after. The moment a table exists, it has explicit rules for who can read, write, and modify its data.

That makes policy the foundation, not an annotation. Tables don’t get created in an unprotected state and “fixed later.” And because the policy is compiled, not hand-configured, there’s no manual translation step where intent gets lost, drift creeps in, or misconfigurations slip through.

Why This Distinction Matters Now

For decades, “configure security later” was tolerable. Humans wrote code, other humans reviewed it, DBAs locked things down. Development moved slowly enough that security could catch up.

That model is breaking. AI assistants now generate complete backends—tables, APIs, authentication—in minutes. You can describe what you want and end up with a working Postgres database before you’ve even decided who should be allowed to read what.

AI optimizes for one thing: does it run. It doesn’t naturally reason about tenant isolation, least privilege, or compliance boundaries. It won’t intuit that billing data needs tighter rules than a public profile table.

When velocity outruns review, “we’ll secure it later” becomes a liability. The database is the last enforcement point between your data and the outside world, and it can’t depend on a follow-up step that may never happen.

Security has to be there at construction. That’s what secure-by-default means.

We Believe in Policy-First Design

Constructive is built on a trust layer: infrastructure where security is structural by design.

A security compiler. You choose an access model, and Constructive compiles it into real Postgres enforcement—RLS policies, role configuration, and permission grants—applied at table creation. Same input, same output, every time.

Deterministic migrations. As your schema changes, migrations produce the same security configuration across environments. Development, staging, production—the same policy definition yields the same guarantees. Reproducible, reviewable, auditable.

Testable authorization. RLS is one of Postgres’s most powerful but opaque features. Constructive makes it testable in CI/CD by simulating users and roles end-to-end. If you can’t test your security model, you can’t trust it.

Why This Matters for AI-Generated Software

AI agents don’t understand your org chart. They don’t know which teams should access which data, what compliance frameworks apply, or what your internal security policies require. They execute without full context.

AI coding assistants optimize for functionality, not governance. They can generate a working backend fast, but “working” is not the same as “secure.”

As AI-assisted development becomes the norm, trust has to shift. We can’t rely on who wrote the code as a proxy for safety. We need infrastructure that provides guarantees regardless of how the code was produced—because the backend becomes the last enforcement point between your data and the outside world.

Database Security Should Be Testable

Here’s a truth the industry doesn’t say out loud: almost nobody tests database authorization.

Not because it’s optional—because it’s been painful. Postgres gives you powerful primitives like RLS, but the tooling hasn’t made it easy to simulate real users, validate behavior across roles, and run those checks in CI before shipping to production. So teams skip it. They deploy and hope the policy does what they think it does.

We think that’s backwards. Test-driven development is standard at the application layer. It should be standard at the database layer too—especially now that backends are generated and changed at AI speed.

Constructive makes authorization testing a default part of your workflow. You can simulate users, switch roles inside a single test, and prove your policies behave exactly as intended—automatically in CI/CD, before anything reaches production.

The result is a beginner-friendly workflow that quietly raises the bar: you ship like an enterprise team, by default.

Built on Proven Infrastructure

We’re not asking anyone to bet on unproven technology.

The open-source infrastructure beneath Constructive already runs in production supporting over 10 million databases. Our SQL parsers, migration systems, and introspection tools are embedded in platforms like Supabase and Databricks, and have surpassed 100 million npm downloads.

In other words: this isn’t a new idea we’re trying in public—it’s hardened plumbing that major database platforms already rely on.

We operate at the AST level—the abstract syntax trees that define how PostgreSQL parses and executes SQL. That’s the structural layer where correctness and safety are decided, and it’s the foundation we’ve spent a decade building.

Constructive is that foundation, applied to the problem that now matters most: making Postgres secure by default at AI speed.

Constructive is available in commercial beta. Enterprise teams can request early access at constructive.io.