sethserver.com Subscribe
A blue robot with an annoyed expression sits cross-armed in the center on a mint green background, surrounded by floating pink padlocks, pink keys, pink shields, and yellow warning triangles with exclamation marks.

Seth's Opinionated Security Best Practices

By Seth Black • Updated: November 17, 2026

Security · 7 min read

Like this kind of writing? Get one email a week with notes on startups, AI, and the occasional strong opinion about Python: subscribe to the newsletter.

You can get away with a lot of bad habits and still ship software. Security isn’t on that list. AI made this worse in a very specific way: it sped up writing code and also made it normal to paste your crown jewels into a random textbox and hope for the best. cycode

The only thing that keeps working is boring best practices. The stuff you set up once, complain about a few times, and then mostly forget about until the day some incident report quietly proves you were right. cu

Identity & auth: passwords are not security policy

If your “password policy” is “we require one special character,” you’re not doing security. You’re doing vibes. cloud-cover

Baseline I treat as non‑negotiable:

On MFA types:

For user‑facing apps, passkeys/WebAuthn are where the industry is headed. They bind authentication to the real domain, kill password reuse, and shrug off most phishing tricks because the private key never leaves the user’s device. If you can support passkeys, do it; if you can’t, at least make password + MFA painless so people don’t go out of their way to bypass it. corbado

Credentials: the fastest way to lose a weekend

Early on I wrote custom BI software in C++ for AT&T and decided I also needed to design my own “encryption” for shuttling database credentials around. No external crypto, all homegrown, very galaxy‑brain. I was proud of it right up until I realized I’d signed myself up to maintain bespoke security plumbing for the rest of that system’s life. cycode

The lesson: don’t invent your own secret‑handling system. Other people already did that, argued about it, broke it, fixed it, and wrapped it in tools. opsmoon

Rules I follow now:

If a key lands in git, treat it like it’s already printed on stickers at a security conference. Rotate it, then rotate anything reachable through it—databases, downstream APIs, whatever it unlocked. wiz

Here’s the Python pattern I like. Boring, predictable, easy to audit:

import os

def get_db_url() -> str:
    url = os.getenv("DATABASE_URL")
    if not url:
        raise RuntimeError("DATABASE_URL is not set")
    return url

No “helpful” fallback to localhost with a default password, no magic dev shortcut that finds its way into production and becomes the next incident report. cycode

Least privilege: separate the scissors from the chainsaw

A lot of breaches follow the same script: someone gets in, and once they’re in, they can do everything. Fixing that is about making “everything” hard to reach. cycode

Concrete moves that pay off:

This is where the boring plumbing earns its keep: logging so you can see who used which key, backups so you’re not terrified to rotate credentials, tests so you can change permissions without bricking the app. None of that looks fancy on a slide, but it’s what lets you sleep when someone says “we need to revoke that key right now.” opsmoon

AI: treat prompts like external support tickets

I worked at a SaaS company that loudly sold “AI automation” for financial workflows. Under the hood, most of it was spreadsheet column mapping and data cleanup with some workflows taped on. The support team was weirdly cagey about how things worked, and at one point a team in South Asia suggested I fly out and watch them do their jobs in person. That did not happen, but the trust light started blinking red. cycode

The security angle is simple: people will paste real customer data anywhere if it helps them get unstuck. AI tools actually help, which makes this worse, not better. wiz

So treat AI tools like any other third‑party service you don’t control:

If you need help debugging with AI, sanitize first. Strip identifiers, mask tokens, and reduce it to the shape of the problem, not the actual production data. If you’re on a team, build tools that sanitize by default so nobody has to remember to be careful while they’re stressed and trying to get an incident under control. cycode

A checklist that fits on one screen

Area Baseline practice
Passwords Password manager + long, unique passphrases
MFA Enabled for email, cloud, Git, registrars, billing
Secrets Central secrets manager, never in git or configs
Rotation Keys rotated on schedule and after any exposure
Access Separate roles for app, admin, ops, and CI with least privilege

Security isn’t a premium feature you tack on at the end. It’s a pile of boring defaults you wire in early so you don’t end up writing angry postmortems about “that time we leaked prod credentials into an AI prompt and spent a week cleaning up.” blueally

-Sethers

Share this post
Newsletter

One email, once a week.

Notes on databases, systems, and the occasional strong opinion about Python. No spam, unsubscribe anytime.

Seth Black
Written by

Seth Black

Engineer and founder based in Texas. Writes about databases, AI, and running things in production. Embeds in small teams as lead engineer.

More from Security

View all →
Security

My Password Generators Had 53 Bits of Entropy

Sep 21, 2026
Security

API Key Generator with Prefix, Checksum and SHA-256

Sep 17, 2026
Security

Bcrypt Generator: Hash and Verify Passwords in Your Browser

Sep 17, 2026