← Back to articles
TechnologyAlpha · core distribution, no deployed services

GuardMCP: Policy Control for Agent Tool Calls

GuardMCP is a Python library and control layer that evaluates policy, risk, budget and delegation before an agent calls a protected Model Context Protocol tool, and inspects the result afterwards. This article explains the interception model, the decision pipeline and its security boundaries, and states plainly which services are implemented and which are not.

The Model Context Protocol gave agents a standard way to call external tools, and in doing so inherited every question that attaches to letting a language model cause effects in the real world. If a model can read a file, send a message or invoke a payment endpoint, then somewhere there must be a decision about whether this particular call, by this particular caller, with these particular arguments, is permitted. GuardMCP is an attempt to make that decision an explicit, inspectable component rather than a property of the surrounding application code.

What the Model Context Protocol changed

The protocol standardises how a client discovers what tools a server offers, how it describes their parameters, and how it invokes them and receives structured results. That standardisation is genuinely useful, and it is also what makes a policy layer possible at all. If every tool call looked different, a cross-cutting control could not exist; because they share a protocol, a single component can sit between caller and tool and apply the same reasoning to all of them.

The security question this raises is not hypothetical. An agent that can call tools can be induced to call the wrong ones — by prompt injection in retrieved content, by a compromised or confused dependency, or simply by an error in a plan. The governing principle in GuardMCP is stated plainly: no protected tool execution happens without a guard decision.

The decision pipeline

A protected call passes through a staged evaluation. Request context is constructed from the call and its environment. Identity is propagated and delegation validated, so that a caller acting on behalf of another principal cannot exceed what it was granted. Policy evaluation applies the configured rules, risk evaluation scores the request, and adaptive budgeting checks it against the allowance in force. A decision engine then produces an execution decision, which is what permits or refuses the call.

The same asymmetry applies afterwards. Post-execution inspection examines what the tool actually returned, and structured errors, audit events and observability record the decision and its outcome. A guard that only looked at requests would miss an oversized response or a result carrying data the caller should not see, which is why result inspection is part of the design rather than an optional extra.

Security boundaries and how far they reach

It is worth being precise about what a guard layer is and is not. A guard decision is an application-level control: it runs in the same process as the caller, or alongside it, and it decides whether to proceed. It is not a sandbox. It cannot prevent a compromised agent process from calling a tool directly by another route, and it does not constrain what an already-approved process may do with the credentials it holds. Isolation has to come from somewhere else — operating-system boundaries, credential scoping, or not exposing the capability at all.

Within that boundary the design is coherent, and the dependency rule that keeps the domain free of framework dependencies is the right structural defence: it means the evaluation logic cannot quietly acquire a database handle or an HTTP client and become entangled with the systems it is supposed to be judging.

Maturity and limitations

The project is at version 0.1.0 and is organised around a documented phased plan rather than a finished release. The single most important fact about the current state is one of packaging and completeness. The root distribution packages only the core library, yet all eleven component packages carry their own manifests and their own source, so each concern is separately packageable rather than merely described. What is not present is the layer above them: the gateway and control-plane applications that the project documentation refers to are absent from the repository, and there is no persistence layer — no store, database or repository implementation appears anywhere in the packages. Someone evaluating it today is therefore evaluating a set of libraries, not a running control plane.

Conclusion

GuardMCP is a serious attempt at a problem that agent tooling currently handles by convention: deciding, in one inspectable place, whether a particular tool call should be allowed. Its evaluation pipeline and domain boundary are coherent, and its core package is installable today. It should be assessed as an alpha domain library with an application-level boundary — useful inside a system that already controls its isolation, not a substitute for one.

Also on this site