Skip to content

fix: harden managed readiness status#195

Merged
mslipper merged 2 commits into
mainfrom
fix/pr-190-managed-failclosed
Jun 16, 2026
Merged

fix: harden managed readiness status#195
mslipper merged 2 commits into
mainfrom
fix/pr-190-managed-failclosed

Conversation

@mslipper

Copy link
Copy Markdown
Contributor

Builds on PR #190 and keeps the original managed-mode API commit in history, then hardens the readiness and status behavior found during review. Failed sync applies no longer advance applied status, readiness denials now audit consistently, and the fail-closed gate covers HTTP, tunnels, and SNI-only passthrough. Validated with go test ./....

Centaur AI and others added 2 commits June 12, 2026 14:09
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>
@mslipper mslipper merged commit 6973e80 into main Jun 16, 2026
5 of 6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant