Package: llmshieldr 0.1.0

llmshieldr: Safety Guardrails for Large Language Model Workflows

A model-agnostic safety layer for developers building with large language model (LLM) applications. Maps starter controls to the Open Worldwide Application Security Project Top 10 for Large Language Model Applications 2025 risk categories <https://genai.owasp.org/llm-top-10/> via a modular rule engine. Supports regular-expression rules, lightweight natural language processing (NLP) intent checks, optional scanners, and semantic large language model reviewer checks on prompts, conversations, retrieved context, tool inputs and outputs, streaming chunks, and model outputs. Supports workflows with the 'Ollama' local web service <https://ollama.com/> via 'ellmer', remote reviewer endpoints, and other chat interfaces callable from 'R'. Intended as an experimental guardrail layer that teams should evaluate against their own workflows before relying on it in production.

Authors:Indraneel Chakraborty [aut, cre, cph]

llmshieldr_0.1.0.tar.gz
llmshieldr_0.1.0.zip(r-4.7-any)llmshieldr_0.1.0.zip(r-4.6-any)llmshieldr_0.1.0.zip(r-4.5-any)
llmshieldr_0.1.0.tgz(r-4.6-any)llmshieldr_0.1.0.tgz(r-4.5-any)
llmshieldr_0.1.0.tar.gz(r-4.7-any)llmshieldr_0.1.0.tar.gz(r-4.6-any)
llmshieldr_0.1.0.tgz(r-4.6-emscripten)
manual.pdf |manual.html✨
DESCRIPTION |NEWS
card.svg |card.png
llmshieldr/json (API)

# Install 'llmshieldr' in R:
install.packages('llmshieldr', repos = c('https://ineelhere.r-universe.dev', 'https://cloud.r-project.org'))

Bug tracker:https://github.com/ineelhere/llmshieldr/issues

Pkgdown/docs site:https://www.indraneelchakraborty.com

On CRAN:

Conda:

ai-safetyai-toolsellmergenerative-aiguardrailsllm-securityllmopsollamaoswappii-detectionpii-redactionprompt-injectionprompt-optimizationprompt-securityrag

5.60 score 2 stars 12 scripts 399 downloads 48 exports 5 dependencies

Last updated from:c1cf25f2bf. Checks:9 OK. Indexed: yes.

TargetResultTimeFilesSyslog
linux-develOK125
source / vignettesOK188
linux-releaseOK116
macos-releaseOK215
macos-oldrelOK134
windows-develOK81
windows-releaseOK94
windows-oldrelOK69
wasm-releaseOK94

Exports:add_ruleavailable_policiesbuild_policyevaluate_security_casesexample_promptsexplain_findingslist_rulesollama_reviewerpolicypolicy_controlspreflight_checkrate_guardredaction_strategyremote_reviewerremove_rulereviewer_promptrule_agency_languagerule_diagnosis_claimrule_financial_advicerule_injection_basicrule_injection_indirectrule_nlp_intentrule_phi_conditionrule_pii_emailrule_pii_phonerule_pii_ssnrule_secrets_api_keyrule_secrets_awsrule_secrets_bearerrule_secrets_passwordrule_system_prompt_leakscan_contextscan_conversationscan_outputscan_promptscan_streamscan_tool_callscan_tool_outputscanner_optionssecure_chatshield_ollamashieldr_auditshieldr_policyshieldr_reportshieldr_resultshieldr_ruletrust_boundarywrite_audit_log

Dependencies:clidigestjsonliterlangstringi

Architecture
Mental Model | Design Goals | Package Layers | Object Model | Scoring and Actions | Extension Points | Release Hygiene

Last update: 2026-05-28
Started: 2026-05-16

Custom Rules
Rule Fields | Numbers and Thresholds | Regex Rules | Function Rules | Industry Examples | Rule Inventory | Rule Test Checklist

Last update: 2026-05-17
Started: 2026-05-16

Ecosystem Context
How To Read This Comparison | Comparison Summary | R-Native Niche | Near-Term Lessons

Last update: 2026-05-17
Started: 2026-05-16

Evaluation and Evidence
Corpus | Run the Evaluation | Interpret Results | Opt-In Benchmark Script | Caveats

Last update: 2026-05-17
Started: 2026-05-16

Getting Started
Load a Policy | What a Policy Contains | Preflight a Prompt | Reading a Report | Run a Guarded Chat | Inspect Output | Scan Conversations, Tools, and Streams | Customize Scanners and Redaction | Write an Audit Log | Evaluate a Starter Corpus

Last update: 2026-05-17
Started: 2026-05-16

Ollama and Local Strategies
Local NLP Checks | Ollama Reviewer | Interpreting Reviewer Results | Full Ollama Chat | Existing Chat Objects | Any LLM Service | Plumber and Shiny Sketches

Last update: 2026-05-17
Started: 2026-05-16

Operations and Audit Logs
Before Deployment | Runtime Controls | Audit Log Sensitivity | Example JSONL Shape | Example CSV Shape | Storage Checklist | Operational Controls | Do Not Rely On llmshieldr Alone For

Last update: 2026-05-17
Started: 2026-05-16

OWASP Coverage
Scoring Model | Coverage Map | Reading This Matrix | Built-In Policies | Example Prompt Corpus | Policy Thresholds

Last update: 2026-05-17
Started: 2026-05-16

Policy Design
Design Goal | Source Model | Built-In Policy Construction | Check Modes | Semantic Reviewer Contract | Scoring | Action Resolution | Redaction | Optional Scanners | Policy Controls | Context Anomaly Scores | Risk Summary | Rate Guard Semantics | Extending a Policy

Last update: 2026-05-17
Started: 2026-05-16

RAG Pipeline
Build a RAG Policy | Scan Retrieved Rows | Context Rows Are Evidence | Orchestrate the Chat Call | Inspect the Audit | Minimal Vector-Store Shape

Last update: 2026-05-17
Started: 2026-05-16

Threat Model
Assets | Trust Boundaries | In Scope | Partially Covered | Out Of Scope | Expected Use | Non-Goals

Last update: 2026-05-17
Started: 2026-05-16

Readme and manuals

Help Manual

Help pageTopics
Add a rule to a policyadd_rule
List available built-in policiesavailable_policies
Build a guardrail policybuild_policy
Built-in rule helpersbuiltin_rules rule_agency_language rule_diagnosis_claim rule_financial_advice rule_injection_basic rule_injection_indirect rule_nlp_intent rule_phi_condition rule_pii_email rule_pii_phone rule_pii_ssn rule_secrets_api_key rule_secrets_aws rule_secrets_bearer rule_secrets_password rule_system_prompt_leak
Evaluate scanner behavior on a labeled corpusevaluate_security_cases
Example promptsexample_prompts
Explain findingsexplain_findings
List policy ruleslist_rules
Create a local Ollama reviewerollama_reviewer
Load a built-in policypolicy
Configure policy-level control actionspolicy_controls
Preflight-check a promptpreflight_check
Print a 'shieldr_policy'print.shieldr_policy
Print a 'shieldr_report'print.shieldr_report
Create or check a rate guardrate_guard
Configure redaction behaviorredaction_strategy
Create a remote semantic reviewerremote_reviewer
Remove a rule from a policyremove_rule
Return the default semantic reviewer promptreviewer_prompt
Scan retrieved context rowsscan_context
Scan a conversation while preserving message rolesscan_conversation
Scan model outputscan_output
Scan a promptscan_prompt
Scan streamed output chunks with rolling contextscan_stream
Scan a tool call before executionscan_tool_call
Scan tool output before it re-enters model contextscan_tool_output
Configure optional text scannersscanner_options
Run a guarded chat callsecure_chat
Guard an Ollama chat workflowshield_ollama
Construct a 'shieldr_audit'shieldr_audit
Construct a 'shieldr_policy'shieldr_policy
Construct a 'shieldr_report'shieldr_report
Construct a 'shieldr_result'shieldr_result
Construct a 'shieldr_rule'shieldr_rule
Wrap a chat object in a trust boundarytrust_boundary
Write an audit logwrite_audit_log