Skip to content

Pipeline Degradation

Paper Theorem 9.4 · Lean module MoF_15_NonlinearAgents

Agent pipelines with tool calls are compositions of Lipschitz maps. The effective Lipschitz constant is the product, so deeper pipelines are harder to defend, not easier.

Statement

::: theorem Pipeline Lipschitz degradation. If T1,,Tn are Lipschitz with constants K1,,Kn, then the composed pipeline TnT1 is Lipschitz with constant iKi. For n identical stages with constant K2, the effective constant is Knexponential in depth. :::

::: theorem Pipeline impossibility. If the composed pipeline P=TnT1D is continuous and P(x)=x for all xSτ, then P has boundary fixed points. If D is KD-Lipschitz and each Ti is K-Lipschitz, the ε-robust band scales as LKDKnδ. :::

The pipeline picture

Every box in the chain composes its Lipschitz constant with the previous. What started as a small constant on a single-stage defense becomes a product across the entire chain.

Why the band explodes

For a single-stage defense with Lipschitz constants (L,K) the T2 bound is

f(D(x))τLKd(x,z).

For the full pipeline P=TnT1D,

f(P(x))τLKDKnd(x,z).

The ε-robust band width around z grows as ε/(LKDKn) in the reverse direction — with each added tool call, the neighborhood the pipeline cannot remediate gets exponentially wider.

An explicit three-stage example

For three stages with Lipschitz constants K1,K2,K3:

Lip(T3T2T1D)K3K2K1KD.

If KD=K1=K2=K3=2, a single-stage defense with band of width 1 becomes a three-stage pipeline with band of width 8. Ten stages at K=2 give width ≈ 1024.

Why naive "defense in depth" is a misnomer

In classical security, stacking independent defenses generally helps (probability of all defenses failing is the product of individual failure probabilities). In the Lipschitz wrapper setting, stacking defenses is precisely what produces the Kn blow-up, because the effective Lipschitz constant is multiplicative, not additive.

::: remark This does not contradict defense-in-depth as a general engineering principle — it constrains a specific (and common) way of building it: chaining continuous wrappers before the model. Discontinuous filters, output-side monitoring, or human-in-the-loop review are not Lipschitz compositions and are not covered. :::

In Lean

lean
-- Composition of Lipschitz maps
theorem lipschitz_comp
    (hf : LipschitzWith Kf f) (hg : LipschitzWith Kg g) :
    LipschitzWith (Kf * Kg) (f ∘ g)

-- Two- and three-stage explicit bounds
theorem two_stage_lipschitz : …
theorem three_stage_lipschitz : …

-- Boundary fixation for pipelines
theorem pipeline_impossibility
    (hPipe : Continuous (T ∘ D))
    (hPipe_safe : ∀ x, f x < τ → (T ∘ D) x = x)
    (h_safe_ne : ∃ x, f x < τ)
    (h_unsafe_ne : ∃ x, τ < f x) :
    ∃ z, f z = τ ∧ (T ∘ D) z = z

-- ε-robust band grows with depth
theorem band_grows_with_depth : …
theorem tool_call_amplifies : …

The three-stage pipeline is a direct LipschitzWith.comp composition in Mathlib; the amplification theorem is then the ordinary T2 bound applied to P.

Next

The Defense Trilemma · mechanically verified in Lean 4 (46 files, ≈360 theorems, 0 sorry).