The Deterministic
Guardian Gate for AI Agents.
AgentPrahari wraps LLM workflows, autonomous tools, and LangChain/CrewAI pipelines with strict fail-closed boundary gates. Intercept prompt injections, destructive terminal operations, SQL payload injections, and runaway loops in-memory under 1 millisecond.
Pure in-memory parsing; 0 GPU weight calls.
49 adversarial zero-day attack categories.
Zero hallucination pass-through on anomaly.
All verification runs locally inside process memory.
Live Threat Interceptor & Custom Playground
Type any custom prompt, paste arbitrary commands, or choose a preset vector below. Watch AgentPrahari evaluate AST rules and return instant deterministic verdicts.
9-Layer Unskippable Defense Pipeline
Every inbound completion, autonomous tool invocation, and outgoing response traverses an immutable sequential guard before reaching your models or agent executors.
Payload Ingestion
Captures raw completions, streaming tokens, or autonomous tool dispatch specs (`tool_calls`, `func_name`, `args`).
Bounded Canonicalization
Normalizes URL encodings, Cyrillic/Greek homoglyphs, zero-width spaces, and nested Base64 strings before security checks evaluate.
Input Guards & PII Redactor
Real-time masking of SSNs, emails, credit cards, and addresses utilizing the DiffTracker span engine to preserve character alignment.
Prompt Injection & Overrides
Scans delimiter counterfeits, simulated developer modes, instruction precedence bypasses, and indirect Trojan injection triggers.
Schema & Privilege Gate
Strict pydantic / JSON-schema validation, Bait-and-Switch tool parameter interception, and Human-in-the-Loop (HITL) pause hooks.
Command & SQL AST Inspector
Tokenizes Bash and SQL commands to detect destructive `DROP`, `TRUNCATE`, inline comment evasions, and shell fork bombs.
PathGuard & LoopGuard
Traps `../../` directory escapes and tracks agent cyclic transitions to terminate infinite budget-draining runaway loops.
Runtime Gate Resolution
Computes unified disposition: ALLOW, SANITIZE, REQUIRE_HITL, or BLOCK.
SecretLeakGuard & Repair
Detects structural JWT tokens (`eyJ...`), API keys, and automatically repairs truncated JSON tool arguments in-flight.
442-Case Adversarial Benchmark Suite
Benchmarked against 49 zero-day attack vectors spanning prompt overrides, tool abuse, and destructive terminal injections on a single AMD EPYC 7763 CPU core.
| Attack Category | Test Corpus | Deterministic Block | Sanitized / Neutralized | p50 Latency | Status |
|---|---|---|---|---|---|
| block Direct Prompt Hierarchy Injections | 94 Cases | 91 (96.8%) | 3 (3.2%) | 0.142 ms | VERIFIED |
| terminal Destructive Shell & Fork Bombs | 78 Cases | 78 (100.0%) | 0 (0.0%) | 0.089 ms | VERIFIED |
| database Comment-Obfuscated SQL Attacks | 82 Cases | 80 (97.5%) | 2 (2.5%) | 0.115 ms | VERIFIED |
| folder_open Path Traversal & LFI / RFI Escapes | 64 Cases | 64 (100.0%) | 0 (0.0%) | 0.041 ms | VERIFIED |
| password Structured JWT & Cloud Key Exfiltration | 68 Cases | 68 (100.0%) | 0 (0.0%) | 0.076 ms | VERIFIED |
| repeat Agent Cyclic Loop & Runaway Costs | 56 Cases | 52 (92.8%) | 4 (7.2%) | 0.053 ms | VERIFIED |
Battle-Tested Presets For Every Workload
Zero configuration overhead. Choose from 5 fine-tuned production presets engineered for specific threat surfaces.
Full fail-closed lockdown: blocks shell execution, restricts SQL to SELECT, scrubs all PII, strict schema.
from_preset("strict")
Permits standard read/write database actions, checks for injection and secret leakage, relaxed tool sandbox.
from_preset("moderate")
Aggressive PII redaction and jailbreak shielding. Disables all raw OS and system execution capabilities completely.
from_preset("customer_support")
Allows compilation and git commands while intercepting `curl | sh`, recursive deletions, and path escapes.
from_preset("code_agent")
Mandatory Human-In-The-Loop approval hooks on outbound money movement, ledger calls, or schema drops.
from_preset("financial")
Wrap Any LLM SDK With A Single Line.
AgentPrahari intercepts LLM instances non-invasively via functional proxy wrapping. Works out-of-the-box with OpenAI, Anthropic, LangChain, LiteLLM, and CrewAI pipelines.
# 1. Import AgentPrahari and your client
from openai import OpenAI
from agentprahari import AgentPrahari
# 2. Instantiate Guardian shield with default deterministic policy
shield = AgentPrahari.from_preset("strict")
# 3. Wrap your existing LLM client in 1 line
client = shield.wrap(OpenAI()) # Reads OPENAI_API_KEY from environment
# 4. Execute requests as usual; Prahari intercepts automatically!
try:
response = client.chat.completions.create(
model="gpt-4o",
messages=[{"role": "user", "content": user_untrusted_input}]
)
except shield.SecurityPolicyViolation as err:
# Clean, fail-closed handling under 0.25ms
print(f"Intercepted threat: {err.rule_id} | Reason: {err.message}")