π‘οΈ AnveGuard
May 27, 2026 Β· View on GitHub
π‘οΈ AnveGuard
The open-source LLM firewall. A drop-in OpenAI-compatible proxy that inspects, governs, and audits every call to OpenAI, Anthropic, Google, Perplexity, and any custom provider β without changing your application code.
π Live demo Β· π Docs Β· π Security policy Β· π€ Contributing
Why AnveGuard
Most teams ship LLM features with no record of what was sent, what came back, or who could change the rules. AnveGuard slots in front of any LLM in 60 seconds and gives you the operational layer that's missing.
π Full audit logEvery prompt, response, token count, latency, model, status code, and admin action β searchable and exportable. |
π§± Layered policy engineNormalizer β patterns β heuristics β intent classifier. Block, flag, or sanitize before bytes leave your network. |
π§ Injection & jailbreak detectionBattle-tested detectors for prompt injection, role-hijack, exfiltration, and risk-trio combos. |
π Multi-provider routingFallback chains across OpenAI, Anthropic, Google, Perplexity, and custom OpenAI-compatible endpoints. |
π·οΈ Per-key model aliasesMapfast, cheap, smart to whichever upstream model you want β swap providers without redeploying.
|
π Token-spike alertsCalibratable severity scoring catches runaway costs and abusive keys before they hit the bill. |
π Zero plaintext secretsAnveGuard keys SHA-256 hashed, upstream provider keys AES-GCM encrypted at rest. |
β‘ <5 ms overheadStreaming responses are relayed without buffering. Your users won't notice the proxy is there. |
π§° Drop-inChange one base URL. No SDK upgrades, no wrappers, no application changes. |
Inspect Β· Enforce Β· Audit β the three pillars, in one console.
What's detected
AnveGuard ships 38 named injection patterns, 16 statistical detectors, and 9 channel-aware XPIA / indirect-injection rules out of the box β 63 distinct detection rules. Every one has unit tests in policy_engine_attacks.test.ts (130+ passing).
| Family | Coverage |
|---|---|
| Direct prompt injection | ignore_prior_instructions, new_instructions_override, instructions_above_are_fake, role_reset, repeat_text_above, verbatim_initial_prompt, begin_with_system_prompt |
| Persona jailbreaks | DAN, AIM, BetterDAN, STAN, DUDE, Mongo Tom, Evil Confidant, Machiavelli, UCAR, EvilBOT, ChadGPT, Sydney 2.0, DAN 10+, plus generic act_as_unrestricted / pretend_no_restrictions / you_are_now_persona / two_responses_jailbreak |
| Narrative misdirection | Fictional / hypothetical / academic framing combined with harmful subjects, grandma trope, deceased-relative variants. Active and passive voice ("explains how X is synthesized") |
| Refusal suppression | refusal_suppression, answer_regardless, no_warnings_disclaimers, force_compliance_prefix ("start your response with 'Sure'") |
| Authority impersonation | False "I'm from OpenAI/Anthropic's safety team", policy_was_updated ("the new policy now allows X") |
| Skeleton Key (Microsoft 2024) | skeleton_key_update + skeleton_key_prefix_warning composite |
| Many-shot jailbreak (Anthropic 2024) | Detects role-marker alternations (Human:/Assistant: etc) embedded in single user messages β the MSJ signature |
| Unicode smuggling | Tag-character (CVE-2025-32711), zero-width, variation selectors, homoglyph (Cyrillic Π° / Greek ΞΏ masquerading as Latin) |
| Cipher attacks | ROT13/Caesar/Atbash mention + decode-and-execute, leetspeak density, Morse, Pig Latin |
| Adversarial suffix | GCG / AutoDAN-Turbo / BEAST trailing-garbage signatures (bracket clusters, mid-word case changes, gibberish tokens) |
| Chain-of-thought extraction | <thinking> / <scratchpad> reasoning leak probes (o1/Claude extended thinking) |
| Pseudo role tags | Fake [system], <|im_start|>, [INST] chat-template tokens injected into user content |
| System-role JSON | {"role":"system","content":"..."} pasted in user content |
| Encoded smuggling | Base64, hex, URL-encoded payload density (encoded_density); explicit decode-and-execute framing |
| Output guards | output_pii_leak (email, phone, SSN, credit-card, IP), output_repetition (Carlini divergence attack), system_prompt_leak (verbatim system-prompt slices), tool_injection (fabricated tool_calls JSON), credential_shape (sk-proj-, ag_live_, ghp_, AIza, stripe live/test, JWT, RSA private keys) |
| XPIA / indirect | New evaluateRetrieved() scanner β 9 channel-aware detectors for RAG chunks, MCP tool results, scraped HTML, email: instruction-override, imperative-to-model, markdown image exfil (EchoLeak), hidden HTML, HTML-comment injection, cross-tool reference (shadowing), SQL-write in NLβSQL context (Vanna.AI CVE-2024-5565), dangerous Python in code-gen retrieval (Langflow CVE-2025-3248), tag-char smuggling. Wired into the proxy's tool-result path. |
| Multi-turn behavioral | Gradual priming ("boil the frog"), trust-building, instruction-churn, persona-loading across turns |
| Risk-trio rule | Co-occurrence of (untrusted_input Γ outbound_channel Γ privileged_context) β the agentic exfiltration shape that matches the 2025 Supabase/Cursor/MCP-breach pattern |
| PII detection | Email, US phone, SSN, credit cards (with Luhn validation), IPv4/IPv6, OpenAI/Anthropic/AnveGuard keys, JWT β block/sanitize/flag configurable per workspace |
Plus a layered multilingual keyword engine (fuzzy match + edit distance + semantic match) and a configurable intent classifier (LLM-backed, with shadow mode for low-friction rollout).
Mapped to standards: OWASP LLM Top 10 (2025), OWASP Agentic Top 10, OWASP MCP Top 10. CVE coverage includes CVE-2025-32711 (EchoLeak), CVE-2024-5565 (Vanna.AI), CVE-2025-3248 (Langflow), CVE-2024-7042 (LangChain).
The pipeline β every request, every stage
Prompt injection isn't the real problem. The real problem is what the model can do after compromise.
One pipeline runs in front of every model and every tool call. Each stage is independently configurable β and independently auditable.
ββββββββββββββββββββββββββββββ
β User input β from your app or agent
βββββββββββββββ¬βββββββββββββββ
βΌ
ββββββββββββββββββββββββββββββ
β Prompt scanner β injection Β· PII Β· keyword Β· regex
βββββββββββββββ¬βββββββββββββββ
βΌ
ββββββββββββββββββββββββββββββ
β Policy engine β per-key rules Β· intents Β· severity
βββββββββββββββ¬βββββββββββββββ
βΌ
ββββββββββββββββββββββββββββββ
β Tool permission layer β shell Β· fs Β· net Β· sql Β· MCP
β β most teams skip this β
βββββββββββββββ¬βββββββββββββββ
βΌ
ββββββββββββββββββββββββββββββ
β LLM β OpenAI Β· Anthropic Β· Google Β· custom
βββββββββββββββ¬βββββββββββββββ
βΌ
ββββββββββββββββββββββββββββββ
β Output scanner β leak detection Β· response policy
βββββββββββββββ¬βββββββββββββββ
βΌ
ββββββββββββββββββββββββββββββ
β Audit + telemetry β immutable log Β· alerts Β· webhooks
ββββββββββββββββββββββββββββββ
Threat scenarios β real attack paths, real blast radius
Detectors don't sell. Incidents do. Here's how AnveGuard interrupts three attack chains your team is already exposed to β most of which never touch a "prompt injection" classifier.
1. Indirect prompt injection via GitHub issue
Blast radius: Repo secrets Β· CI tokens Β· production credentials
GitHub issue contains hidden instructions
β
Agent reads repository + .env secrets
β
MCP tool executes privileged action
β
Data exfiltrated to attacker domain
β
β
AnveGuard blocks tool call Β· policy violation
2. Customer-data exfiltration through a chat agent
Blast radius: PII Β· payment tokens Β· support transcripts
User pastes "summarize this and email it"
β
Agent queries internal CRM via tool
β
Model attempts outbound HTTP to unknown domain
β
β
AnveGuard denies β domain not on egress allowlist
3. Compromised model invokes destructive shell
Blast radius: Filesystem Β· DB rows Β· billing systems
Jailbreak bypasses model safety
β
Model calls shell.exec("rm -rf /data")
β
β
Tool permission layer rejects Β· shell capability not granted
β
β
Audit log captures attempt + actor + payload
Tool governance β policy-controlled tool execution
Filters and detectors stop a fraction of the attack surface. The durable control is governing what an agent is allowed to do β which shells, which paths, which domains, which rows. AnveGuard treats every tool call (function call, MCP capability, shell command) as a permissioned action with its own allowlist, audit row, and override workflow.
| Capability | What you can govern |
|---|---|
| Shell & code execution | Allowlist commands, deny by default, capture every invocation with arguments |
| Filesystem | Scope agents to specific paths, block writes outside a sandbox, deny secret reads |
| Outbound domains | Per-key egress allowlist β block exfiltration to unknown hosts before the request leaves |
| SQL & data access | Read-only roles, row-level scoping, refuse DDL and bulk SELECT from agent contexts |
| GitHub & MCP | Capability scoping for MCP servers β list which tools each key may invoke |
| Privileged actions | Require step-up approval for destructive ops: deletes, transfers, role grants |
This is where the market is moving. Prompt detection commoditizes; runtime telemetry, policy orchestration, and execution governance are the durable moat.
Architecture
ββββββββββββββ ag_live_* ββββββββββββββββ provider key ββββββββββββββ
β Your app β ββββββββββββΊ β AnveGuard β βββββββββββββββΊ β OpenAI β
β (any SDK) β β proxy β β Anthropic β
ββββββββββββββ ββββββββ¬ββββββββ β Gemini β
β β Perplexityβ
βΌ β Custom β
policy Β· routing Β· logs ββββββββββββββ
β
βΌ
βββββββββββββββββββββββ
β Postgres (RLS) β βββ React dashboard
β request_logs, etc. β (Clerk auth)
βββββββββββββββββββββββ
Five primitives. Once these click, the rest of the docs read fast.
| Edge function | Auth | Purpose |
|---|---|---|
proxy | Bearer ag_live_* | OpenAI-compatible public endpoint, runs policy layers, forwards upstream, logs every call |
dashboard | Clerk JWT | Action router for the React app: CRUD on keys, endpoints, policies, logs, routes |
alerts-fire | cron | Evaluates anomaly rules every minute and emits webhooks |
Shared modules live in supabase/functions/_shared: policy_engine.ts, anveguard.ts (key auth + AES-GCM + Clerk JWT verify), providers.ts, anthropic.ts, system_prompt.ts, compress.ts.
Quickstart β proxy your first request in 60 seconds
from openai import OpenAI
client = OpenAI(
api_key="ag_live_β¦", # your AnveGuard key
base_url="https://anveguard.app/v1", # the only line that changes
)
resp = client.chat.completions.create(
model="gpt-4o-mini",
messages=[{"role": "user", "content": "Hello"}],
)
Every request now appears in the dashboard with status, latency, tokens, payloads, and policy verdicts.
The in-app Quickstart β three minutes from
npm install to your first proxied request.
Screenshots
A short tour of the surfaces you actually live in:
Observe & audit every call
Configure the rules that fire
Predictable, OpenAI-shaped error responses
Providers, transport, and the rest
Endpoints & providers β OpenAI, Anthropic, Google, and any OpenAI-compatible upstream. |
Proxy API β a strict subset of the OpenAI REST API. No SDK changes. |
Discoverability β SEO & AI agents
AnveGuard is built to be found by both humans and machines.
Search engines (SEO)
- Per-page
<title>/ meta description / canonical / OpenGraph via the shared<Seo>helper - Structured data (JSON-LD) for
Organization,WebSite,FAQPageon the landing and/docs/faqroute, andTechArticleon every/docs/*page public/sitemap.xmlandpublic/robots.txtwith explicitAllowfor major crawlers
AI agents (AEO)
public/llms.txt+public/llms-full.txtβ concise and full-corpus summaries for LLM crawlers (Anthropic, OpenAI, Perplexity, Google-Extended)public/.well-known/llms.txt,public/ai.txt,public/ai-context.jsonβ discoverability metadatapublic/.well-known/ai-plugin.jsonβ OpenAI plugin manifestpublic/.well-known/agent-card.jsonβ A2A / agent-card descriptor
Stack
- Frontend: Vite Β· React 18 Β· TypeScript Β· Tailwind Β· shadcn/Radix Β· TanStack Query Β· react-hook-form + zod Β· React Router 6
- Auth: Clerk β with a custom themed appearance (
src/lib/clerk-appearance.ts) so SignIn/SignUp match the operator-console dark theme - Backend: Supabase β Postgres + Deno Edge Functions
- Tests: Vitest (unit) Β· Deno (edge functions) Β· Playwright (e2e)
Local development
Prerequisites
Setup
git clone https://github.com/ANVE-AI/prompt-sentinel-flow.git
cd prompt-sentinel-flow
npm ci
cp .env.example .env # fill in VITE_SUPABASE_URL, VITE_SUPABASE_PUBLISHABLE_KEY, VITE_SUPABASE_PROJECT_ID
npm run dev # http://localhost:8080
Edge-function secrets (SUPABASE_SERVICE_ROLE_KEY, KEY_ENCRYPTION_SECRET, CLERK_JWKS_URL, provider keys) belong in your Supabase project, not in .env.
Quality gates
npm run lint # ESLint
npm run typecheck # tsc --noEmit
npm test # Vitest unit tests
npm run build # Production build
npm run e2e # Playwright (needs e2e/.env.e2e β see e2e/README.md)
# Edge functions
cd supabase/functions
deno test --allow-env --allow-net --no-check
CI runs all of the above on every push and PR β see .github/workflows/ci.yml.
Database
29 forward-only migrations live in supabase/migrations.
supabase link --project-ref <your-project-ref>
supabase db push
Key tables: profiles, api_keys, endpoints, request_logs, policy_settings, policy_rules, policy_intents, routes, audit_logs, key_behavior_profiles. RLS is enabled on every table; the service role is the only accessor and all access goes through audited edge functions.
Deploying
supabase functions deploy proxy dashboard alerts-fire
supabase db push
The frontend is a plain Vite SPA β deploy the dist/ output to any static host (Vercel, Netlify, Cloudflare Pages, S3 + CloudFront, etc.).
Security model (one-page summary)
AnveGuard is multi-tenant. Isolation depends on three layers:
- Auth at the edge.
proxyvalidatesBearer ag_live_*againstapi_keys(SHA-256 hash compare).dashboardvalidates a Clerk JWT via JWKS. - Application-level row scoping. Every read in
dashboard/index.tsfilters by the authenticatedclerk_user_id; CI grep-checks guard against missing.eq("user_id", β¦)clauses. - RLS as defense in depth. Every table denies
anon/authenticated; only the service role can read or write.
Secrets: AnveGuard keys are SHA-256 hashed (never plaintext after creation). Upstream provider keys are AES-GCM encrypted with a key derived from KEY_ENCRYPTION_SECRET.
Found a vulnerability? See SECURITY.md β please don't open a public issue.
Roadmap
- Per-workspace key derivation for upstream credentials
- Metadata-only logging mode by default
- Self-hostable Docker distribution
- Spend caps & per-key budgets
- Streaming-aware output classification
- More built-in policy templates (PII, PCI, HIPAA, GDPR)
Track progress in GitHub Issues and grab anything tagged good-first-issue.
Contributing
PRs are very welcome β see CONTRIBUTING.md for the workflow, commit style, and pre-commit checklist. The active hardening roadmap is in the audit plan (issues C1-C5, H1-H11, M1-M11); pick an unclaimed item and reference its ID in your PR.
By participating you agree to be a decent human. Disagree with ideas, not people.
Documentation
The in-app docs β Overview, Concepts, Guides, and a full API reference.
In-app docs live at /docs/*:
| Introduction | Guides | Reference |
|---|---|---|
| Overview | API Keys | Proxy API |
| Quickstart | Endpoints | Logs |
| Concepts | Routes | Errors |
| Policies | FAQ |
For maintainers: SECURITY.md, CONTRIBUTING.md.
License
Apache 2.0 β Copyright 2026 ANVE AI and AnveGuard contributors.
If AnveGuard saves you from a leaky prompt, an exploded token bill, or a 3am incident β drop us a β on GitHub. It's the cheapest way to support the project.







