# GuardFlow — An Open-Source Python SDK for LLM Input Guardrails

**URL:** <https://discuss.huggingface.co/t/guardflow-an-open-source-python-sdk-for-llm-input-guardrails/192553>\
**Category:** Show and Tell\
**Created:** [November 25, 2026, 3:34pm UTC](https://discuss.huggingface.co/t/guardflow-an-open-source-python-sdk-for-llm-input-guardrails/192553 "2026-11-25T15:34:15Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![lrsowmya](https://avatars.discourse-cdn.com/v4/letter/l/a9adbd/32.png) [@lrsowmya](https://discuss.huggingface.co/u/lrsowmya)\
**Post date:** [November 25, 2026, 3:34pm UTC](https://discuss.huggingface.co/t/guardflow-an-open-source-python-sdk-for-llm-input-guardrails/192553/1 "2026-11-25T15:34:15Z")

</div>

Hi Hugging Face community! 👋

I’ve released **GuardFlow** , an open-source Python SDK for inspecting untrusted inputs before they reach LLM applications.

To make it easier to explore, I’ve now published **GuardFlow Agent Prompt Firewall** , an interactive Hugging Face Space.

**🔗 Try the live demo:**

> **[GuardFlow Agent Prompt Firewall - a Hugging Face Space by lrsowmya](https://huggingface.co/spaces/lrsowmya/guardflow-demo-app)**
>
> Inspect prompts before an agent can act

**🔗 GitHub:**

> **[GitHub - SowmyaLR/GuardFlow: GuardFlow is an open-source, local-first guardrail...](https://github.com/SowmyaLR/GuardFlow)**
>
> GuardFlow is an open-source, local-first guardrail SDK for LLM applications, providing PII protection, prompt-injection detection, and groundedness checks with minimal runtime overhead.

### Why GuardFlow?

Consider an AI assistant receiving a user prompt containing personal information, an exposed credential, or instructions intended to override its original behavior.

Instead of forwarding every input directly to a model, applications can introduce a configurable guardrail layer.

GuardFlow provides components for:

- PII detection and redaction using Presidio and Flair

- Prompt-injection detection

- Secrets detection

- Input sanitization

- Token-limit checks

The aim is to make these checks modular and reusable in Python-based AI applications.

### Open for Contributions

GuardFlow is still in its early stages, and I’d love to collaborate with developers working on Python, NLP, LLM security, and agent frameworks.

Potential contribution areas include:

- Improving detection coverage and reducing false positives

- Adding adversarial test cases and benchmarks

- Building integrations with agent frameworks

- Improving performance and developer experience

If you’re exploring input safety for AI agents, I’d be interested to hear which controls you consider most important.

---

<div class="post-metadata">

**Author:** ![John6666](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/john6666/32/27664_2.png) [@John6666](https://discuss.huggingface.co/u/John6666)\
**Post date:** [November 26, 2026, 9:44am UTC](https://discuss.huggingface.co/t/guardflow-an-open-source-python-sdk-for-llm-input-guardrails/192553/2 "2026-11-26T09:44:06Z")

</div>

For now, I tried running the publicly available SDK myself:

* * *

For agent input safety, I think the existing combination of sanitization, token limits, secrets, PII and injection detection is a useful starting point. I would build four properties around it, without making GuardFlow a large agent security framework:

- Acceptance of legitimate requests as well as detection of suspicious ones. Security-related questions, programming questions and multilingual requests can all be legitimate.
- Predictable behavior when guards are composed, including what happens to subsequent decisions when an earlier guard transforms the text.
- An explicit distinction between a successful inspection, a warning, incomplete inspection and an unavailable inspector.
- Independent authorization for agent operations. Text inspection should inform an application policy, but an ALLOW from a classifier should not itself grant a tool permission.

I ran selected tests and a few additional experiments with the existing SDK and engines:

| Check | Result in my test environment |
| --- | --- |
| Selected existing SDK tests | 26 passed |
| NotInject benign challenge set | 135/339 BLOCK (39.8%) at the default threshold of 0.85 |
| Normal repeated text | Inference completed at eight lengths, up to 1,536 classifier tokens |
| Original vs. transformed synthetic inputs | One of 12 examples changed from ALLOW to BLOCK in each of two configurations |
| PII dependency compatibility | The declared minimum Presidio version lacks an API used by the tested adapter |
| Warm PII-enabled evaluation with Python network operations denied | Two DNS-resolution attempts related to a public suffix list update, both denied |

NotInject is a difficult benign challenge set, not typical user traffic. The length and transformation tests are small diagnostics. The environment had dependency conflicts despite successful selected runs.

If I were extending the project, I would start with benign-input evaluation alongside the existing benchmark, a small set of composition regressions, and clearer inspection and dependency contracts. For agents, I would then demonstrate a thin integration that forwards approved text and keeps actual tool authorization in the host application. The following details explain the observations and some possible ways to build on them.

> **1. Test environment and reproducibility**
>
> ### What was tested
> 
> I checked out [GuardFlow 0.1.0 at commit a72020b](https://github.com/SowmyaLR/GuardFlow/tree/a72020b0c6f6c41bf139f5128f7f3e201cf20b3d) and verified the commit and the Git blob identities of four relevant files (flow, injection adapter, PII guard and package metadata). I staged the [ProtectAI checkpoint at revision 90c9989](https://huggingface.co/protectai/deberta-v3-base-prompt-injection-v2/tree/90c9989b1a342275dd0d1a95aad283c04e075671) and [NotInject at revision 9fdfe43](https://huggingface.co/datasets/leolee99/NotInject/tree/9fdfe4368fc43c592e601f8fc6217de7c777f9e7). The [Flair checkpoint](https://huggingface.co/flair/ner-english-large/tree/b56ed2e5a2919cac217acb3e56dd035bea47a37e) used for the PII branch was recorded separately.
> 
> | Item | Tested value |
> | --- | --- |
> | Runtime | Google Colab, Tesla T4, Python 3.13.16 |
> | PyTorch / Transformers | 2.14.1+cu130 / 4.57.6 |
> | Tokenizers / SentencePiece | 0.22.2 / 0.2.2 |
> | huggingface-hub | 0.36.2 |
> | Classifier device / dtype | cuda:0 / float32 |
> | detect-secrets | 1.5.0 |
> | Presidio Analyzer / Flair | 2.2.366 / 0.15.1 |
> | tldextract | 5.4.0 |
> 
> I used the SDK’s own `ProtectAIPromptInjectionEngine` and `PromptInjectionGuard` with the local checkpoint and default threshold/BLOCK policy. The classifier was already on the GPU; no device adaptation was required. PII ran in a separate environment.
> 
> The seven selected test files yielded 23 flow/sanitizer/token/secrets cases, two injection cases and one PII case. Some use test engines. Separate lightweight contract tests overlap this coverage, so I do not add their counts.
> 
> Both test environments inherited runtime packages. `pip check` reported a missing dependency of the inherited IPython and conflicts involving Gradio/Gradio-client, Diffusers and the Hub version. The selected computations succeeded; this is not a clean compatibility matrix or a recommended production lockfile.
> 
> ### Repeating the measurements
> 
> To repeat the evaluation, install the relevant extras and stage the fixed snapshots. The following is the essential guard call from the experiment, with `model_path` referring to the staged local checkpoint and `prompt` to the dataset row:
> 
> ```python
> from guardflow import PromptInjectionGuard
> from guardflow.engines.prompt_injection.protectai_engine import (
> ProtectAIPromptInjectionEngine,
> )
> 
> engine = ProtectAIPromptInjectionEngine(model_name=model_path)
> guard = PromptInjectionGuard(engine=engine, threshold=0.85)
> result = guard.evaluate(prompt)
> 
> ```
> 
> For NotInject, use the `prompt` and `category` columns of each of the three split files at the revision linked above, keeping split and row index as the evaluation identity. Record `result.score` and `result.action.value` on success; record exceptions separately. Measure token counts with the same engine’s tokenizer, including special tokens. The actual run recorded the resolved model/data files and hashes, environment and timings as well. There is no need to redistribute the original texts. The snippet illustrates the classification call, not a complete installation or evaluation script.
> 
> I did not run the full repository suite, existing attack benchmark, Space or a real tool-using agent. There is no new attack-recall estimate. Mock engines, a direct Transformers call with different preprocessing, and the real SDK chain answer different questions.

> **2. Evaluating benign inputs alongside detection**
>
> ### NotInject as a complement to the existing benchmark
> 
> [PIGuard (ACL 2025)](https://aclanthology.org/2025.acl-long.1468/) introduces NotInject, 339 legitimate inputs enriched with vocabulary associated with prompt injection, to study over-defense. This is relevant to technical and security-education assistants.
> 
> I evaluated all three splits of [NotInject](https://huggingface.co/datasets/leolee99/NotInject), 113 rows per split, using the default injection guard. These are my results, not the paper’s reported benchmark numbers:
> 
> | Dataset category | Scored | ALLOW | BLOCK | Benign BLOCK fraction |
> | --- | --- | --- | --- | --- |
> | Common Queries | 126 | 94 | 32 | 25.4% |
> | Multilingual | 84 | 40 | 44 | 52.4% |
> | Technique Queries | 87 | 37 | 50 | 57.5% |
> | Virtual Creation | 42 | 33 | 9 | 21.4% |
> | **Total** | **339** | **204** | **135** | **39.8%** |
> 
> All 339 unique rows were scored without recorded errors; token counts were 12-57. A separate twelve-example synthetic benign baseline produced four BLOCKs, but is too small and deliberately selected to represent real traffic.
> 
> The category totals are not estimates for individual languages or representative workloads. This is a false-positive measurement on one benign challenge set and binary policy, not a general FPR or a measure of attack recall.
> 
> I think this would complement the [existing GuardFlow benchmark](https://github.com/SowmyaLR/GuardFlow/blob/a72020b0c6f6c41bf139f5128f7f3e201cf20b3d/benchmarks/test_prompt_injection_benchmark.py) quite well. Rather than replacing that benchmark, I would keep the following populations separate:
> 
> | Population or metric | Question it answers |
> | --- | --- |
> | Ordinary legitimate requests representative of the intended application | Can users complete everyday tasks? |
> | Difficult benign inputs, such as NotInject | Is the detector overly sensitive to vocabulary or input style? |
> | Labeled malicious cases in an appropriate controlled evaluation | Is the intended behavior detected under the chosen policy? |
> | Errors, unsupported inputs and skipped cases | How much of the intended evaluation actually ran? |
> | Breakdowns by language, format, input source and length | Are aggregate numbers hiding an application-specific issue? |
> | Startup and warm latency | Is the selected engine practical for that deployment? |
> 
> A minimal report for the benign side could count successful classifications and unsuccessful inspections independently:
> 
> ```python
> # Illustrative aggregation after collecting guard results.
> scored = [r for r in records if r["status"] == "ok"]
> blocked = sum(r["action"] == "block" for r in scored)
> report = {
> "attempted": len(records),
> "scored": len(scored),
> "unscored": len(records) - len(scored),
> "benign_block_count": blocked,
> "benign_block_fraction": blocked / len(scored) if scored else None,
> }
> 
> ```
> 
> Report errors separately: zero successful classifications should yield no rate. Keep WARN, review, detection and actual application actions distinct where applicable.
> 
> ### Thresholds and the application policy
> 
> I kept the threshold at 0.85. Raising it to improve benign acceptance may reduce detection; choosing a policy needs both kinds of labeled examples, application-specific error costs and held-out evaluation. See [decision thresholds](https://scikit-learn.org/stable/modules/classification_threshold.html) and [calibration](https://scikit-learn.org/stable/modules/calibration.html). The score is not necessarily a calibrated incident probability.
> 
> Record model/policy revision, threshold, population, score, action and execution status. Chat may offer a retry or explanation; privacy and tool permissions still need independent application policies.
> 
> For CI, a handful of ordinary technical, creative, multilingual and security-education fixtures plus a separately runnable challenge-set evaluation would be inexpensive. Repeat them after adapter or preprocessing changes, not just model changes.
> 
> The replaceable engine interface could support comparisons with PIGuard or [Llama Prompt Guard 2](https://dev.meta.ai/llama/docs/model-cards-and-prompt-formats/prompt-guard). The [ProtectAI model card](https://huggingface.co/protectai/deberta-v3-base-prompt-injection-v2) describes an English classifier. I have not compared these models head-to-head. I would compare both detection and benign acceptance through the actual adapters, and check language support, licensing and compute requirements before selecting an engine.

> **3. Composition, transformation and redaction**
>
> ### A paired evaluation with the existing guard chain
> 
> The [flow implementation](https://github.com/SowmyaLR/GuardFlow/blob/a72020b0c6f6c41bf139f5128f7f3e201cf20b3d/guardflow/core/flow.py) passes transformed text downstream and stops on BLOCK. The [flow tests](https://github.com/SowmyaLR/GuardFlow/blob/a72020b0c6f6c41bf139f5128f7f3e201cf20b3d/tests/test_flow.py) already cover transformed output and early stopping independently of model quality.
> 
> I evaluated twelve legitimate synthetic inputs (ordinary text, fictional personal information, fake configuration and formatting differences) before and after the transformation stages, with the same real injection guard. No real credentials or personal data were used.
> 
> | Transformation configuration | Examples | Text changed | Classifier action changed |
> | --- | --- | --- | --- |
> | Sanitizer + secrets guard | 12 | 2 | 1 |
> | Sanitizer + secrets guard + PII guard | 12 | 5 | 1 |
> | Total paired evaluations | 24 | 7 | 2 |
> 
> All pairs completed. Both changes concerned the **same** legitimate configuration example: ALLOW before, BLOCK after secret redaction. This is not a PII-specific effect or evidence that redaction is generally harmful. A correct transformation can still change the classifier’s input and decision.
> 
> ### A useful small regression suite
> 
> For the chosen guard order, compare original and transformed synthetic inputs locally, record actions and transformations, and verify with a mock consumer that only approved text is forwarded. This is a test procedure, not a reason to transmit or retain raw data in production.
> 
> | Situation | Property to check |
> | --- | --- |
> | No transformation required | Text preserved and intended guards executed |
> | Transformation required | Correct version delivered to the next guard and approved consumer |
> | Decision changes after transformation | Application handles the actual policy decision; test records the difference |
> | Earlier BLOCK | Later guards are not assumed to have executed; rejected input is not forwarded |
> | Engine unavailable | Failed inspection is distinguishable from a successful ALLOW |
> | WARN | The documented application policy is applied |
> 
> Use mock engines for structural regressions and a fixed real checkpoint for classification changes. The privacy boundary determines which processor may see which version: a failed or rejected redaction must not cause prohibited original text to be forwarded instead.
> 
> ### Detection quality is not the same as masking quality
> 
> The [PII guard](https://github.com/SowmyaLR/GuardFlow/blob/a72020b0c6f6c41bf139f5128f7f3e201cf20b3d/guardflow/guards/pii.py) takes the engine’s detections and performs redaction according to its policy. Adding the real PII engine removed several intended fictional markers in my smoke tests, including contact and name information. That small fixture set is not a representative estimate of recognition or anonymization accuracy.
> 
> Test recognition (entity and span), transformation (expected output) and preservation of unrelated content separately. Adjacent and overlapping detections can be supplied by a fake engine to test masking deterministically. See [Presidio](https://github.com/data-privacy-stack/presidio) for related components, without assuming identical span contracts.
> 
> The sanitizer’s preservation of meaningful Unicode is worth retaining, especially for source code and formatted data. [Unicode Standard Annex #15](https://www.unicode.org/reports/tr15/) describes normalization semantics; it is not a security policy. Test ordinary multilingual text, line endings, emoji and formatting separately from detector quality.

> **4. Agent integration: inspection and authorization**
>
> ### Where a text guard fits
> 
> For agents I would separate text suitability from permission to perform an operation. The host application should enforce the latter independently of a favorable text inspection.
> 
> User messages, retrieved documents, tool results and generated text have different origins and authority. A common text inspector can help at several points, but preserve provenance and permissions outside it. An ordinary document may still be outside a user’s access scope.
> 
> A possible division of responsibilities (not a description of features already implemented in GuardFlow):
> 
> ```plaintext
> Receive user text and its application context
> Apply input/resource budget and configured text guards
> Check inspection status and data-handling policy
> Supply only approved context to the model
> 
> Model proposes a tool operation
> Validate operation and arguments
> Check actual actor, resource and permissions independently
> Obtain operation-specific approval when required
> Execute only the authorized operation
> 
> Receive result
> Apply appropriate data-handling and inspection policy
> Return or store only what is permitted for the destination
> 
> ```
> 
> Check authorization for every operation that requires it, not only after a classifier warning. A valid tool call and favorable classification do not grant permission. Any required approval must apply to the actual operation, arguments and destination; changes may require a new decision.
> 
> The [OWASP AI Agent Security Cheat Sheet](https://cheatsheetseries.owasp.org/cheatsheets/AI_Agent_Security_Cheat_Sheet.html) and [prompt injection prevention guide](https://cheatsheetseries.owasp.org/cheatsheets/LLM_Prompt_Injection_Prevention_Cheat_Sheet.html) provide useful background for this division. I would use them as integration references, not as a list of features that GuardFlow must implement in its own package.
> 
> | Application | Role for text inspection | Independent application responsibilities |
> | --- | --- | --- |
> | Plain chat | Inspect requests, resource limits, warnings | Session/rate policy, suitable response handling |
> | RAG / document assistant | Inspect selected user and retrieved text | Document access, source provenance, context limits |
> | Read-only tool agent | Inspect input and relevant results | Authorize reads, restrict returned information |
> | Agent with state-changing tools | Text-level signals and transformations | Authorize actual operation, validate parameters, apply approval rules |
> | Sensitive-data workflow | Detect/redact before a data boundary | Export, access, retention, logging and isolation policy |
> 
> ### A small adapter contract
> 
> A thin wrapper around `GuardFlow.inspect()` could specify its input scope, execution timing, action/failure policy and which text reaches the next component. Keep permissions and provenance in the application, and test with a fake model and executor.
> 
> A check running concurrently with a remote request is not equivalent to one that must complete before prohibited data leaves the process. Checking generated text is also not the same as authorizing a proposed action.
> 
> For CI, use two harmless mock operations with different permissions: a legitimate authorized task succeeds, a disallowed action has no effect, a rejected request never reaches the model, and a failed required inspection follows policy.
> 
> [AgentDojo](https://agentdojo.spylab.ai/) evaluates agents, tasks and tools. [CaMeL](https://arxiv.org/abs/2503.18813) explores control/data-flow separation and capabilities. I have not tested GuardFlow with either. They illustrate why legitimate task completion and unauthorized effects are distinct from classifier accuracy.

> **5. Token budgets and inspection coverage**
>
> Separate the downstream LLM budget, the inspector’s executable input length and evaluated inspection coverage. The [approximate counter](https://github.com/SowmyaLR/GuardFlow/blob/a72020b0c6f6c41bf139f5128f7f3e201cf20b3d/guardflow/engines/tokens/approximate.py) marks estimates as approximate and can be replaced. Even an exact LLM counter may not count classifier tokens correctly.
> 
> In the tested configuration, `max_position_embeddings` was 512, but `tokenizer.model_max_length` was a very large sentinel value (see the [Transformers tokenizer documentation](https://huggingface.co/docs/transformers/main_classes/tokenizer)). The [adapter](https://github.com/SowmyaLR/GuardFlow/blob/a72020b0c6f6c41bf139f5128f7f3e201cf20b3d/guardflow/engines/prompt_injection/protectai_engine.py) calls the classifier without explicit truncation. The model card’s example, in contrast, specifies truncation at 512. I measured the classifier’s actual input lengths, including special tokens:
> 
> | Classifier tokens | Inference completed | Default action |
> | --- | --- | --- |
> | 128 | Yes | ALLOW |
> | 385 | Yes | ALLOW |
> | 511 | Yes | BLOCK |
> | 512 | Yes | BLOCK |
> | 514 | Yes | BLOCK |
> | 768 | Yes | BLOCK |
> | 1,024 | Yes | BLOCK |
> | 1,536 | Yes | BLOCK |
> 
> This was one repeated normal library-description template, not eight independently sampled documents. The ordinary SDK preprocessing produced the indicated lengths. A separate model-card-style truncation control limited the longer inputs to 512 tokens. Thus 512 was not a hard execution limit in this environment, but executing at 1,536 tokens does not establish useful detection quality or a supported maximum. I would not infer a universal transition at 511 tokens either.
> 
> ### A possible length contract
> 
> For a short chat application, a resource budget and a detector evaluated within that scope may be sufficient. For a document application, it may help to distinguish the following cases:
> 
> - Within the application’s budget and the inspector’s supported scope: inspect normally and report the result.
> - Within the application budget but outside the inspector’s evaluated scope: report the limitation and use a documented policy for incomplete coverage. An application may decline the operation, use a suitable alternate engine or adopt an evaluated segmentation strategy.
> - Beyond the application’s resource budget: apply the budget policy independently of what a classifier would have predicted.
> 
> A truncated input and its complete original are not equivalent inspection scopes. Segmenting also changes the model’s context and the document-level false-positive behavior; a flag on any segment need not be an appropriate universal aggregation rule. I would evaluate the chosen aggregation against ordinary documents as well as the targeted malicious cases rather than assuming that segmentation improves all metrics.
> 
> Record counter identity, detector token count, coverage and truncation/unsupported status (unknown if not established). Several ordinary document templates and formatting types would make a useful next test.

> **6. Optional dependencies and compatibility**
>
> The tested [package metadata](https://github.com/SowmyaLR/GuardFlow/blob/a72020b0c6f6c41bf139f5128f7f3e201cf20b3d/pyproject.toml) permits `presidio-analyzer>=2.2.0`, but the [PII adapter](https://github.com/SowmyaLR/GuardFlow/blob/a72020b0c6f6c41bf139f5128f7f3e201cf20b3d/guardflow/engines/pii/presidio_engine.py) imports `NoOpNlpEngine` to use Flair for NER. I inspected three published wheels:
> 
> | Presidio Analyzer | NoOp module and export | Requires-Python in wheel |
> | --- | --- | --- |
> | 2.2.0 | Not present | Not declared |
> | 2.2.364 | Present | `>=3.10,<3.15` |
> | 2.2.366 | Present | `>=3.11,<3.15` |
> 
> The [2.2.364 release](https://github.com/data-privacy-stack/presidio/releases/tag/2.2.364) introduced that API; see also its [implementation](https://github.com/data-privacy-stack/presidio/blob/2.2.364/presidio-analyzer/presidio_analyzer/nlp_engine/no_op_nlp_engine.py). The table is static wheel inspection, not a successful import on every version. Actual PII initialization and evaluation succeeded with 2.2.366 and Flair 0.15.1 in my environment.
> 
> A resolver selecting a newer compatible version may work normally. The concern is the contract for an older version that is still permitted by the declared bound. Version 2.2.364 is a candidate minimum for the required API, but I would test import and initialization with compatible transitive dependencies before claiming support at that floor. The newer wheel’s different Python requirement also matters because the SDK declares Python 3.10 support. Simply making the newest observed version the minimum could unnecessarily narrow that range.
> 
> ### Small compatibility checks rather than one large installation
> 
> | Installation | Useful check |
> | --- | --- |
> | Base only | Import and run token, sanitizer and flow contracts with no model extras |
> | Secrets extra | Import and smoke-test the intended plugin configuration with synthetic data |
> | Injection extra | Test action semantics with a fake engine and optionally load a fixed checkpoint |
> | PII extra | Test the required API, recognizer initialization and a synthetic redaction |
> | Combined extras | Run a small chain and `pip check` in a clean environment |
> 
> At the supported Python boundaries, test a minimum-compatible set as well as an ordinary current-resolver installation. Run imports and deterministic contracts first; schedule real model tests separately. Preserve the small base install and explanatory errors for missing extras.

> **7. Local inference and offline deployment**
>
> For selected warm evaluations I denied Python `socket.connect`, `connect_ex`, `create_connection` and `getaddrinfo`. Assets were already staged; initialization and other network paths were outside the test.
> 
> | Warm evaluation | Intercepted network attempts |
> | --- | --- |
> | Benign classifier evaluation | 0 |
> | Paired classification | 0 |
> | Sanitizer + secrets | 0 |
> | Sanitizer + secrets + PII | 2 DNS calls |
> 
> The PII branch logged failed `tldextract` Public Suffix List (PSL) retrieval attempts. Both DNS calls were denied and the evaluations completed. This is consistent with auxiliary-data fallback, not evidence that prompts or PII were transmitted. Zero counts apply only to the intercepted operations in those runs.
> 
> With the installed `tldextract` 5.4.0, its [package documentation](https://pypi.org/project/tldextract/5.4.0/) and [changelog](https://github.com/john-kurkowski/tldextract/blob/master/CHANGELOG.md) describe a useful configuration option. The discussion in [issue #214](https://github.com/john-kurkowski/tldextract/issues/214) also gives context about automatic network updates. An option to investigate before importing the relevant components is:
> 
> ```bash
> export TLDEXTRACT_PUBLIC_SUFFIX_LIST_URLS=""
> 
> ```
> 
> This is a tldextract setting introduced in 5.4.0, not a GuardFlow option. If the integration owns the instance, `TLDExtract(suffix_list_urls=())` is another documented option. With fallback enabled, a bundled snapshot can be used instead of a remote update; deployments may instead provision reference data explicitly. I have not repeated the PII experiment with this configuration, so I would treat it as a candidate to verify, not a demonstrated fix to the whole deployment.
> 
> I would distinguish three useful deployment contracts:
> 
> | Deployment | Expected behavior |
> | --- | --- |
> | Local inference with downloads allowed | Model and auxiliary data can be provisioned; actual inference is local under the selected policy |
> | Offline after provisioning | Staged weights, tokenizer and auxiliary data suffice for initialization and processing without network access |
> | Strictly isolated runtime | Deployment enforces and verifies network restrictions at the process or OS boundary |
> 
> The last two can be tested with an isolated fresh cache, pre-provisioned assets, and denied network access during initialization and evaluation. Record missing assets separately from guard decisions; verify that the configured data snapshot is used and compare outputs under the intended settings. A populated cache alone cannot establish that a new deployment will work offline. A Python interception cannot provide an OS-level egress guarantee.
> 
> The default detect-secrets 1.5.0 settings did not include the verification-policy filter (see its [plugin implementation](https://github.com/Yelp/detect-secrets/blob/v1.5.0/detect_secrets/plugins/base.py)). External credential verification is inappropriate for a local-only synthetic test. I did not observe credential submission. Documenting setup/runtime requirements per engine would be useful.

> **8. Language coverage, diagnostics, performance and next steps**
>
> ### Language and data-handling contracts
> 
> The tested adapter uses an English Presidio registry and [Flair English NER](https://huggingface.co/flair/ner-english-large). Presidio’s [language documentation](https://github.com/data-privacy-stack/presidio/blob/main/docs/analyzer/languages.md) describes extension points, not automatically enabled capabilities. Document enabled languages and entities, and test region-specific patterns, NER, masking and text preservation separately. Benign mixed-language injection fixtures are also useful, but do not establish detection coverage.
> 
> ### Inspection status and safe diagnostics
> 
> [GuardResult](https://github.com/SowmyaLR/GuardFlow/blob/a72020b0c6f6c41bf139f5128f7f3e201cf20b3d/guardflow/core/result.py) already carries actions, scores, reasons, latency, text and metadata. I would distinguish completed, disabled, skipped after BLOCK, incomplete/unsupported scope and unavailable/error (proposed states, not existing enum values). In the tested flow, `allowed` depends on whether any guard returns BLOCK; a guard can return `passed=False` with a WARN or transformation and the flow can still be allowed. Exceptions propagate rather than returning an ALLOW. This distinction is worth preserving in integration examples: an allowed flow is not a claim that every guard passed or every possible check ran. A failed required inspection can deny or defer a high-consequence operation; any degraded mode should still expose the failure rather than treating it as ALLOW.
> 
> The tested PII and secrets metadata omit detected literals, but intermediate `output_text` and blocked input are not necessarily safe to log. Consider a diagnostic projection of stage, status, action, reason code, timing, revision, counts and change flags. Hashes of personal data are not automatically anonymous. See [OWASP Logging](https://cheatsheetseries.owasp.org/cheatsheets/Logging_Cheat_Sheet.html). I did not test production logging or establish any logging disclosure.
> 
> ### Performance and a gradual roadmap
> 
> For the 339 short NotInject rows, sequential warm wall time including token measurement had a median of 25.70 ms and estimated p95 of 39.30 ms on T4. Pipeline load was 2.01 s, first warm-up 498 ms and separate PII initialization/warm-up 18.65 s. This excludes asset downloads and is not a CPU, concurrent service, Space or combined-chain benchmark. Separate provisioning, initialization, warm and end-to-end latency. Parallel guards may change semantics if one transforms the next input. [detect-secrets 1.5.0 settings](https://github.com/Yelp/detect-secrets/blob/v1.5.0/detect_secrets/settings.py) use shared cached settings; concurrent configuration isolation is worth testing, not a confirmed issue.

Overall, I would keep the modular SDK and build on it with evidence about what each guard inspects, how guards compose and how applications consume their results. This allows different engines and use cases without making a text classifier responsible for all of agent security.

---

<div class="post-metadata">

**Author:** ![srinivaspadmanabhuni](https://avatars.discourse-cdn.com/v4/letter/s/8491ac/32.png) [@srinivaspadmanabhuni](https://discuss.huggingface.co/u/srinivaspadmanabhuni)\
**Post date:** [November 26, 2026, 10:28am UTC](https://discuss.huggingface.co/t/guardflow-an-open-source-python-sdk-for-llm-input-guardrails/192553/3 "2026-11-26T10:28:33Z")

</div>

Nice to see the firewall framed for agents. One test I would add beyond detection coverage: send the same injected text through a tool result, not only the user prompt, and assert the firewall sees it and that the follow-up tool call is not made. Injection through retrieved content or tool output is where input-only guards usually have a gap. A second case: a prompt that is clean on its own but split across two turns.

---

<div class="post-metadata">

**Author:** ![lrsowmya](https://avatars.discourse-cdn.com/v4/letter/l/a9adbd/32.png) [@lrsowmya](https://discuss.huggingface.co/u/lrsowmya)\
**Post date:** [November 26, 2026, 11:52am UTC](https://discuss.huggingface.co/t/guardflow-an-open-source-python-sdk-for-llm-input-guardrails/192553/4 "2026-11-26T11:52:57Z")

</div>

Thank you for such a thorough evaluation! Really appreciate the time you’ve spent testing GuardFlow and documenting your findings.

The observations around benign-input blocking, guard composition, and dependency compatibility are particularly valuable. I’ll look into reproducing these and improving the test coverage.

I also agree with keeping input inspection separate from agent authorization rather than expanding the SDK into a full agent security framework.

Would be great to have you contribute to these improvements if you’re interested. Happy to collaborate on GitHub!

---

<div class="post-metadata">

**Author:** ![lrsowmya](https://avatars.discourse-cdn.com/v4/letter/l/a9adbd/32.png) [@lrsowmya](https://discuss.huggingface.co/u/lrsowmya)\
**Post date:** [November 26, 2026, 2:22pm UTC](https://discuss.huggingface.co/t/guardflow-an-open-source-python-sdk-for-llm-input-guardrails/192553/5 "2026-11-26T14:22:01Z")

</div>

Great point! Tool responses and retrieved content are important injection entry points, especially for agents. I also like the multi-turn test idea. GuardFlow currently focuses on input inspection, so demonstrating these scenarios with a thin agent integration and separate tool authorization would be a useful next step. Thanks for suggesting this!

---

<div class="post-metadata">

**Author:** ![srinivaspadmanabhuni](https://avatars.discourse-cdn.com/v4/letter/s/8491ac/32.png) [@srinivaspadmanabhuni](https://discuss.huggingface.co/u/srinivaspadmanabhuni)\
**Post date:** [November 27, 2026, 4:48am UTC](https://discuss.huggingface.co/t/guardflow-an-open-source-python-sdk-for-llm-input-guardrails/192553/6 "2026-11-27T04:48:37Z")

</div>

Agreed that separate tool authorization is the right boundary. For the thin integration, one way to keep the demo honest: put the injected text only in a mocked tool result, log every tool call the agent attempts, and fail the test if the call named in the injection appears in that log, whatever the final answer says. That keeps the result about what the agent did, which is exactly where an input guard and an authorization layer meet.
