From Inference Routing to Agent Orchestration: Declarative Policy Compilation with Cross-Layer Verification

arXiv cs.LG / 3/31/2026

💬 OpinionDeveloper Stack & InfrastructureSignals & Early TrendsIdeas & Deep Analysis

Key Points

  • The Semantic Router DSL is a non-Turing-complete, declarative policy language that productionizes per-request LLM inference routing using content signals to select models and enforce privacy, while emitting structured audit traces.
  • The paper extends this approach from stateless routing to multi-step agent orchestration, generating verified orchestration decision nodes for frameworks like LangGraph and OpenClaw.
  • It further compiles the same policies into infrastructure and protocol artifacts, including Kubernetes NetworkPolicy/Sandbox CRD/ConfigMap, YANG/NETCONF payloads, and boundary gates such as MCP and A2A.
  • By leveraging non-Turing completeness, the compiler guarantees properties like exhaustive routing, conflict-free branching, referential integrity, and structurally coupled auditability across layers.
  • Shared signal and threshold definitions enable single-step recompilation that propagates changes from inference gateways through agent gates to infrastructure artifacts, aiming to prevent cross-team policy drift.

Abstract

The Semantic Router DSL is a non-Turing-complete policy language deployed in production for per-request LLM inference routing: content signals (embedding similarity, PII detection, jailbreak scoring) feed into weighted projections and priority-ordered decision trees that select a model, enforce privacy policies, and produce structured audit traces -- all from a single declarative source file. Prior work established conflict-free compilation for probabilistic predicates and positioned the DSL within the Workload-Router-Pool inference architecture. This paper extends the same language from stateless, per-request routing to multi-step agent workflows -- the full path from inference gateway to agent orchestration to infrastructure deployment. The DSL compiler emits verified decision nodes for orchestration frameworks (LangGraph, OpenClaw), Kubernetes artifacts (NetworkPolicy, Sandbox CRD, ConfigMap), YANG/NETCONF payloads, and protocol-boundary gates (MCP, A2A) -- all from the same source. Because the language is non-Turing-complete, the compiler guarantees exhaustive routing, conflict-free branching, referential integrity, and audit traces structurally coupled to the decision logic. Because signal definitions are shared across targets, a threshold change propagates from inference gateway to agent gate to infrastructure artifact in one compilation step -- eliminating cross-team coordination as the primary source of policy drift. We ground the approach in four pillars -- auditability, cost efficiency, verifiability, and tunability -- and identify the verification boundary at each layer.