Guard Spec

Any web page, document, or tool result your LLM reads can carry hidden orders, so Guard Spec sits between your app and the model and blocks prompt injection before it arrives. Change one base URL and the gateway accepts OpenAI-style chat completions, the Responses API, embeddings, and Anthropic's Messages API for Claude Code, then routes clean traffic to OpenAI, Azure OpenAI, Anthropic, Gemini, vLLM, or Ollama. Each request is sanitized, scored by pattern rules, an in-process classifier, and similarity to known attack examples, and judged against your policies; an injection gets an HTTP 400 and the model is never called. Tool results, retrieved documents, and MCP tool descriptions are scored one by one, so hidden instructions and poisoned tool definitions are caught. An output guard checks answers, including streamed ones, for exfiltration links, personal data, and a leaked canary. Policies per organization and project are written as text or in a visual editor, tested in a simulator, and edited as YAML with a diff. Rules see through Vietnamese diacritics, teencode, leetspeak, and homoglyphs, because detection was built for English and Vietnamese. Alerts reach Slack, Microsoft Teams, Telegram, email, PagerDuty, Opsgenie, or signed SIEM webhooks, and single sign-on works with OpenID Connect or SAML 2.0 plus SCIM provisioning and TOTP two-factor. Running on a dedicated VPS on RepoCloud with guaranteed CPU, RAM, and SSD, full root SSH access, and a browser serial console. Apache-2.0 licensed.

Guard Spec
Guard Spec
Guard Spec
Guard Spec
Guard Spec
Guard Spec
Guard Spec

Benefits

  • Block injection before the model
  • Prompts, retrieved documents, tool results, and MCP tool descriptions are scored before the model sees them; an injection gets HTTP 400 and the upstream LLM is never called.
  • Prompts never leave your network
  • Everything runs next to your application: no prompt goes to a third-party moderation API, and every rule is readable and editable, unlike hosted detection services.
  • Change one base URL, nothing else
  • Point the OpenAI or Anthropic SDK's base URL at the gateway and keep your code; any language works because Guard Spec is a network service, not a library.
  • Built for English and Vietnamese
  • Rules, the classifier, and an evaluation set in the repository cover Vietnamese with and without diacritics, teencode, and leetspeak, plus English; other languages are not covered.

Features

  • Three detection layers
  • A sanitizer strips invisible characters, then L1 rules, an ONNX classifier trained by the project, and L3 embedding similarity to attack exemplars fuse into one score.
  • Output guard
  • Answers are checked, also while streaming, for exfiltration links and images, personal data including Vietnamese phone, ID, and card numbers, and a leaked canary token.
  • OpenAI and Anthropic compatible
  • Accepts OpenAI chat completions, Responses API, and embeddings plus Anthropic Messages for Claude Code, and routes to OpenAI, Azure OpenAI, Anthropic, Gemini, vLLM, or Ollama upstreams.
  • Policy flow editor
  • A React Flow diagram shows each step a request takes; rules compile to CEL, edit visually or as text, and a simulator replays a request through every rule.
  • Alerts and SIEM export
  • Blocked and flagged requests alert Telegram, Slack, Microsoft Teams, email, PagerDuty, Opsgenie, signed webhooks, or A2A agents, and export as OCSF records to Splunk, Elasticsearch, or Sentinel.
  • Multi-tenant sign-in and audit
  • Organizations, projects, roles, and rate-limited API keys sit on Postgres row-level security, with OIDC and SAML single sign-on, SCIM, TOTP two-factor, and an activity log.

Apps Similar to Guard Spec