Skip to content

Start AuthProxy and Ante in cratis run when the model declares them - #525

Merged
einari merged 8 commits into
mainfrom
env-onboarding/run
Nov 1, 2026
Merged

einari merged 8 commits into
mainfrom
env-onboarding/run

Conversation

@einari

@einari einari commented Nov 1, 2026 •

Copy link
Copy Markdown
Contributor

cratis run now runs a Screenplay model the way it runs in production: behind AuthProxy when the model declares authentication, with its own Ante when it declares onboarding, configured from the selected environment.

Added

  • cratis run starts AuthProxy in front of the Stage when the model has authentication, configured from the model's providers and the selected environment, and opens the application through it; the Stage trusts the identity AuthProxy forwards instead of playing a persona (cratis run: start AuthProxy and Ante when the model declares them #516)
  • cratis run starts the application's own Ante in development mode, with a MongoDB and the model's legal terms, when the model has onboarding; onboarding emails are written to .cratis/local/mail unless the environment names a mail server
  • cratis run stops before starting any container when the environment lacks keys the model needs, and lists them
  • cratis run options --environment, --auth-port, --lobby-port, --authproxy-tag and --ante-tag
  • cratis config --missing <model> reads the keys a .play file or folder needs and lists those the environment lacks
  • cratis render renders a model's authentication and onboarding: the AuthProxy, Ante and environment configuration under .runtime/, sign-in and persona mapping, onboarding provisioning and the email templates

Changed

  • The CLI bundles Stage 4.211.0 and Screenplay 4.259.0, and cratis run uses the cratis/stage:4.211.0 image by default

Register a model key source that asks Screenplay's EnvironmentRequirements
for the keys a .play file, or a folder of them, needs: the client id,
client secret, tenant and authority of every identity provider, and the
mail settings when the model declares onboarding. A model that does not
compile is refused with its first errors, since its keys cannot be known.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PWbnPHNUxsNQARmQXpTzpe
Add the pure planning for a model that declares authentication: the
Stage on a per-run network published on loopback only, AuthProxy
configured through its application contract, and with onboarding the
application's own Ante, its MongoDB and the onboarding emails written to
a local folder unless the environment names a mail server.

Secrets only ever become the content of planned files, one file per
environment key. The container arguments carry names, paths and values
that are not secret.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PWbnPHNUxsNQARmQXpTzpe
Resolve the selected environment before Docker starts and fail with the
missing keys, never their values. Write the environment's values to an
owner-only temporary folder, start the planned containers beside the
Stage, wait for AuthProxy to answer, list each service's address, and on
Ctrl+C stop everything in reverse order, remove the network and delete
the folder. A model without authentication runs as before.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PWbnPHNUxsNQARmQXpTzpe
@einari einari added minor New features, non-breaking additions environments onboarding labels Nov 1, 2026 — with Claude

einari commented Nov 1, 2026

Copy link
Copy Markdown
Contributor Author

Notes for reviewers (part of Cratis/Screenplay#1114):

  • Local checks: Debug and Release builds with zero warnings against Screenplay 4.259.0; Environments.Specs passes; the Run, Config and Environments spec groups pass apart from the known DiagnoseCommand renderings and with_an_invalid_engine › should_list_both_engines, which fail the same way on the base locally.
  • Exercised for real here: a model with authentication started cratis/stage and cratis/authproxy from Docker Hub; AuthProxy redirected to the provider using the client id from the mounted secrets file; no secret value appeared in container environment or binds; SIGTERM removed every container, the network and the run directory.
  • Not exercised end to end: onboarding. ghcr.io/cratis/ante is not pullable from this sandbox, and the released Stage image does not yet accept the onboarding block (Render authentication: run the application behind AuthProxy Stage#915 and Render onboarding: provision from Ante's outcomes, license and email through Showrunner Stage#916 are in progress). AuthProxy accepted the full onboarding contract and both ports routed correctly with a stand-in for Ante. Signing in through a real provider was not tested.
  • Choices to review: Ante image ghcr.io/cratis/ante (what Ante publishes); Ante runs in AuthProxy's network namespace because the contract only allows loopback HTTP in development; AuthProxy uses staged (attested) exchange, so Ante runs Attested with a per-run key pair whose public half is pinned in Ante; GitHub's issuer defaults to https://github.com unless the environment sets issuer.

Generated by Claude Code

Add the application realization to the render profile, reading the model root so onboarding email images are found.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PWbnPHNUxsNQARmQXpTzpe
Set Stage__Sandbox__ForwardedIdentity so the sandbox stops playing a persona when AuthProxy fronts it.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PWbnPHNUxsNQARmQXpTzpe
Stage 4.211.0 realizes the authentication and onboarding blocks that
cratis render and cratis run now use, and is the default cratis/stage image.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PWbnPHNUxsNQARmQXpTzpe
@einari
einari merged commit 46e4734 into main Nov 1, 2026
@einari
einari deleted the env-onboarding/run branch November 1, 2026 18:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

environments minor New features, non-breaking additions onboarding

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants