AI Engineering in Practice7 min read
FastAPI CORS for production agentic APIs
How to configure CORS for a production agentic API without wildcard origins. The allowlist, the credentials flag, and the preflight that breaks SSE.
Build Your First Software Factory Execution Harness live Thursday, Oct 1, 12:00 PM ET
Oct 1, Reserve a seatExplore our latest articles and insights about API Development.
20 posts in total
AI Engineering in Practice7 min read
How to configure CORS for a production agentic API without wildcard origins. The allowlist, the credentials flag, and the preflight that breaks SSE.
AI Engineering in Practice8 min read
Why FastAPI lifespan is the only right place for agent startup code. Per-worker initialization, ordered teardown, and the bugs it kills.
AI Engineering in Practice9 min read
How async context managers prevent connection leaks in Python AI services. The lifespan, contextvars, and middleware patterns that survive load.
AI Engineering in Practice8 min read
How to wire LangGraph into a FastAPI chatbot API with streaming, persistence, and per-user threads. The production pattern that scales past demos.
AI Engineering in Practice9 min read
How FastAPI Depends makes agent auth testable and composable. The pattern, the chain, and why module-level globals break at scale.
AI Engineering in Practice9 min read
How to persist agent state in Postgres so conversations survive restarts. The schema, the session writer, and the idempotency rule that prevents loss.
AI Engineering in Practice9 min read
How a service layer in an AI agent codebase decouples business logic from HTTP routes. The pattern, the tests, and the refactor from a fat route.
AI Engineering in Practice9 min read
How to parse environment variables in Python AI services without os.environ.get footguns. Pydantic Settings, type coercion, and the validation layer.
AI Engineering in Practice11 min read
How to sanitize agent API inputs beyond frontend validation. Prompt injection defense, payload limits, and the 4 layers every agent service needs.
AI Engineering in Practice11 min read
How to version an agentic API without breaking clients. The URL prefix pattern, the deprecation playbook, and when to ship v2.
AI Engineering in Practice11 min read
How to use JWTs for agentic API auth. The claims that matter, the refresh rotation pattern, and the middleware that keeps long-running agents logged in.
AI Engineering in Practice11 min read
How to rate limit a FastAPI agent service. Token buckets per user, burst control, and the Redis pattern that survives multi-worker deployments.
20 posts in total
AI Engineering in Practice7 min read
How to configure CORS for a production agentic API without wildcard origins. The allowlist, the credentials flag, and the preflight that breaks SSE.
AI Engineering in Practice8 min read
Why FastAPI lifespan is the only right place for agent startup code. Per-worker initialization, ordered teardown, and the bugs it kills.
AI Engineering in Practice9 min read
How async context managers prevent connection leaks in Python AI services. The lifespan, contextvars, and middleware patterns that survive load.
AI Engineering in Practice8 min read
How to wire LangGraph into a FastAPI chatbot API with streaming, persistence, and per-user threads. The production pattern that scales past demos.
AI Engineering in Practice9 min read
How FastAPI Depends makes agent auth testable and composable. The pattern, the chain, and why module-level globals break at scale.
AI Engineering in Practice9 min read
How to persist agent state in Postgres so conversations survive restarts. The schema, the session writer, and the idempotency rule that prevents loss.
AI Engineering in Practice9 min read
How a service layer in an AI agent codebase decouples business logic from HTTP routes. The pattern, the tests, and the refactor from a fat route.
AI Engineering in Practice9 min read
How to parse environment variables in Python AI services without os.environ.get footguns. Pydantic Settings, type coercion, and the validation layer.
AI Engineering in Practice11 min read
How to sanitize agent API inputs beyond frontend validation. Prompt injection defense, payload limits, and the 4 layers every agent service needs.
AI Engineering in Practice11 min read
How to version an agentic API without breaking clients. The URL prefix pattern, the deprecation playbook, and when to ship v2.
AI Engineering in Practice11 min read
How to use JWTs for agentic API auth. The claims that matter, the refresh rotation pattern, and the middleware that keeps long-running agents logged in.
AI Engineering in Practice11 min read
How to rate limit a FastAPI agent service. Token buckets per user, burst control, and the Redis pattern that survives multi-worker deployments.