forcefield 0.7.1__tar.gz → 0.7.2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {forcefield-0.7.1 → forcefield-0.7.2}/PKG-INFO +1 -1
- {forcefield-0.7.1 → forcefield-0.7.2}/forcefield/__init__.py +1 -1
- {forcefield-0.7.1 → forcefield-0.7.2}/forcefield/cli.py +1 -0
- {forcefield-0.7.1 → forcefield-0.7.2}/forcefield/guard.py +1 -1
- {forcefield-0.7.1 → forcefield-0.7.2}/forcefield/telemetry.py +8 -7
- {forcefield-0.7.1 → forcefield-0.7.2}/forcefield.egg-info/PKG-INFO +1 -1
- {forcefield-0.7.1 → forcefield-0.7.2}/pyproject.toml +1 -1
- {forcefield-0.7.1 → forcefield-0.7.2}/LICENSE +0 -0
- {forcefield-0.7.1 → forcefield-0.7.2}/README.md +0 -0
- {forcefield-0.7.1 → forcefield-0.7.2}/forcefield/__main__.py +0 -0
- {forcefield-0.7.1 → forcefield-0.7.2}/forcefield/abuse.py +0 -0
- {forcefield-0.7.1 → forcefield-0.7.2}/forcefield/attacks.py +0 -0
- {forcefield-0.7.1 → forcefield-0.7.2}/forcefield/audit.py +0 -0
- {forcefield-0.7.1 → forcefield-0.7.2}/forcefield/cloud.py +0 -0
- {forcefield-0.7.1 → forcefield-0.7.2}/forcefield/commands.py +0 -0
- {forcefield-0.7.1 → forcefield-0.7.2}/forcefield/config.py +0 -0
- {forcefield-0.7.1 → forcefield-0.7.2}/forcefield/constitution.py +0 -0
- {forcefield-0.7.1 → forcefield-0.7.2}/forcefield/constitutions/__init__.py +0 -0
- {forcefield-0.7.1 → forcefield-0.7.2}/forcefield/constitutions/default.yaml +0 -0
- {forcefield-0.7.1 → forcefield-0.7.2}/forcefield/constitutions/permissive.yaml +0 -0
- {forcefield-0.7.1 → forcefield-0.7.2}/forcefield/constitutions/strict.yaml +0 -0
- {forcefield-0.7.1 → forcefield-0.7.2}/forcefield/endpoint_scanner.py +0 -0
- {forcefield-0.7.1 → forcefield-0.7.2}/forcefield/evals/__init__.py +0 -0
- {forcefield-0.7.1 → forcefield-0.7.2}/forcefield/evals/governance.yaml +0 -0
- {forcefield-0.7.1 → forcefield-0.7.2}/forcefield/evals/safety.yaml +0 -0
- {forcefield-0.7.1 → forcefield-0.7.2}/forcefield/evals/security.yaml +0 -0
- {forcefield-0.7.1 → forcefield-0.7.2}/forcefield/exfiltration.py +0 -0
- {forcefield-0.7.1 → forcefield-0.7.2}/forcefield/files.py +0 -0
- {forcefield-0.7.1 → forcefield-0.7.2}/forcefield/integrations/__init__.py +0 -0
- {forcefield-0.7.1 → forcefield-0.7.2}/forcefield/integrations/fastapi.py +0 -0
- {forcefield-0.7.1 → forcefield-0.7.2}/forcefield/integrations/langchain.py +0 -0
- {forcefield-0.7.1 → forcefield-0.7.2}/forcefield/integrations/openai.py +0 -0
- {forcefield-0.7.1 → forcefield-0.7.2}/forcefield/integrity.py +0 -0
- {forcefield-0.7.1 → forcefield-0.7.2}/forcefield/ml.py +0 -0
- {forcefield-0.7.1 → forcefield-0.7.2}/forcefield/models/__init__.py +0 -0
- {forcefield-0.7.1 → forcefield-0.7.2}/forcefield/models/tfidf_model.joblib +0 -0
- {forcefield-0.7.1 → forcefield-0.7.2}/forcefield/models/tfidf_model.onnx +0 -0
- {forcefield-0.7.1 → forcefield-0.7.2}/forcefield/moderation.py +0 -0
- {forcefield-0.7.1 → forcefield-0.7.2}/forcefield/obfuscation.py +0 -0
- {forcefield-0.7.1 → forcefield-0.7.2}/forcefield/pii.py +0 -0
- {forcefield-0.7.1 → forcefield-0.7.2}/forcefield/py.typed +0 -0
- {forcefield-0.7.1 → forcefield-0.7.2}/forcefield/ratelimit.py +0 -0
- {forcefield-0.7.1 → forcefield-0.7.2}/forcefield/scanner.py +0 -0
- {forcefield-0.7.1 → forcefield-0.7.2}/forcefield/session.py +0 -0
- {forcefield-0.7.1 → forcefield-0.7.2}/forcefield/templates.py +0 -0
- {forcefield-0.7.1 → forcefield-0.7.2}/forcefield/tools.py +0 -0
- {forcefield-0.7.1 → forcefield-0.7.2}/forcefield/types.py +0 -0
- {forcefield-0.7.1 → forcefield-0.7.2}/forcefield.egg-info/SOURCES.txt +0 -0
- {forcefield-0.7.1 → forcefield-0.7.2}/forcefield.egg-info/dependency_links.txt +0 -0
- {forcefield-0.7.1 → forcefield-0.7.2}/forcefield.egg-info/entry_points.txt +0 -0
- {forcefield-0.7.1 → forcefield-0.7.2}/forcefield.egg-info/requires.txt +0 -0
- {forcefield-0.7.1 → forcefield-0.7.2}/forcefield.egg-info/top_level.txt +0 -0
- {forcefield-0.7.1 → forcefield-0.7.2}/setup.cfg +0 -0
- {forcefield-0.7.1 → forcefield-0.7.2}/tests/test_attacks.py +0 -0
- {forcefield-0.7.1 → forcefield-0.7.2}/tests/test_commands.py +0 -0
- {forcefield-0.7.1 → forcefield-0.7.2}/tests/test_constitution.py +0 -0
- {forcefield-0.7.1 → forcefield-0.7.2}/tests/test_endpoint_scanner.py +0 -0
- {forcefield-0.7.1 → forcefield-0.7.2}/tests/test_evals.py +0 -0
- {forcefield-0.7.1 → forcefield-0.7.2}/tests/test_files.py +0 -0
- {forcefield-0.7.1 → forcefield-0.7.2}/tests/test_guard.py +0 -0
- {forcefield-0.7.1 → forcefield-0.7.2}/tests/test_integrity.py +0 -0
- {forcefield-0.7.1 → forcefield-0.7.2}/tests/test_ml.py +0 -0
- {forcefield-0.7.1 → forcefield-0.7.2}/tests/test_moderation.py +0 -0
- {forcefield-0.7.1 → forcefield-0.7.2}/tests/test_pii.py +0 -0
- {forcefield-0.7.1 → forcefield-0.7.2}/tests/test_scanner.py +0 -0
- {forcefield-0.7.1 → forcefield-0.7.2}/tests/test_session.py +0 -0
- {forcefield-0.7.1 → forcefield-0.7.2}/tests/test_telemetry.py +0 -0
- {forcefield-0.7.1 → forcefield-0.7.2}/tests/test_templates.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: forcefield
|
|
3
|
-
Version: 0.7.
|
|
3
|
+
Version: 0.7.2
|
|
4
4
|
Summary: Zero-dependency AI security library -- prompt-injection detection, PII redaction, content safety, rate limiting, abuse detection, tool governance, and security evals for LLMs in 3 lines of Python.
|
|
5
5
|
Author-email: Data Science Tech <security@datasciencetech.ca>
|
|
6
6
|
License: Apache-2.0
|
|
@@ -525,6 +525,7 @@ def main(argv: list | None = None) -> int:
|
|
|
525
525
|
parser = argparse.ArgumentParser(
|
|
526
526
|
prog="forcefield",
|
|
527
527
|
description="ForceField AI Security Scanner",
|
|
528
|
+
epilog="Telemetry: ForceField collects anonymous usage statistics (feature counts, SDK version, OS) to improve the product. No prompts, filenames, or PII are ever sent. Disable with FORCEFIELD_NO_TELEMETRY=1 or Guard(telemetry=False). Details: https://datasciencetech.ca/en/python-sdk#telemetry",
|
|
528
529
|
)
|
|
529
530
|
from . import __version__
|
|
530
531
|
parser.add_argument("--version", action="version", version=f"forcefield {__version__}")
|
|
@@ -57,7 +57,7 @@ class Guard:
|
|
|
57
57
|
custom_blocked_patterns: Optional[List[str]] = None,
|
|
58
58
|
redaction_strategy: str = "mask",
|
|
59
59
|
config: Optional[GuardConfig] = None,
|
|
60
|
-
telemetry: bool =
|
|
60
|
+
telemetry: bool = True,
|
|
61
61
|
api_key: Optional[str] = None,
|
|
62
62
|
):
|
|
63
63
|
if config is not None:
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
"""
|
|
1
|
+
"""Privacy-safe usage telemetry for ForceField SDK.
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
- ``Guard(telemetry=
|
|
5
|
-
- ``
|
|
3
|
+
Enabled by default. Disable via:
|
|
4
|
+
- ``Guard(telemetry=False)``
|
|
5
|
+
- ``FORCEFIELD_NO_TELEMETRY=1`` environment variable
|
|
6
|
+
- ``FORCEFIELD_TELEMETRY=0`` environment variable
|
|
6
7
|
|
|
7
8
|
What is sent (aggregate counts, never raw prompts/filenames):
|
|
8
9
|
- SDK version, Python version, OS
|
|
@@ -59,7 +60,7 @@ def _is_env_enabled() -> Optional[bool]:
|
|
|
59
60
|
class TelemetryCollector:
|
|
60
61
|
"""Collects and batches SDK usage events."""
|
|
61
62
|
|
|
62
|
-
def __init__(self, enabled: bool =
|
|
63
|
+
def __init__(self, enabled: bool = True, api_key: Optional[str] = None):
|
|
63
64
|
env = _is_env_enabled()
|
|
64
65
|
self._enabled = env if env is not None else enabled
|
|
65
66
|
self._api_key = api_key
|
|
@@ -195,12 +196,12 @@ class TelemetryCollector:
|
|
|
195
196
|
self.flush()
|
|
196
197
|
|
|
197
198
|
|
|
198
|
-
# Module-level singleton (
|
|
199
|
+
# Module-level singleton (enabled by default, opt-out via env)
|
|
199
200
|
_collector: Optional[TelemetryCollector] = None
|
|
200
201
|
_collector_lock = threading.Lock()
|
|
201
202
|
|
|
202
203
|
|
|
203
|
-
def get_collector(enabled: bool =
|
|
204
|
+
def get_collector(enabled: bool = True, api_key: Optional[str] = None) -> TelemetryCollector:
|
|
204
205
|
"""Get or create the global telemetry collector."""
|
|
205
206
|
global _collector
|
|
206
207
|
with _collector_lock:
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: forcefield
|
|
3
|
-
Version: 0.7.
|
|
3
|
+
Version: 0.7.2
|
|
4
4
|
Summary: Zero-dependency AI security library -- prompt-injection detection, PII redaction, content safety, rate limiting, abuse detection, tool governance, and security evals for LLMs in 3 lines of Python.
|
|
5
5
|
Author-email: Data Science Tech <security@datasciencetech.ca>
|
|
6
6
|
License: Apache-2.0
|
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "forcefield"
|
|
7
|
-
version = "0.7.
|
|
7
|
+
version = "0.7.2"
|
|
8
8
|
description = "Zero-dependency AI security library -- prompt-injection detection, PII redaction, content safety, rate limiting, abuse detection, tool governance, and security evals for LLMs in 3 lines of Python."
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
license = {text = "Apache-2.0"}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|