Adoption & procurement · Research feature

KedgeFlow: A Programmable Control Plane for Enterprise AI Agents

Boundary tests rejected unauthorized and altered requests before consumption.

Adapted from research by Jun He, Deying Yu.

arXiv preprint revision · 2026-10-10 · Attribution & reuse
In this article
Editorial illustration of stacks of coins.

Authors’ overview

Enterprise AI agents can execute altered versions of approved actions, concurrently reuse the same permission, or retry operations whose responses were lost. These failures arise when approval and resource execution lack a shared contract. KedgeFlow specifies language-independent contracts for trusted controllers to authorize state-changing operations and privileged gateways to enforce that authority independently of agent reasoning. Inspired by OpenFlow, it connects policy checks supported by evidence, signed permission for an exact action, a shared allowance that can be consumed only once, target-side conditions for applying the change, and retained outcome records. Under trusted issuance of exact-action authority, two conditional properties establish at most one successful claim per allowance and link every governed dispatch to a matching grant, claim, and subsequent dispatch authorization, even when the agent is compromised. A reference implementation exposes this execution path to agent systems through the Model Context Protocol (MCP). In the single-resource evaluation, 6,560 concurrent ledger claim attempts yielded exactly one successful claim for each of 82 allowances. Boundary tests rejected unauthorized and altered requests before consumption. A 32-call gateway race produced one committed mock effect, and a retry after a lost response produced no additional dispatch. Deliberately permissive policy nevertheless authorized an undesirable effect, exposing the limits of execution authorization. Evaluation uses three members of the etcd coordinated key-value store on one host, synthetic authentication and authorization inputs, and a mock target that rejects stale requests. Distributed reservations, enforcement of every production access route, native crash recovery, exactly-once effects at real targets, and interoperability between independent implementations remain untested.

Introduction

Large language model (LLM) agents can automate infrastructure work, including software development, cloud administration, and database operations. Tool protocols such as the Model Context Protocol (MCP) connect agents to external services. Some tools can change production state: for example, draining a cluster node removes it from active service, while changing a routing rule redirects traffic. Giving an agent credentials for these operations allows its reasoning to determine which changes reach the resource.

The gap between approval and execution appears in three failure modes. In parameter substitution, an agent approved to drain a test node presents the valid permission with a production database node substituted as the target. In concurrent reuse, two agent tasks present the same permission simultaneously; separate gateway checks can both succeed unless they share a record of its use. In lost-response retries, a timeout leaves the agent unable to determine whether a cloud operation took effect. Repeating a non-idempotent operation—one that can produce an additional effect each time it runs—may then duplicate the change. These cases require checks on the exact request, coordination of permission use, and explicit handling of uncertain outcomes.

KedgeFlow specifies a shared contract for those responsibilities. Admission checks a proposed action against policy and supporting evidence independently of the agent. Successful admission permits issuance of a signed grant: permission for the specified action, target, and parameters. The grant refers to an execution root, the identity of a single-use allowance shared by that grant and any replacement grants. A gateway claims the allowance by atomically recording its consumption in shared state, so two concurrent requests cannot both claim it. The gateway then rechecks current authority and authorizes dispatch, the act of sending the verified request to the target. Dispatch is distinct from commitment, when the target applies the change. A target guard is a condition that must hold for the change, such as an expected resource version. If the outcome is uncertain, the allowance remains consumed; losing a response does not create permission to retry.

Section 2 defines the threat model and architecture. Section 3 specifies the interfaces and candidate message formats. Section 4 develops the two conditional properties and the treatment of uncertain outcomes. Section 5 reports the reference evaluation, and Section 6 discusses deployment limits and related work.

Three planes and nine roles

The components must preserve a consistent authorization decision across their handoffs. A policy decision, a signed grant, a gateway check, and a target guard each establish a local property. Their integration must preserve the relationships between those properties: who admitted the final request, which allowance it consumes, which target conditions apply, and what is known about its effect. Correct local components do not establish those relationships when their ownership, identifiers, or state transitions disagree.

Consider two infrastructure agents approved to drain different nodes of a healthy three-node service that requires two available nodes. Each approval is reasonable against the initial state, but concurrent execution violates the availability requirement. This example identifies a coordination requirement for future multi-resource extensions; the present protocol and its safety results cover independently governed single-root actions, not globally serializable reservations across distinct execution roots. Exact-action binding prevents either agent from changing its approved target or expected version. A shared execution root prevents reuse of either agent’s allowance, but does not coordinate the two distinct allowances. Shared resource reservations are needed to coordinate those competing operations. The target must check the availability condition atomically with the change to prevent a race between checking and applying it. Finally, outcome reconciliation correlates an uncertain attempt with later observations, so an unconfirmed effect is not treated as absent before reserved capacity is released. The reference experiments demonstrate exact binding, atomic root consumption, and retained uncertainty for a single-resource path. They do not demonstrate distributed multi-resource reservations or a fleet-wide availability guarantee; this scenario motivates the broader architecture.

KedgeFlow specifies a programmable controller–gateway boundary for these relationships. Existing runtimes retain reasoning and workflow logic. Trusted controllers admit a frozen request, whose approved fields cannot change, and issue authority for that request. A separately privileged gateway validates the authority, claims its shared allowance, and dispatches through a resource adapter. The execution root identifies one allowance shared across successive grant versions, called generations. Retrying a request or replacing an unclaimed grant does not create another allowance.

The Agent Plane owns reasoning, planning, and workflows. Its Agent Adapter records the action and parameters of a protected tool call as a proposal and tracks that proposal while admission or execution is pending. The adapter may be a runtime hook, a software development kit (SDK) wrapper, a workflow step, or a protocol client. Its security role ends where the agent can alter its behavior; resource-side enforcement remains necessary.

Controller–gateway programming contract

KedgeFlow specifies roles, message formats, validation rules, and observable state transitions independently of implementation language. Implementations may use different languages and internal components, provided they preserve the specified request bindings, canonical record bytes, authority coordination, and outcome semantics. The safety propositions depend on these properties, not on a particular language or storage product. The evaluated reference uses etcd for coordinated authority state; another store would need to provide the same atomicity and durability assumptions. These contracts support independent implementations, but interoperability between such implementations has not been demonstrated.

The Enforcement Control Interface defines how a trusted controller programs the gateway, analogous in architectural role to OpenFlow’s controller-to-switch interface. The controller distributes policy versions; accepted issuer keys and revocations; resource and action descriptors; execution grants and active generations; and ownership, fencing, and supported protocol configurations. Policy and ownership epochs are revision numbers used to reject stale authority. In return, the gateway reports supported actions and adapter guarantees, accepted configuration and authority versions, attempt identities with execution receipts, and observed outcomes or explicit uncertainty. A receipt records the reported result of an attempt. Installation must preserve signed constraints and return the accepted version and the scope it covers, or a rejection; stale enforcement state cannot silently authorize affected actions.

Accepted versions and capabilities return through Enforcement Control; attempt receipts, status, and uncertainty return through Execution and Outcome. These exchanges have distinct owners and purposes: controller programming changes accepted authority, while the agent’s separate Execution Interface is used by agents to redeem authority for an exact request. The six interfaces are semantic contracts, not six required network protocols.

Each authority scope requires one coordinated owner. Separate issuer and gateway stores are insufficient even if each store orders its own operations consistently: issuance, replacement, and claim could succeed against different copies of a root. These transitions must share one atomic authority domain, in which their checks and updates have a common order, or use an equivalent coordination protocol. An etcd transaction orders authority metadata; it does not atomically commit a remote resource effect.

Candidate wire profile and conformance limits

The candidate wire profile defines the message format used to exchange records. Its JSON envelope, the outer structure surrounding a payload, permits only profile, kind, schema, key_id, payload, and signature. The reference implementation applies restricted RFC 8785 canonicalization, which gives a record a deterministic byte representation for signing and hashing: UTF-16 property ordering, no Unicode normalization, safe-integer tokens, and rejection of duplicate keys, malformed Unicode, floating/exponent tokens, and trailing data. It refuses unknown envelope and grant fields. Passing signature test vectors for other record kinds does not establish their full payload validation or signer-role semantics.

The reference MCP transport uses size-limited JSON POST requests for discovery, tool listing, and invocation. Client and gateway must explicitly negotiate how the grant is transmitted: inline, in exactly one dedicated header containing the base64url envelope, or by reference, using its 64-character full-envelope digest. In the latter case, an authenticated resolver at a fixed trusted endpoint returns the envelope. Mixing transmission methods, following redirects, using unsupported profiles, or failing resolution causes execution to be refused. Both methods consume the same ledger root. The implementation limits encoded inline headers to 6,144 bytes and resolved envelopes to 65,536 raw bytes. Exact wire identifiers, schemas, and test vectors are documented in the public artifact.

The evaluated node-drain action takes exactly two arguments: the target node and its expected resource version. The grant binds those parameters, resource incarnation, action schema, guard condition, and adapter contract. The adapter adds the fence, attempt ID, grant digest, and resource incarnation to the native request. A terminal mock receipt binds attempt, grant digest, resource incarnation, fence, status, and resulting resource version. Ordinary tool completion is insufficient evidence of a committed mutation.

Record conformance checks canonicalization, signatures, schemas, and bindings. Enforcement-path conformance adds credential isolation, shared claims, current authority, adapter semantics, and retained outcomes. Deployment qualification adds complete mediation, policy/evidence ownership, writer inventory, real target semantics, and recovery. These explanatory scopes are not adopted certification levels. Tests support only a bounded record/enforcement slice; one SDK path does not establish independent peers or full MCP transport conformance.

Exact validation, claim, and dispatch

The gateway verifies the signed grant against enrolled issuer keys, current time, and its audience. The independently authenticated subject, workload, proof-key thumbprint (the hash identifying the caller’s proof key), and delegation must match the grant, as must the action, resource incarnation, parameters, and descriptor. A request cannot broaden permission by changing its natural-language description or presenting forged approval fields. The reference path supports delegated user-token verification and Demonstrating Proof of Possession (DPoP), which binds a token to a caller-held key, plus mutual Transport Layer Security (mTLS) authentication of the calling workload. The adversarial harness substitutes explicit subject-authentication test components.

For the implemented single-resource path, issuance creates an unclaimed root with one active grant/generation. Replacement advances generation and fence only while that exact root remains unclaimed. Claim compares the active root, grant digest, unused nonce, policy and ownership epoch, then atomically writes a claimed root, nonce consumption, attempt, and dispatch-intent record. All participating gateways use the same etcd authority state.

After exchange, the gateway checks remaining validity, current authority, and dispatch authorization before invoking the adapter. Policy and ownership are compared at the atomic dispatch-authorization transaction; a subsequent revocation cannot recall an authorized in-flight request. That transaction and the network effect are not atomic together. An exchange failure, expired deadline, or refused dispatch does not refund consumption. A durable outbox record retains dispatch intent and known status; its presence does not instruct the gateway to retry the target operation.

Proposition 1 establishes at-most-one successful claim per execution root allowance, not exactly-once mutation on the remote target. Two independently created roots for the same logical business action are not automatically deduplicated; preventing redundant root creation belongs to trusted admission and grant authority ownership. A late or duplicated network request requires target-side idempotency or fencing. Coordinating distinct roots that compete for shared capacity requires an explicit multi-resource reservation protocol, which is outside the single-root execution contract. Coordinated multi-step workflows with compensation, cross-cluster reservations, and global atomic commit across arbitrary targets are outside the implementation.

Unknown outcomes retain consumption

A lost response can mean no effect or an effect whose acknowledgment disappeared. The gateway reports Unknown and attempts to persist it without restoring allowance. Only persisted Unknown enters the reconciliation API. A failed completion write or process crash can instead leave a durable Claimed attempt: its allowance is consumed, but no completion status has been saved.

Five distinct crash intervals expose this gap: crashing after claim but before credential exchange leaves the root consumed and durable intent recorded as claimed-not-dispatched, an intermediate state that does not constitute terminal no-dispatch evidence since a live executor could still advance it; crashing after exchange but before dispatch authorization leaves a minted target credential before authorization is recorded in shared state; crashing after authorization but before target contact leaves dispatch-authorized intent without confirming whether the outbound request was initiated or reached the target; crashing after target contact but before observing a validated outcome leaves target mutation status unestablished; and crashing after outcome receipt but before durable completion recording leaves the observed target result unpersisted in the attempt record. The reference implementation has no separate durable receipt journal; these are code-derived windows, not executed crash experiments.

The required recovery discipline follows six core rules: never automatically return consumed authority to the available pool, preserve durable attempt identity across crash and restart boundaries, distinguish “no dispatch” from “no effect”, require authenticated target evidence for committed-effect conclusions before updating status from Unknown to Committed, account for late or delayed effects before reissuing fresh authority or initiating compensation, and avoid blind retries of non-idempotent operations. The winning attempt is retained in shared state; a replay rejection does not recover its identity. Correlation requires attempt, root, grant digest, and a nonempty target reference; an expected resource value alone is insufficient. The reconciliation library changes Unknown to Committed only for a matching committed observation. Pending or other observations retain Unknown, and its scripted querier tests correlation and conservation only.

Queries never redispatch or replenish authority. Even terminal outcomes recording nondispatch or guard refusal retain consumption. Reissuance or compensation needs authoritative no-effect or committed-effect evidence as appropriate, protection against late effects, fresh admission, and conserved budget. Compensation is a separately authorized action. Stranded-claim repair, executor recovery barriers, and production authenticated target-query reconciliation remain future implementation work; the current implementation does not provide complete crash recovery.

Implementation scope and experimental setup

The adversarial harness connects a minimal independent authorization decision to signing, issuance, and an in-process gateway call. It uses synthetic subject authentication and workload issuance, with actual outbound mTLS to the broker and target. Other suites exercise cryptographic caller authentication, SDK compatibility, and transport boundaries separately.

The public artifact preserves the evaluated reference runtime and its dependency lockfiles. Snapshot hashes are checked against the upstream source revision; exact source and dependency versions are recorded in the artifact. Historical Go proxy or admission results are excluded. A Go harness launches the official embedded etcd test cluster.

The evaluation runs on one ARM64 macOS workstation. Three etcd members use distinct local endpoints for client requests and Raft consensus, along with separate data directories. Cargo builds and tests the reference runtime offline with locked dependencies; the test configuration requires real etcd and the official MCP client SDK, so missing dependencies fail instead of silently skipping tests. All 58 implementation tests pass, with no failures, ignored tests, or detected skips: 52 upstream tests, five paper safety tests, and one test containing 12 adversarial scenarios.

The instrumented chain counts authorization decisions, signed grants, successful claims, dispatch authorizations, credentialed target requests, mock commitments, and gateway-visible uncertainty separately. A claim consumes allowance before target contact. Dispatch-authorization and target-request counts coincide in these scenarios but are measured independently; other suites receive no inferred stage counts.

Conclusion

KedgeFlow defines a programmable controller–gateway contract for independently authorized, consequential actions in enterprise distributed systems. It separates agent reasoning from mutation authority, specifying how authority is bound, consumed, enforced, and reconciled. Two conditional results connect single-use authority and governed dispatch to explicit shared-state and issuance assumptions. The reference implementation exposes the execution path through MCP for integration with agent systems. Its evaluation demonstrates refusal of altered requests and retained consumption under concurrent calls and lost responses across 58 tests (12 deterministic adversarial scenarios); permissive policy exposes the limit of execution authorization. Complete mediation, sound admission, native recovery, and interoperability between independent implementations remain outside the demonstrated guarantees.