Reflex: Rust library for control loops that act on observability data Datadog Labs released Reflex, a Rust library for control loops that act on observability data, turning Datadog metrics and Toto forecasts into typed state that a model such as TypeSafe AI's Jev can act on. Reflex commits a recommended action only if it passes declared guards and invariants, and the repository includes a simulator that runs Reflex against simulated services for circuit breaking, scheduling, autoscaling, and retries. Guards reject recommendations when the circuit changed mid-decision, Datadog evidence is missing or stale, or the recommendation exceeds its 10-second execution deadline. Reflex is a Rust library for control loops that act on observability data. Metrics queried from Datadog https://www.datadoghq.com/ and forecasts from Toto https://github.com/DataDog/toto become typed state. A model, such as TypeSafe AI's Jev , recommends an action, and Reflex commits it only if it passes the guards and invariants you declared. Application supplies typed state ↓ Judge recommends an action ↓ Executor checks legality, guards, and invariants ↓ Verified state transition ↓ Optional effects perform external work Reflex fits control loops where the right action depends on changing conditions, but execution must obey fixed constraints. - Circuit breaking. Open, probe, or close based on service health, while enforcing cooldowns and probe limits. - Scheduling. Choose which request gets capacity next, while enforcing resource limits. - Autoscaling. Add or remove capacity based on demand and forecasts, while enforcing capacity bounds. - Retries. Decide whether to retry a failed request and how long to back off, while enforcing retry budgets and a maximum backoff. The repository includes a simulator that runs Reflex against simulated services. The sections below walk through its circuit breaker, starting with the state machine and then the running simulation. A gateway routes client traffic to three services, Catalog, Payments, and Search, each behind its own circuit. Jev decides when a circuit should open or probe. Reflex decides whether that decision may take effect. Each recommendation is a typed action. Besides Jev's choice, it carries the Datadog evidence the decision was based on, when that evidence was observed, and the circuit revision it applies to. struct Action { choice: Choice, // Open, Probe, or NoChange telemetry: Option