Compare commits

...

2 commits

Author SHA1 Message Date
Matthew Slipper
76ac7baf12 fix: harden managed readiness status 2026-06-16 08:34:20 -06:00
Centaur AI
16851ca65b feat: managed-mode management API (status, sync) and fail-closed startup
Managed proxies previously ran with no management server at all, and a
proxy served requests with whatever pipeline it had - including the empty
pre-first-sync pipeline - passing placeholder credentials upstream
un-transformed.

- allow management.listen in managed mode: it now serves GET /v1/status
  (the applied control-plane state: config hash, principal, last sync)
  and POST /v1/sync (request an immediate out-of-band sync). /v1/reload
  stays standalone-only since there is no file to re-read.
- IRON_MANAGEMENT_LISTEN env override, matching the other IRON_* vars.
- the sync poller records a status snapshot (config_hash, principal_id,
  principal_status, synced_once, last_sync_at) and accepts a non-blocking
  Poke() that wakes the poll loop early.
- fail closed during startup: proxy.Options.Ready gates request handling
  with 503 until the first control-plane config has been applied, so a
  freshly started or restarted managed proxy can never leak placeholder
  credentials to upstream APIs.

The motivating incident: a sandbox control plane reassigned a proxy's
principal and routed traffic immediately; the first LLM call beat the
proxy's next 5s sync poll by ~350ms and went upstream with a placeholder
key (401). With this change the control plane can POST /v1/sync and poll
GET /v1/status until principal_id matches before routing traffic.

Amp-Thread-ID: https://ampcode.com/threads/T-019eb82e-5bc9-707f-9d5c-cdb6c9d16926
Co-authored-by: Amp <amp@ampcode.com>
2026-06-12 14:09:29 +02:00
13 changed files with 591 additions and 45 deletions