AI Stack Architecture & Comparison

How KedgeFlow Fits in the AI Stack

KedgeFlow is an agentic execution-control plane that lets engineering and security teams enforce single-use, state-checked approvals on AI agent writes without replacing their orchestration framework, prompt guardrails, IAM provider, or tracing stack.

Most production AI teams already run orchestration frameworks, inference guardrails, API gateways, and observability tools. Those systems coordinate planning, screen text, authenticate workloads, and log runs. KedgeFlow fills the runtime boundary between a proposed action and a protected state change, paired with KedgeSpec for declarative policy compilation across planes.

Layering Model

Where Each Layer Operates

Layer 01

Agent Runtime & Orchestration

LangGraph, CrewAI, OpenAI / Claude / Google Agent SDKs

Reason, plan multi-step workflows, and emit typed action proposals.

Layer 02

Inference Guardrails & Prompt Filters

NeMo Guardrails, Lakera, AWS Bedrock Guardrails

Screen untrusted inputs, prompt injection, PII leakage, and disallowed text.

Layer 03

Declarative Policy as Code

KedgeSpec compiled to OPA / Cedar and monitors

Declare MAY, MUST / MUST NOT, SHOULD, and AFTER ... MUST rules once in versioned source.

Layer 04

Agentic Execution-Control Plane

KedgeFlow Gateway (kf-proxy) + Transactional Authority Ledger

Verify fresh evidence, claim single-use grants, enforce live target guards and shared fleet limits, and reconcile timeouts.

Layer 05

Identity, API Gateways & Protected Targets

IAM, OAuth/OIDC, SPIFFE, Envoy, Kubernetes, Databases, Payment APIs

Authenticate workloads, route network traffic, and commit guarded state changes.

Layer 06

Observability & Tracing

LangSmith, Arize, OpenTelemetry

Inspect runs, latency, prompts, token costs, and offline evaluation quality.

Adjacent Categories

KedgeFlow vs. Four Adjacent AI Stack Categories

Each row states what the adjacent category solves, where its enforcement boundary stops, how KedgeFlow complements it, and a factual verdict on when to add KedgeFlow.

Adjacent CategoryWhat it solvesWhere it stops (the gap)How KedgeFlow fitsWhen to choose KedgeFlow

Agent orchestration frameworks

LangGraph, CrewAI

Complements
Coordinates multi-step reasoning, tool routing, workflow checkpoints, human interrupts, and multi-agent handoffs inside the agent runtime.Approvals and checkpoints live inside the agent process. They do not isolate production credentials from the runtime, enforce live target-state checks at dispatch, cap aggregate risk across separate teams' runtimes, or prove whether a timed-out write committed.Keep LangGraph or CrewAI for planning and orchestration. Attach an adapter that sends typed action proposals to KedgeFlow, which holds target credentials, claims single-use grants, checks target guards, and reconciles uncertain outcomes outside the runtime.Add KedgeFlow alongside an orchestration framework like LangGraph or CrewAI when production APIs need independent credential custody, single-use argument-bound approvals, live state checks, or shared capacity limits enforced outside the agent runtime.

LLM guardrails / prompt filters

NeMo Guardrails, Lakera, AWS Bedrock Guardrails

Complements
Screens prompts, retrieved context, and model responses at inference time to filter prompt injection, PII exposure, toxicity, and disallowed topics.Operates on text before tool dispatch and cannot verify live target state or business eligibility. A clean, non-toxic request can still refund the wrong amount, drain a Kubernetes node after spare capacity drops, or replay an older approval.Use prompt guardrails to filter untrusted inputs and model text upstream. Put KedgeFlow at the execution gateway to check fresh target state, bind approvals to exact arguments, and block unauthorized mutations before forwarding writes.Add KedgeFlow alongside LLM guardrails like NeMo Guardrails or Lakera when you must verify live target state, enforce exact argument limits, and block unauthorized API mutations that pass content and prompt-safety checks.

Traditional API gateways & IAM

Envoy, Kong, AWS IAM, OAuth/OIDC

Complements (extends gateway layer)
Authenticates users and workloads, enforces role or endpoint access policies, applies rate limits, and routes API traffic for deterministic services.Authorizes whether a service identity may call an endpoint, not whether one specific agent-proposed action is backed by fresh evidence, bound to exact parameters for single use, constrained across concurrent agents' active exposure, or reconciled safely after a timeout.Keep OAuth/OIDC or SPIFFE for workload identity and Envoy for traffic mediation. KedgeFlow adds action-bound admission, atomic single-use grant claims, exposure conservation, and post-claim credential exchange on top of existing identity and proxy infrastructure.Add KedgeFlow alongside traditional API gateways and IAM when autonomous agents require single-use, argument-bound authorization, live target-state checks, and timeout reconciliation beyond static role permissions.

Observability / tracing tools

LangSmith, Arize

Complements
Records prompts, tool invocations, token costs, latency, and evaluation metrics so engineering teams can debug agent behavior and monitor quality.Traces are passive records inspected alongside or after execution. They cannot stop a database write when the underlying record changed after the agent read it, prevent a blind retry after a payment timeout, or produce cryptographic admission-to-receipt authorization proofs.Keep LangSmith or Arize for debugging runs and evaluating prompts. Put KedgeFlow on the protected write path to enforce pre-execution state guards, preserve explicit unknown outcomes on timeout, and emit tamper-evident receipts linking proposal, evidence, approval, and target confirmation.Add KedgeFlow alongside observability tools like LangSmith or Arize when teams need pre-execution controls that block stale or unauthorized writes and emit signed admission-to-outcome receipts in addition to run traces.

End-to-End Flow

One Production Action Across All Five Layers

  1. 01

    LangGraph / MCP

    Construct exact proposal

    The agent proposes one specific refund ($150 for order_8491) or Kubernetes node drain and freezes the target, action, and arguments.

  2. 02

    NeMo Guardrails / Lakera

    Screen prompts and text

    Inference guardrails check incoming ticket text and model output for prompt injection, PII exposure, and disallowed content.

  3. 03

    KedgeSpec + OPA / Cedar + KedgeFlow

    Verify live state & issue grant

    Admission evaluates fresh fraud or cluster-capacity evidence and shared fleet limits, then issues an expiring, single-use grant bound to the exact arguments.

  4. 04

    KedgeFlow Gateway + Envoy / IAM

    Claim grant & execute guarded write

    The gateway claims the grant atomically, exchanges scoped credentials outside the agent runtime, checks the target guard, and dispatches the call.

  5. 05

    LangSmith / Arize + KedgeFlow Outcomes

    Trace run & reconcile receipt

    Tracing tools record run telemetry while KedgeFlow stores the signed target receipt or marks a timeout unknown for read-only reconciliation.

When existing controls may be enough

SDK approvals and standard IAM suffice when:

  • Agents only read data or execute fully idempotent, low-consequence operations.
  • A single runtime is the only path to the target and the service owner trusts that runtime to enforce rules.
  • Multiple independent agents do not share a fleet-wide capacity, rate, or spend boundary.
When an execution-control plane is required

Add KedgeFlow at the write boundary when:

  • Multiple teams, agent frameworks, or model providers call the same production APIs.
  • Production credentials, approvals, and audit records must stay inside operator-administered infrastructure.
  • Writes depend on live cluster or database state, cannot safely double-execute after a timeout, or share a global risk cap.

Technical Documentation FAQ

Architecture, Security, and Integration Questions

Direct technical answers on deterministic policy enforcement, air-gapped deployments, argument binding, timeout recovery, shared capacity limits, and multi-framework standardization.

How do you enforce deterministic policies on autonomous AI agents?

Enforce deterministic policies by separating model reasoning from execution authority and requiring every state-changing tool call to pass an external admission check before dispatch. An independent control plane evaluates the exact proposed action against policy engines such as OPA or Cedar and issues a single-use grant only when all required rules and evidence checks pass.

  • KedgeFlow separates proposal submission from execution through its Enforcement Control Interface, requiring the agent to freeze the target, action, and arguments before admission runs.
  • Policy decisions from OPA or Cedar (optionally compiled from KedgeSpec MAY, MUST, and MUST NOT rules) bind to the exact proposal and policy version before a separate authority service issues a short-lived grant.
  • The kf-proxy reference gateway verifies and claims the grant once before forwarding the call; production enforcement requires routing all protected write paths through the gateway.

How do you run AI agents in air-gapped or regulated environments?

Run AI agents in air-gapped or regulated environments by keeping policy evaluation, approval authority, production credentials, and audit storage inside infrastructure the organization administers. Models may run locally inside the air-gapped boundary or as hosted services receiving only permitted context, while a local execution gateway mediates every consequential call to protected systems.

  • KedgeFlow places the admission service, authority ledger, and kf-proxy execution gateway inside operator-controlled infrastructure, with no external control-plane dependency required by the open KF-JSON-0.2 protocol.
  • Target credentials remain inside the enforcement plane and are exchanged only after the gateway atomically claims a valid action grant, keeping standing production keys out of local or hosted reasoning runtimes.
  • Regulated deployments combine this gateway boundary with workload attestation (such as SPIFFE/SPIRE), network isolation, and target integrations that close alternate shell or SDK write paths.

How do you prevent an AI agent from modifying tool arguments after approval?

Prevent post-approval argument tampering by binding each approval cryptographically to the canonical caller, tool, target, parameters, and expiration window. At dispatch time, an external gateway recomputes the request binding against the issued grant and rejects any call whose arguments differ or whose grant has already been claimed.

  • KedgeFlow's KF-JSON-0.2 proposal format fixes the exact action descriptor, target resource, caller identity, and parameter payload prior to admission.
  • The authority service issues an expiring, single-use grant tied to that exact proposal digest, and the kf-proxy gateway atomically claims the grant nonce in a transactional store (verified locally against a three-member etcd cluster).
  • Any parameter edit, missing grant, or replayed approval fails verification at the gateway before target credentials are obtained or the downstream tool call is dispatched.

How do you prevent AI agents from double-charging or duplicating writes after an API timeout?

Prevent duplicate writes after a timeout by assigning every mutative attempt a stable operation reference and prohibiting automatic retries when the target's response is lost. The control plane keeps the original approval consumed, marks the outcome as unknown, and requires a read-only status check against the target system before anyone authorizes a second attempt.

  • KedgeFlow's outcome contract records a lost response or network timeout as an explicit unknown state for that dispatch attempt, neither refunding the consumed grant nor assuming the write failed.
  • Reconciliation runs exclusively through read-only query paths correlated to the original attempt identity until the target confirms whether the mutation committed.
  • While an attempt stays unresolved, KedgeFlow retains its reserved risk in unresolved exposure U(d) and requires fresh admission and a new grant for any subsequent write or compensation action.

How do you stop an AI agent from acting on stale cluster or database state?

Stop stale-state mutations by attaching timestamped evidence to the approval request and enforcing a live state precondition at the target resource right before the write commits. If cluster capacity, database row versions, or eligibility records change between the agent's observation and execution, the conditional guard fails and the mutation is rejected.

  • KedgeFlow requires admission to evaluate freshness-bounded evidence witnesses (such as telemetry snapshots, semantic checks, or human reviews) bound to the specific proposal and validity window.
  • Approved grants carry declared target-state guards (such as a Kubernetes resourceVersion check or database version predicate) that the enforcement gateway forwards to the target integration.
  • When live target conditions no longer hold at dispatch, the guard rejects the mutation and records a stale-guard outcome; production guarantees depend on a target integration capable of enforcing the required condition.

How do you enforce a single safety or capacity limit across multiple independent AI agents?

Enforce a shared safety limit across concurrent agents by accounting for active, reserved, and unresolved risk inside one transactional authority ledger before approving each new action. Every independent agent draws against the same constraint domain budget, preventing separate workflows from each passing local checks while violating a fleet-wide threshold together.

  • KedgeFlow v0.91 specifies cross-root exposure conservation (Proposition 7) for each constraint domain d, tracking committed active exposure C(d), held reservations H(d), and unresolved exposure U(d).
  • Before issuing a new grant with exposure E, the authority service checks C(d) + H(d) + U(d) + E <= B(d) atomically in the ledger without requiring the agents to share a parent workflow or saga.
  • Redeeming a single-use grant transitions risk from held to active or unresolved exposure, keeping capacity reserved until the target confirms completion or release.

How do you prevent prompt injection from abusing production API credentials held by an AI agent?

Prevent prompt injection from abusing production credentials by removing API keys, database tokens, and admin roles from the agent runtime completely. An untrusted or compromised agent can then only emit structured proposals to a separately administered gateway that evaluates policy before exchanging credentials and calling the target.

  • KedgeFlow isolates credential custody in the enforcement plane, exchanging short-lived target credentials (for example, through OAuth token exchange or cloud STS) only after claiming an action-bound grant.
  • Untrusted tickets, logs, or tool outputs read by the model can alter a candidate proposal, but the proposal still fails admission or gateway checks if it violates policy or lacks fresh supporting evidence.
  • Complete mediation requires confining the agent runtime (for example, with userspace kernels such as gVisor and strict egress rules) so the agent has no alternate shell, file, or network path around the gateway.

How do you produce a tamper-evident audit trail for autonomous AI agent actions?

Produce a tamper-evident audit trail by cryptographically linking the agent's exact proposed action, the evidence evaluated, the approving principal, the execution attempt, and the target's signed receipt. Standard infrastructure logs such as CloudTrail record which service account called an API, whereas an execution-control plane preserves why the action was authorized and what the target confirmed.

  • KedgeFlow binds the frozen proposal, evidence witness references, policy version, and approver identity (human WebAuthn assertion or automated service) into the admission and grant records.
  • The gateway correlates each claimed grant with a stable attempt identifier and records the signed outcome receipt returned by the target adapter in the outcome service.
  • When a target cannot confirm execution, the audit trail preserves an explicit unknown status alongside subsequent read-only reconciliation receipts to prevent silent gaps in compliance evidence.

How do you restrict delegated permissions when one AI agent hands off a task to another?

Restrict permissions during agent-to-agent handoffs by issuing a new delegated grant bound to the receiving agent's identity and strictly bounded by the parent task's scope and expiration. The receiving agent never inherits a standing token or broader role; the authority service verifies parent limits and revocation state before issuing any child permission.

  • KedgeFlow models task handoffs with typed execution-root references (mapped to transport protocols such as A2A) that carry the parent authorization root and generation number.
  • Before issuing a delegated grant, the authority service verifies that the child action, target resources, exposure budget, and validity window remain a subset of the active parent root.
  • Revoking or advancing the parent root generation invalidates downstream child issuance in the authority ledger, stopping stale or runaway subagent chains from acquiring new grants.

How do you enforce the same AI agent approval rules across multiple frameworks and model providers?

Enforce consistent approval rules across diverse agent frameworks and model providers by moving policy evaluation and grant enforcement out of individual agent SDKs into one shared authorization gateway. Each runtime attaches a lightweight adapter that submits standardized action proposals, allowing teams to swap models or frameworks without rewriting production safety controls.

  • KedgeFlow defines framework-agnostic Agent Adapter contracts for stacks such as LangGraph, CrewAI, MCP, OpenAI Agents SDK, Claude Agent SDK, and Google ADK, normalizing proposals into KF-JSON-0.2.
  • All adapters submit to the same independently administered admission service, policy engine (OPA or Cedar), and kf-proxy gateway, enforcing identical rules regardless of which model produced the proposal.
  • Teams using KedgeSpec can declare MAY, MUST, SHOULD, and AFTER ... MUST policies once in versioned source files and compile them consistently across harnesses, policy engines, and monitoring planes.
Baseline: KedgeFlow's open protocol and reference gateway. Production enforcement depends on target integrations and routing every path that can make a protected change through the enforcement boundary. KedgeFlow implementation status

Inspect the reference implementation and comparisons

Review KedgeFlow's Rust reference gateway, KedgeSpec policy compiler, or vendor-specific comparison matrices.