safentic 1.0.1__tar.gz → 1.0.3__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.
- {safentic-1.0.1/safentic.egg-info → safentic-1.0.3}/PKG-INFO +7 -1
- {safentic-1.0.1 → safentic-1.0.3}/requirements.txt +1 -1
- {safentic-1.0.1 → safentic-1.0.3}/safentic/__init__.py +1 -1
- {safentic-1.0.1 → safentic-1.0.3}/safentic/layer.py +2 -2
- safentic-1.0.3/safentic/policies/policy.yaml +49 -0
- {safentic-1.0.1 → safentic-1.0.3/safentic.egg-info}/PKG-INFO +7 -1
- {safentic-1.0.1 → safentic-1.0.3}/safentic.egg-info/SOURCES.txt +1 -0
- safentic-1.0.3/safentic.egg-info/requires.txt +5 -0
- {safentic-1.0.1 → safentic-1.0.3}/setup.py +8 -2
- safentic-1.0.1/safentic/policies/policy.yaml +0 -25
- {safentic-1.0.1 → safentic-1.0.3}/MANIFEST.in +0 -0
- {safentic-1.0.1 → safentic-1.0.3}/README.md +0 -0
- {safentic-1.0.1 → safentic-1.0.3}/safentic/LICENSE.txt +0 -0
- {safentic-1.0.1 → safentic-1.0.3}/safentic/config.py +0 -0
- {safentic-1.0.1 → safentic-1.0.3}/safentic/engine.py +0 -0
- {safentic-1.0.1 → safentic-1.0.3}/safentic/helper/__init__.py +0 -0
- {safentic-1.0.1 → safentic-1.0.3}/safentic/helper/auth.py +0 -0
- {safentic-1.0.1 → safentic-1.0.3}/safentic/logger/__init__.py +0 -0
- {safentic-1.0.1 → safentic-1.0.3}/safentic/logger/audit.py +0 -0
- {safentic-1.0.1 → safentic-1.0.3}/safentic/policies/.gitkeep +0 -0
- {safentic-1.0.1 → safentic-1.0.3}/safentic/policies/__init__.py +0 -0
- {safentic-1.0.1 → safentic-1.0.3}/safentic/policies/example_policy.txt +0 -0
- {safentic-1.0.1 → safentic-1.0.3}/safentic/policy.py +0 -0
- {safentic-1.0.1 → safentic-1.0.3}/safentic/verifiers/__init__.py +0 -0
- {safentic-1.0.1 → safentic-1.0.3}/safentic/verifiers/sentence_verifier.py +0 -0
- {safentic-1.0.1 → safentic-1.0.3}/safentic.egg-info/dependency_links.txt +0 -0
- {safentic-1.0.1 → safentic-1.0.3}/safentic.egg-info/top_level.txt +0 -0
- {safentic-1.0.1 → safentic-1.0.3}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: safentic
|
3
|
-
Version: 1.0.
|
3
|
+
Version: 1.0.3
|
4
4
|
Summary: Safentic SDK for behavior analysis
|
5
5
|
Home-page: https://safentic.com
|
6
6
|
Author: Safentic
|
@@ -10,6 +10,11 @@ Classifier: Programming Language :: Python :: 3
|
|
10
10
|
Classifier: License :: Other/Proprietary License
|
11
11
|
Classifier: Operating System :: OS Independent
|
12
12
|
Description-Content-Type: text/markdown
|
13
|
+
Requires-Dist: requests
|
14
|
+
Requires-Dist: PyYAML
|
15
|
+
Requires-Dist: sentence-transformers==3.2.1
|
16
|
+
Requires-Dist: sqlalchemy
|
17
|
+
Requires-Dist: python-dotenv
|
13
18
|
Dynamic: author
|
14
19
|
Dynamic: author-email
|
15
20
|
Dynamic: classifier
|
@@ -17,6 +22,7 @@ Dynamic: description
|
|
17
22
|
Dynamic: description-content-type
|
18
23
|
Dynamic: home-page
|
19
24
|
Dynamic: license
|
25
|
+
Dynamic: requires-dist
|
20
26
|
Dynamic: summary
|
21
27
|
|
22
28
|
# Safentic SDK
|
@@ -16,12 +16,11 @@ class SafetyLayer():
|
|
16
16
|
# Raises SafenticError if blocked
|
17
17
|
"""
|
18
18
|
|
19
|
-
def __init__(self, api_key
|
19
|
+
def __init__(self, api_key="", agent_id="", enforcer: PolicyEnforcer = None, raise_on_block: bool = True):
|
20
20
|
self.agent_id = agent_id
|
21
21
|
self.raise_on_block = raise_on_block
|
22
22
|
self.logger = AuditLogger()
|
23
23
|
|
24
|
-
# If no custom enforcer is provided, instantiate one with the API key
|
25
24
|
self.enforcer = enforcer or PolicyEnforcer()
|
26
25
|
self.api_key = validate_api_key(api_key)
|
27
26
|
self.enforcer.reset(agent_id)
|
@@ -31,6 +30,7 @@ class SafetyLayer():
|
|
31
30
|
Checks whether a tool action is allowed.
|
32
31
|
Raises SafenticError if blocked (default), or returns result if raise_on_block=False.
|
33
32
|
"""
|
33
|
+
|
34
34
|
result = self.enforcer.enforce(self.agent_id, tool_name, tool_args)
|
35
35
|
|
36
36
|
# Log structured event
|
@@ -0,0 +1,49 @@
|
|
1
|
+
tools:
|
2
|
+
send_email:
|
3
|
+
checks:
|
4
|
+
- type: deny_phrase
|
5
|
+
phrases:
|
6
|
+
- "one device per subscription"
|
7
|
+
- "24 hours"
|
8
|
+
- "apology"
|
9
|
+
- "apologize"
|
10
|
+
- "sorry"
|
11
|
+
- "refund"
|
12
|
+
- "refund delay"
|
13
|
+
- type: semantic
|
14
|
+
trigger_phrases:
|
15
|
+
- "refund policy"
|
16
|
+
- "guarantee"
|
17
|
+
- "our policy"
|
18
|
+
reference_file: "example_policy.txt"
|
19
|
+
|
20
|
+
issue_refund:
|
21
|
+
checks:
|
22
|
+
- type: deny_phrase
|
23
|
+
phrases:
|
24
|
+
- "refund"
|
25
|
+
- "refunding"
|
26
|
+
- "issue refund"
|
27
|
+
- "send refund"
|
28
|
+
- "credit customer"
|
29
|
+
- "reverse charge"
|
30
|
+
- "double charge"
|
31
|
+
- "processed refund"
|
32
|
+
- "grant compensation"
|
33
|
+
- "money back"
|
34
|
+
- type: semantic
|
35
|
+
trigger_phrases:
|
36
|
+
- "we've sent your refund"
|
37
|
+
- "your money is on the way"
|
38
|
+
reference_file: "refund_statement.txt"
|
39
|
+
|
40
|
+
update_ticket:
|
41
|
+
checks: [] # Explicitly allow all
|
42
|
+
|
43
|
+
log_to_crm:
|
44
|
+
checks: [] # Explicitly allow all
|
45
|
+
|
46
|
+
logging:
|
47
|
+
level: INFO
|
48
|
+
destination: "safentic/logs/txt_logs/safentic_audit.log"
|
49
|
+
jsonl: "safentic/logs/json_logs/safentic_audit.jsonl"
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: safentic
|
3
|
-
Version: 1.0.
|
3
|
+
Version: 1.0.3
|
4
4
|
Summary: Safentic SDK for behavior analysis
|
5
5
|
Home-page: https://safentic.com
|
6
6
|
Author: Safentic
|
@@ -10,6 +10,11 @@ Classifier: Programming Language :: Python :: 3
|
|
10
10
|
Classifier: License :: Other/Proprietary License
|
11
11
|
Classifier: Operating System :: OS Independent
|
12
12
|
Description-Content-Type: text/markdown
|
13
|
+
Requires-Dist: requests
|
14
|
+
Requires-Dist: PyYAML
|
15
|
+
Requires-Dist: sentence-transformers==3.2.1
|
16
|
+
Requires-Dist: sqlalchemy
|
17
|
+
Requires-Dist: python-dotenv
|
13
18
|
Dynamic: author
|
14
19
|
Dynamic: author-email
|
15
20
|
Dynamic: classifier
|
@@ -17,6 +22,7 @@ Dynamic: description
|
|
17
22
|
Dynamic: description-content-type
|
18
23
|
Dynamic: home-page
|
19
24
|
Dynamic: license
|
25
|
+
Dynamic: requires-dist
|
20
26
|
Dynamic: summary
|
21
27
|
|
22
28
|
# Safentic SDK
|
@@ -2,9 +2,15 @@ from setuptools import setup, find_packages
|
|
2
2
|
|
3
3
|
setup(
|
4
4
|
name="safentic",
|
5
|
-
version="1.0.
|
5
|
+
version="1.0.3",
|
6
6
|
packages=find_packages(),
|
7
|
-
install_requires=[
|
7
|
+
install_requires=[
|
8
|
+
"requests",
|
9
|
+
"PyYAML",
|
10
|
+
"sentence-transformers==3.2.1",
|
11
|
+
"sqlalchemy",
|
12
|
+
"python-dotenv"
|
13
|
+
],
|
8
14
|
include_package_data=True,
|
9
15
|
license="Proprietary :: Safentic Commercial License", # Custom classifier
|
10
16
|
classifiers=[
|
@@ -1,25 +0,0 @@
|
|
1
|
-
tools:
|
2
|
-
send_email:
|
3
|
-
checks:
|
4
|
-
- type: deny_phrase
|
5
|
-
phrases:
|
6
|
-
- "one device per subscription"
|
7
|
-
- "24 hours"
|
8
|
-
|
9
|
-
- type: semantic
|
10
|
-
trigger_phrases:
|
11
|
-
- "refund policy"
|
12
|
-
- "guarantee"
|
13
|
-
- "our policy"
|
14
|
-
reference_file: "example_policy.txt"
|
15
|
-
|
16
|
-
update_ticket:
|
17
|
-
checks: [] # Explicitly allow all — no policy checks
|
18
|
-
|
19
|
-
log_to_crm:
|
20
|
-
checks: [] # Explicitly allow all — no policy checks
|
21
|
-
|
22
|
-
logging:
|
23
|
-
level: INFO
|
24
|
-
destination: "safentic/logs/txt_logs/safentic_audit.log"
|
25
|
-
jsonl: "safentic/logs/json_logs/safentic_audit.jsonl"
|
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
|