About

ProjectOpen source · Java gateway

ToolContractGate

By Sachin Gupta
Portrait of Sachin Gupta rendered in binary
ToolContractGate — architecture diagram

A runtime gate that evaluates every agent tool call against a versioned contract derived from an approved OpenAPI artifact, blocking or escalating calls when the live tool surface drifts.

ToolContractGate is a runtime trusted-contract gate for enterprise agent tools. Each tool call is evaluated against a versioned ToolContract hash-pinned to an approved OpenAPI artifact. The gate blocks or flags calls when the live tool surface drifts from the approved contract.

Every decision is deterministic, rule-based logic. There are no LLM calls in the gate path and no cloud dependencies, so the gate itself is fast, auditable, and can be reasoned about like any other piece of security infrastructure.

How it fits together

  • gateway: a Spring Boot 3 / Java 21 service that loads YAML contracts at startup, parses signed JWTs, and runs the validation pipeline on each call.
  • agent-runner: a Java CLI that mints a JWT, posts to the gateway, and prints the response; it also drives the experiment harness.
  • deploy: Kubernetes manifests and a kind cluster config for running the whole thing locally.

Where it sits

This is the runtime complement to build-time agent testing. Build-time checks catch what you anticipated; a runtime contract gate catches drift you did not, by refusing calls that no longer match the approved surface, the same way SAST and a WAF layer in traditional application security.

Related