Skip to Content
Getting StartedWhat is Ithil?

What is Ithil?

Ithil is a gateway that sits between your AI agent and your existing ASP.NET API. It speaks MCP (Model Context Protocol)  to the agent and forwards approved calls to your API, enforcing governance rules on every request.

The problem

AI agents calling enterprise APIs without guardrails cause runaway costs, data leaks, and no audit trail. You cannot simply give Claude or GPT-4 your API key and call it a day. You need:

  • A budget cap so one runaway agent cannot spend thousands of tokens overnight
  • A privacy filter so PII never flows back to the model
  • An audit trail so you know which agent called which tool with which arguments
  • Circuit breaking so a failing downstream service does not cascade into your AI layer

What Ithil does

Ithil wraps your existing ASP.NET controllers and exposes them as MCP tools — the standard protocol AI models use to call external services. You decorate your controller methods with [AgentTool], and Ithil takes care of the rest.

AI Agent → [MCP POST /mcp] → Ithil Gateway → [HTTP] → Your ASP.NET API Budget · Privacy · Cache · Circuit Breaker

Ithil is a reverse proxy with governance baked in. Your existing business logic stays exactly where it is.

What Ithil is NOT

  • Not an AI model. Ithil does not generate anything. It routes and enforces.
  • Not an API framework. Your API is unchanged. Ithil wraps it.
  • Not a replacement for your API. Human callers and other clients continue to call your API directly. Ithil is an additional surface for AI agents only.

Key concepts

Agent Identity

Each agent authenticates with a JWT before making tool calls. Ithil validates the token on every request and uses the agent identity to enforce per-agent budget limits, scope checks, and audit logging.

Tools

A tool is a controller method decorated with [AgentTool]. At compile time, the Ithil source generator reads every decorated method and emits a static SchemaRegistry that the gateway uses to discover available tools. No reflection at runtime.

See the [AgentTool] Reference for full attribute documentation.

Budget

Each agent has a daily token cap. The budget engine counts tokens in every tool response and returns 429 Too Many Requests when the cap is reached. Limits reset at midnight UTC. The default cap is configurable via Ithil:Budget:DefaultDailyTokenLimit.

Semantic Cache

Incoming tool call arguments are embedded using an ONNX model (all-MiniLM-L6-v2). The embedding is compared against cached embeddings in Redis. If the similarity score exceeds the configured threshold, the cached response is returned without hitting your API.

Privacy Filter

Before returning a tool response to the agent, Ithil scrubs patterns matching configured PII rules (SSN, credit card numbers, email addresses, and more). Scrubbed responses are recorded in the audit log in redacted form.

Circuit Breaker

If your downstream API starts failing, Ithil’s circuit breaker opens automatically after a configurable failure threshold. While the circuit is open, the gateway returns 503 immediately — no calls reach your failing service. After a cooldown period, a single probe request is allowed through to test recovery.

Who it’s for

Teams adding AI agents to existing .NET services who need governance from day one, not bolted on later. If you have an ASP.NET API and you are connecting it to Claude, GPT-4, or any other MCP-compatible agent, Ithil gives you a production-ready control plane without rewriting your API.

Next steps

Last updated on