Nenya is a lightweight, high-security AI API gateway/proxy written in Go, serving as transparent middleware between local AI coding clients (OpenCode/Pi/Cursor) and upstream LLM providers (Gemini, DeepSeek, Zhipu z.ai, etc.).
Purpose and positioning: AI coding clients send source code, prompts, and credentials to cloud LLMs with every request, and Nenya acts as a gatekeeper in between: it redacts secrets before data leaves the local machine, reduces context payload, and routes across providers, supporting fallback, caching, and transparent SSE streaming, plus an optional anti-poisoning protection stack for detecting prompt injection and controlling outbound traffic.
Main capabilities: privacy-first by default, a Tier-0 regex filter redacts AWS keys, GitHub tokens, passwords, etc. before the payload leaves the local machine; optional entropy filtering, TF-IDF pruning, and engine summarization. For routing, it provides a configuration-driven provider registry, 23 built-in provider adapters, dynamic model discovery, multi-provider model resolution, a proxy fallback chain (with circuit breaker and automatic failover), and latency-aware routing. Security hardening includes mlock-sealed keys, seccomp, no-new-privileges, non-root operation, read-only filesystem, and systemd socket activation. The anti-poisoning stack is optional, including deterministic prompt injection detection, untrusted content marking, output outbound control (ExfilGuard and canary tripwires), and MCP tool call argument guards. It also supports MCP tool integration, RBAC, rate limiting, response caching, hot reload, and more.
Usage: it can run as a single static binary with zero runtime dependencies; native packages are provided for various Linux distributions, installing to /usr/bin/nenya and including systemd service and socket units, to be enabled and started after installation; it also supports Podman/Docker containers, Kubernetes (Helm), and bare metal (systemd) deployment. All /v1/* endpoints require client bearer authentication, while /healthz does not. /v1/* endpoints require Authorization: Bearer <client_token> or Bearer <api_key_token>.
Limitations and notes: the injection detection and outbound control layers in the anti-poisoning stack are optional and fail-closed; security interceptors fail closed by design (503), while when bouncer.fail_open=true, engine and token-saving pipeline failures will not block requests. Most specific configuration items, pricing, and effectiveness data are not provided and require consulting the official documentation.