
The full-stack Python framework designed for humans and agents. Follow for development updates. Follow @davegaeddert for more background.
Kansas
Joined July 2024
- Tweets128
- Following1
- Followers78
- Likes3
Every Plain setting ending in TOKEN, KEY, SECRET, PASSWORD or USER is now Secret[...] and masked, or says PUBLIC in its name.
A test enforces it across every package. First catch: EMAIL_HOST_USER. Postmark uses your API token as the SMTP username.
19
StreamingResponse bodies now run in the request's context. The generator queries the database on the same connection as the view, a cursor from Model.query.iterator() stays alive to the last chunk, and the request's trace covers sending the body.
16
Secrets in Plain are a type
SECRET_KEY: Secret[str]
`plain settings get` now masks them like `settings list` already did. Matters more with agents: everything a command prints lands in the transcript.
`plain settings get --reveal` is the explicit ask
22
Plain now requires Python 3.14. The first payoff is sql() in plain-postgres: the SQL is the literal parts of a t-string, every interpolated value binds as a parameter, and passing a plain str is a type error.
33
plain docs cache --api prints the real signatures for the version you have installed. Docs ship inside each Plain package — your agent reads them instead of guessing from training data.
1
18
plain.loginlink: link expiration is now a class attribute — link_expires_in = 60 * 15 on your form, no method override needed. Docs now spell out the real semantics: links stay valid until expiry, deliberately, so mail scanners can't burn them before your user clicks.

ALT Python code before/after. Before: override a method to change the expiration — class CustomLoginLinkForm(LoginLinkForm) overriding maybe_send_link(self, request, expires_in=60 * 15) and calling super(). After: one class attribute — class CustomLoginLinkForm(LoginLinkForm) with link_expires_in = 60 * 15.
16
Dev secrets can now live in git. `plain env set` encrypts a value into your committed .env.dev, one key per project. A fresh clone — or a hosted agent sandbox — just needs DEV_ENV_KEY and every dev credential comes with the repo.
1
28
Response.status_code is read-only in Plain now. The status decides things everything downstream builds on — whether a body is allowed, how the response is framed on the wire — so it's fixed at construction. Renderers take it directly: self.render(form=form, status_code=422)
1
26
plain 0.160.0 makes that bug unrepresentable instead of just catching it: bodiless responses (204, 304, HEAD) refuse content at construction, and Response.status_code is read-only — so you can't build a valid response and mutate it into an invalid one.
31
We were seeing intermittent 503s behind Heroku's router that never showed up in our app logs. Root cause: a 204 response with a body. The body bytes go onto the keep-alive connection unframed, and the router reads them as the start of the next response.
Replaced Model.save() with create() and update() in Plain.
The old version branched on whether a primary key was set, which meant reading a save() call told you nothing about whether it wrote a new row.
1
20
Two new packages in Plain: plain.mcp and plain.oauthserver.
Together they mean an AI client can connect to your app as a real, authenticated user — PKCE, dynamic client registration, token rotation.
1
38
Plain doesn't auto-index foreign keys — you declare the indexes you want. Add a composite index starting with that FK and the single-column one is redundant anyway: Postgres uses the composite's leftmost prefix. Explicit indexes, no overlap by default.
Making a little progress on the admin UI...
- pyproject.toml project name for branding
- icons for sidebar nav
- gravatar for logged in user
Experimenting with a MARK comment in the Plain source code, which we can render as sections when displaying docs.
Inspired by # pragma mark in Objective-C and MARK in Swift
Plain now ships with `plain install` and `plain upgrade` commands.
In some ways these are glorified AI prompt generators! But integrating with coding agents in this way leaves API keys and control completely in your hands. Use any provider or tool you want.
From seeing a problem to fixing it, with the new opentelemetry instrumentation, plain-observer, and `plain observer diagnose`.
What else can we do if we embrace coding agents?!
![Python settings: EMAIL_HOST_USER and EMAIL_HOST_PASSWORD annotated Secret[str] (masked in logs and plain settings list), and CONNECT_PAGEVIEWS_PUBLIC_TOKEN as a plain str because it's rendered into every page's HTML.](https://pbs.twimg.com/media/HTqE7URbMAAkHrc.png?name=small&format=webp)

![app/settings.py declares STRIPE_SECRET_KEY: Secret[str]. Below, labeled 'what the agent sees', an agent transcript shows Bash(plain settings get STRIPE_SECRET_KEY) returning ******** and a hint that it is a secret, pass --reveal to print its value.](https://pbs.twimg.com/media/HTKGfpGaQAAyR8E.jpg?name=small&format=webp)












