Policy-first
Readable allow/deny rules in YAML/JSON with clear actions and severities, and low overhead.
- Ship strict defaults; override per route, team, or tenant.
- Deterministic behavior with zero hidden heuristics.
// OPEN SOURCE • Apache-2.0 #
Deterministic, policy-based protection for AI input/output. Detect & block prompt injection, secret leakage, malicious URLs, and toxic content—before they hit your systems. Zero telemetry. Apache-2.0.
A zero-trust filter that detects & blocks harmful or non-compliant text before it reaches your models, queues, or logs. Built for predictable, fast, auditable outcomes.
Readable allow/deny rules in YAML/JSON with clear actions and severities, and low overhead.
Runs as an in-process library, CLI, or sidecar with low overhead.
Every outcome includes a reason code and rule ID for full traceability.
Unicode-safe text handling with robust pattern packs for common abuse.
Select the outcome that matches your risk posture.
Use as HTTP middleware, message-queue filter, or LLM gateway guardrail.
Apache-2.0 licensed. Local-first. Zero telemetry by default.
Choose one method. See the repository README for platform specifics.
docker run --rm -p 8787:8787 ghcr.io/tokra-ai/tokra-shield:latest serve --host 0.0.0.0 --port 8787
curl -L https://github.com/tokra-ai/tokra-shield/releases/latest/download/tshield_linux_amd64 -o /usr/local/bin/tshield
chmod +x /usr/local/bin/tshield
tshield --help
# Port
# Service listens on 8787 by default.
# Health
# GET /healthz -> 200 OK
# GET /version -> {"version":"..."}
# Run as sidecar
# Mount policy.yaml and set TSHIELD_POLICY=/policy.yaml
# Example:
# -v /etc/tokra/policy.yaml:/policy.yaml -e TSHIELD_POLICY=/policy.yaml
HTTP service for pre-filtering text before it reaches models or downstream systems.
curl -sS http://localhost:8787/analyze \
-H "Content-Type: application/json" \
-d '{"text":"Hello world"}'
{
"risk": "ok",
"categories": [],
"reasons": [],
"version": "v1"
}
Help us shape the future of Tokra Shield. Sign up to stay connected with our engineering updates and opportunities to contribute.
By joining, you agree to our privacy policy and terms.