/ docs · functional specification

The full platform
functional reference.

Every functional area of AI API Mapper documented at implementation depth so architects, security reviewers, and platform engineers can evaluate the product with real technical context.

Gateway · Security boundary

Gateway Security Boundary Support

Purpose

This functional area contributes edge-level security behavior to the platform. The Gateway acts as the first line of defense before requests reach backend services, applying authentication checks, token validation, header hardening, and traffic throttling at the ingress boundary.

Main Capabilities

  • transport security behavior
  • browser security support
  • request correlation
  • request logging
  • diagnostics endpoint protection
  • per-route authentication enforcement
  • JWT structural precheck
  • request and response header hardening
  • edge rate limiting per traffic category

Route-Level Authentication

Each named route can be configured with an authentication requirement. The Gateway enforces these requirements before proxying. The supported modes are:

  • Anonymous — the route is open to all callers without credentials (used for health and version endpoints)
  • Bearer token required — the request must carry a valid Authorization: Bearer ... header (used for admin routes)
  • Bearer token or API key required — the request must carry either a bearer token or an X-Api-Key header (used for runtime tool discovery and invocation)

Requests that do not satisfy the configured requirement are rejected at the Gateway with a 401 Unauthorized response, before the request reaches the backend.

JWT Structural Precheck

For routes that carry bearer tokens, the Gateway performs a lightweight validation pass before proxying, rejecting tokens that are malformed, unreadable, or clearly expired. This is not a substitute for full cryptographic signature verification, which is performed by backend services — it is an early filter that keeps obviously invalid traffic from reaching them. Tokens that fail this check are rejected at the Gateway with a 401 Unauthorized response.

This precheck is configurable: it can be turned off entirely, or tuned to require specific token claims to be present, depending on deployment needs.

Request Header Hardening

The Gateway strips categories of inbound request headers that could otherwise be used by a caller to spoof routing, connection, or proxy-authentication context before the request is forwarded to backend services. Response headers that would disclose internal technology details are also removed. This behavior keeps the Gateway acting as the platform's trusted boundary for what forwarding and connection metadata backend services see.

Edge Rate Limiting

The Gateway applies rate limits per traffic category (administrative traffic, tool discovery, tool invocation, and anonymous health/version checks), partitioned per caller where possible and by origin otherwise. Defaults are intentionally generous to avoid disrupting legitimate traffic while still guarding against abusive request patterns.

Requests that exceed the configured limit receive a 429 Too Many Requests response from the Gateway.

Functional Value

This area helps the ingress layer participate in platform hardening rather than acting as a passive router. By catching invalid tokens, suspicious headers, and abusive traffic at the edge, the Gateway reduces unnecessary load on backend services and provides a consistent enforcement point across all routes.