- 4Uvicorn workers on uvloop behind NGINX
- 3vendors' assistants authenticating against one server
- 2FastAPI apps: the authorization server and the operator console
An OAuth server for AI assistants
Auth and access plane exists because I wanted commercial AI assistants to reach my private tool estate through standard OAuth, with a person approving every grant. I built the authorization server as a FastAPI application. Access tokens are RS256-signed JWTs.
I put TLS, rate limits and process sandboxing in NGINX and systemd, so the front end protects the application independently of the application's own code.
Most of the effort went into interoperability, which is where the real work in OAuth for AI assistants lies. Each vendor reads discovery documents its own way, orders consent differently and caches its client identity differently, and it took a long series of fixes before every vendor's assistant authenticated against one server.
The consent screen also sets token lifetimes per grant, because a desktop assistant and an unattended machine client need different terms.
I made the consent screen the control point, because it is the one place a person sees exactly which client is asking for exactly what.
A hardened operator console
A second FastAPI app with server-side templates is the operator console: single sign-on with an allow-list, minting tokens for machine clients, revoking them, and approving or deleting pending dynamically registered clients.
In the hardening pass I turned off the console's generated API documentation pages, since an admin surface has no reason to describe itself to whoever finds it, and cut the server's health endpoint down to a bare status. The registration lock I added in that pass, and reverted the next day when it broke every client, is the story The hardening fix that locked everyone out.
Bar lengths are illustrative: the exposed surface, not a measured size.
A prototype rebuilt in Rust
FAFO Core and Function Forge started as a FastAPI dispatch service. I wanted to prove that embedding, local-LLM and cluster-health jobs could be pushed to spawned workers over Redis and offered to AI clients, and Python was the quickest way to prove it. Once the idea held, I rebuilt it in Rust as the control plane, admission controller and gateway that make up the substrate, because the prototype was never going to carry the load or the correctness guarantees I wanted.
Layer thickness is illustrative.