Malicious text in documents or user inputs can hijack your AI's behavior. LightShield blocks it before it reaches your model — no extra API calls, no infrastructure changes.
Every time your app makes a call, LightShield wraps each piece of content in a randomly generated secret tag, like a one time password that only exists for that request. Attackers can't forge what they can't see.
Drop LightShield into any existing pipeline. Works with OpenAI, Anthropic, local models — anything that takes a string prompt.
from lightshieldai import Shield
# Initialize once per session
shield = Shield()
# Call your LLM with injection protection
response = shield.chat(
model=MODEL_NAME,
messages=[
{'role': 'system', 'content': SYSTEM_PROMPT},
{'role': 'user', 'content': user_query},
]
)
Click Inject Poison to simulate an attack and watch how LightShield neutralizes it.
messages, sanitizer = rag_shield.prepare(system=SYSTEM_PROMPT, context=[chunks], query=user_query)
response = any_llm_client.chat(messages=messages)
clean = sanitizer(response.text)
| Solution | Injection Block Rate | GPU Required |
|---|---|---|
| LightShield | ~95% | No |
| Llama Guard | ~87% | Yes |
| No protection | 0% | No |
One pip install. No infrastructure changes required.