Plain (@plainframework) profile picture

The full-stack Python framework designed for humans and agents. Follow for development updates. Follow @davegaeddert for more background.

Kansas
Joined July 2024
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
Starting to rework some of the postgres APIs
1
22
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.
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.
1
1
1
329
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.
1
1
1,273