← Reddit

Building an observable MCP proxy with HITL and policy enforcement

Reddit · kr-jmlab · June 8, 2026
A policy-aware MCP proxy layer has been developed to enforce trusted execution for AI agents by inspecting tool calls, validating execution, applying security policies, supporting human-in-the-loop approval, and blocking unsafe actions before they run. Built with Spring AI and designed as a local-first, self-hosted solution, the system traces agent workflows and creates a safer execution boundary for MCP-based agents.

Detailed Analysis

A developer initiative within the Spring AI community is building a policy-aware proxy layer for Model Context Protocol (MCP)-based agents, addressing one of the most pressing concerns in agentic AI deployment: safe and observable tool execution. Rather than expanding the surface area of what AI agents can do, the project inverts the priority — focusing on controlling, auditing, and validating what agents actually execute. The proxy sits between the agent and its tools, intercepting tool calls before they run and applying configurable policies that can block unsafe actions outright or route them for human review.

The project centers on Human-in-the-Loop (HITL) approval as a first-class feature, which is a meaningful architectural decision. Most agentic frameworks treat human intervention as an edge case or fallback, but embedding HITL natively into an execution proxy means it can be applied systematically — for specific tool categories, risk thresholds, or organizational policies — rather than being bolted on after the fact. Combined with full workflow tracing, this gives operators genuine visibility into what an agent did, when, and under what authorization, which is critical for debugging, auditing, and regulatory compliance in enterprise environments.

The choice to build on Spring AI and position the project as local-first and self-hosted speaks directly to enterprise adoption barriers. Many organizations operating in regulated industries or with strict data governance requirements cannot route agent activity through cloud-hosted intermediaries. A self-hosted proxy that enforces policies locally allows these organizations to integrate MCP-based agents without surrendering control of execution telemetry or exposing tool call payloads to external services. The Spring ecosystem's maturity in enterprise Java environments makes it a pragmatic foundation for this kind of infrastructure.

This project reflects a broader maturation in the AI agent tooling space. Early MCP development, following Anthropic's release of the protocol in late 2024, focused heavily on tool connectivity — building servers that exposed capabilities to agents. The community is now grappling with second-order problems: what happens when agents have access to dozens of tools, how organizations enforce acceptable use, and how failures are diagnosed. The emergence of proxy and middleware layers designed specifically for policy enforcement and observability mirrors a pattern seen in API gateway development, where raw connectivity was followed by a wave of security, throttling, and monitoring infrastructure.

The project also implicitly engages with the ongoing debate about autonomous agent safety. Blocking unsafe actions before execution, rather than relying on the language model itself to refuse harmful tool calls, reflects a defense-in-depth philosophy that treats the model's judgment as one layer among several rather than the sole safeguard. This architectural skepticism — that model-level safety is necessary but insufficient — is increasingly shared among practitioners building production agentic systems, and purpose-built execution boundaries like this MCP proxy represent a concrete engineering response to that concern.

Read original article →