pangea-sdk 5.5.0b1__tar.gz → 5.5.0b2__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.
Files changed (60) hide show
  1. {pangea_sdk-5.5.0b1 → pangea_sdk-5.5.0b2}/PKG-INFO +4 -4
  2. {pangea_sdk-5.5.0b1 → pangea_sdk-5.5.0b2}/README.md +2 -2
  3. {pangea_sdk-5.5.0b1 → pangea_sdk-5.5.0b2}/pangea/__init__.py +1 -1
  4. {pangea_sdk-5.5.0b1 → pangea_sdk-5.5.0b2}/pangea/config.py +6 -4
  5. {pangea_sdk-5.5.0b1 → pangea_sdk-5.5.0b2}/pangea/services/ai_guard.py +35 -3
  6. {pangea_sdk-5.5.0b1 → pangea_sdk-5.5.0b2}/pyproject.toml +2 -2
  7. {pangea_sdk-5.5.0b1 → pangea_sdk-5.5.0b2}/pangea/asyncio/__init__.py +0 -0
  8. {pangea_sdk-5.5.0b1 → pangea_sdk-5.5.0b2}/pangea/asyncio/file_uploader.py +0 -0
  9. {pangea_sdk-5.5.0b1 → pangea_sdk-5.5.0b2}/pangea/asyncio/request.py +0 -0
  10. {pangea_sdk-5.5.0b1 → pangea_sdk-5.5.0b2}/pangea/asyncio/services/__init__.py +0 -0
  11. {pangea_sdk-5.5.0b1 → pangea_sdk-5.5.0b2}/pangea/asyncio/services/ai_guard.py +0 -0
  12. {pangea_sdk-5.5.0b1 → pangea_sdk-5.5.0b2}/pangea/asyncio/services/audit.py +0 -0
  13. {pangea_sdk-5.5.0b1 → pangea_sdk-5.5.0b2}/pangea/asyncio/services/authn.py +0 -0
  14. {pangea_sdk-5.5.0b1 → pangea_sdk-5.5.0b2}/pangea/asyncio/services/authz.py +0 -0
  15. {pangea_sdk-5.5.0b1 → pangea_sdk-5.5.0b2}/pangea/asyncio/services/base.py +0 -0
  16. {pangea_sdk-5.5.0b1 → pangea_sdk-5.5.0b2}/pangea/asyncio/services/embargo.py +0 -0
  17. {pangea_sdk-5.5.0b1 → pangea_sdk-5.5.0b2}/pangea/asyncio/services/file_scan.py +0 -0
  18. {pangea_sdk-5.5.0b1 → pangea_sdk-5.5.0b2}/pangea/asyncio/services/intel.py +0 -0
  19. {pangea_sdk-5.5.0b1 → pangea_sdk-5.5.0b2}/pangea/asyncio/services/prompt_guard.py +0 -0
  20. {pangea_sdk-5.5.0b1 → pangea_sdk-5.5.0b2}/pangea/asyncio/services/redact.py +0 -0
  21. {pangea_sdk-5.5.0b1 → pangea_sdk-5.5.0b2}/pangea/asyncio/services/sanitize.py +0 -0
  22. {pangea_sdk-5.5.0b1 → pangea_sdk-5.5.0b2}/pangea/asyncio/services/share.py +0 -0
  23. {pangea_sdk-5.5.0b1 → pangea_sdk-5.5.0b2}/pangea/asyncio/services/vault.py +0 -0
  24. {pangea_sdk-5.5.0b1 → pangea_sdk-5.5.0b2}/pangea/audit_logger.py +0 -0
  25. {pangea_sdk-5.5.0b1 → pangea_sdk-5.5.0b2}/pangea/crypto/rsa.py +0 -0
  26. {pangea_sdk-5.5.0b1 → pangea_sdk-5.5.0b2}/pangea/deep_verify.py +0 -0
  27. {pangea_sdk-5.5.0b1 → pangea_sdk-5.5.0b2}/pangea/deprecated.py +0 -0
  28. {pangea_sdk-5.5.0b1 → pangea_sdk-5.5.0b2}/pangea/dump_audit.py +0 -0
  29. {pangea_sdk-5.5.0b1 → pangea_sdk-5.5.0b2}/pangea/exceptions.py +0 -0
  30. {pangea_sdk-5.5.0b1 → pangea_sdk-5.5.0b2}/pangea/file_uploader.py +0 -0
  31. {pangea_sdk-5.5.0b1 → pangea_sdk-5.5.0b2}/pangea/py.typed +0 -0
  32. {pangea_sdk-5.5.0b1 → pangea_sdk-5.5.0b2}/pangea/request.py +0 -0
  33. {pangea_sdk-5.5.0b1 → pangea_sdk-5.5.0b2}/pangea/response.py +0 -0
  34. {pangea_sdk-5.5.0b1 → pangea_sdk-5.5.0b2}/pangea/services/__init__.py +0 -0
  35. {pangea_sdk-5.5.0b1 → pangea_sdk-5.5.0b2}/pangea/services/audit/audit.py +0 -0
  36. {pangea_sdk-5.5.0b1 → pangea_sdk-5.5.0b2}/pangea/services/audit/exceptions.py +0 -0
  37. {pangea_sdk-5.5.0b1 → pangea_sdk-5.5.0b2}/pangea/services/audit/models.py +0 -0
  38. {pangea_sdk-5.5.0b1 → pangea_sdk-5.5.0b2}/pangea/services/audit/signing.py +0 -0
  39. {pangea_sdk-5.5.0b1 → pangea_sdk-5.5.0b2}/pangea/services/audit/util.py +0 -0
  40. {pangea_sdk-5.5.0b1 → pangea_sdk-5.5.0b2}/pangea/services/authn/authn.py +0 -0
  41. {pangea_sdk-5.5.0b1 → pangea_sdk-5.5.0b2}/pangea/services/authn/models.py +0 -0
  42. {pangea_sdk-5.5.0b1 → pangea_sdk-5.5.0b2}/pangea/services/authz.py +0 -0
  43. {pangea_sdk-5.5.0b1 → pangea_sdk-5.5.0b2}/pangea/services/base.py +0 -0
  44. {pangea_sdk-5.5.0b1 → pangea_sdk-5.5.0b2}/pangea/services/embargo.py +0 -0
  45. {pangea_sdk-5.5.0b1 → pangea_sdk-5.5.0b2}/pangea/services/file_scan.py +0 -0
  46. {pangea_sdk-5.5.0b1 → pangea_sdk-5.5.0b2}/pangea/services/intel.py +0 -0
  47. {pangea_sdk-5.5.0b1 → pangea_sdk-5.5.0b2}/pangea/services/prompt_guard.py +0 -0
  48. {pangea_sdk-5.5.0b1 → pangea_sdk-5.5.0b2}/pangea/services/redact.py +0 -0
  49. {pangea_sdk-5.5.0b1 → pangea_sdk-5.5.0b2}/pangea/services/sanitize.py +0 -0
  50. {pangea_sdk-5.5.0b1 → pangea_sdk-5.5.0b2}/pangea/services/share/file_format.py +0 -0
  51. {pangea_sdk-5.5.0b1 → pangea_sdk-5.5.0b2}/pangea/services/share/share.py +0 -0
  52. {pangea_sdk-5.5.0b1 → pangea_sdk-5.5.0b2}/pangea/services/vault/models/asymmetric.py +0 -0
  53. {pangea_sdk-5.5.0b1 → pangea_sdk-5.5.0b2}/pangea/services/vault/models/common.py +0 -0
  54. {pangea_sdk-5.5.0b1 → pangea_sdk-5.5.0b2}/pangea/services/vault/models/keys.py +0 -0
  55. {pangea_sdk-5.5.0b1 → pangea_sdk-5.5.0b2}/pangea/services/vault/models/secret.py +0 -0
  56. {pangea_sdk-5.5.0b1 → pangea_sdk-5.5.0b2}/pangea/services/vault/models/symmetric.py +0 -0
  57. {pangea_sdk-5.5.0b1 → pangea_sdk-5.5.0b2}/pangea/services/vault/vault.py +0 -0
  58. {pangea_sdk-5.5.0b1 → pangea_sdk-5.5.0b2}/pangea/tools.py +0 -0
  59. {pangea_sdk-5.5.0b1 → pangea_sdk-5.5.0b2}/pangea/utils.py +0 -0
  60. {pangea_sdk-5.5.0b1 → pangea_sdk-5.5.0b2}/pangea/verify_audit.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: pangea-sdk
3
- Version: 5.5.0b1
3
+ Version: 5.5.0b2
4
4
  Summary: Pangea API SDK
5
5
  License: MIT
6
6
  Keywords: Pangea,SDK,Audit
@@ -14,7 +14,7 @@ Requires-Dist: cryptography (>=43.0.3,<44.0.0)
14
14
  Requires-Dist: deprecated (>=1.2.15,<2.0.0)
15
15
  Requires-Dist: google-crc32c (>=1.5.0,<2.0.0)
16
16
  Requires-Dist: pydantic (>=2.10.5,<3.0.0)
17
- Requires-Dist: python-dateutil (>=2.9.0,<3.0.0)
17
+ Requires-Dist: python-dateutil (>=2.9.0.post0,<3.0.0)
18
18
  Requires-Dist: requests (>=2.31.0,<3.0.0)
19
19
  Requires-Dist: requests-toolbelt (>=1.0.0,<2.0.0)
20
20
  Requires-Dist: typing-extensions (>=4.12.2,<5.0.0)
@@ -63,13 +63,13 @@ the same compatibility guarantees as stable releases.
63
63
  Via pip:
64
64
 
65
65
  ```bash
66
- $ pip3 install pangea-sdk==5.5.0b1
66
+ $ pip3 install pangea-sdk==5.5.0b2
67
67
  ```
68
68
 
69
69
  Via poetry:
70
70
 
71
71
  ```bash
72
- $ poetry add pangea-sdk==5.5.0b1
72
+ $ poetry add pangea-sdk==5.5.0b2
73
73
  ```
74
74
 
75
75
  ## Usage
@@ -41,13 +41,13 @@ the same compatibility guarantees as stable releases.
41
41
  Via pip:
42
42
 
43
43
  ```bash
44
- $ pip3 install pangea-sdk==5.5.0b1
44
+ $ pip3 install pangea-sdk==5.5.0b2
45
45
  ```
46
46
 
47
47
  Via poetry:
48
48
 
49
49
  ```bash
50
- $ poetry add pangea-sdk==5.5.0b1
50
+ $ poetry add pangea-sdk==5.5.0b2
51
51
  ```
52
52
 
53
53
  ## Usage
@@ -1,4 +1,4 @@
1
- __version__ = "5.5.0beta1"
1
+ __version__ = "5.5.0beta2"
2
2
 
3
3
  from pangea.asyncio.request import PangeaRequestAsync
4
4
  from pangea.config import PangeaConfig
@@ -2,7 +2,7 @@
2
2
  # Author: Pangea Cyber Corporation
3
3
 
4
4
  from dataclasses import dataclass
5
- from typing import Optional
5
+ from typing import Literal, Optional
6
6
 
7
7
 
8
8
  @dataclass
@@ -16,10 +16,12 @@ class PangeaConfig:
16
16
  scheme (http:// or https://), subdomain, domain and port.
17
17
  """
18
18
 
19
- environment: str = "production"
19
+ environment: Literal["production", "local"] = "production"
20
20
  """
21
- Used to generate service url.
22
- It should be only 'production' or 'local' in cases of particular services that can run locally as Redact.
21
+ Pangea environment, used to construct service URLs.
22
+
23
+ If set to "local", then `domain` must be the full host (i.e., hostname and
24
+ port) for the Pangea service that this `PangeaConfig` will be used for.
23
25
  """
24
26
 
25
27
  config_id: Optional[str] = None
@@ -1,11 +1,13 @@
1
1
  from __future__ import annotations
2
2
 
3
- from typing import Any, Dict, Generic, List, Optional, TypeVar, overload
3
+ from typing import Any, Dict, Generic, List, Literal, Optional, TypeVar, overload
4
4
 
5
5
  from pangea.config import PangeaConfig
6
6
  from pangea.response import APIResponseModel, PangeaResponse, PangeaResponseResult
7
7
  from pangea.services.base import ServiceBase
8
8
 
9
+ _DetectorAction = Literal["detected", "redacted", "defanged", "reported", "blocked"]
10
+
9
11
 
10
12
  class AnalyzerResponse(APIResponseModel):
11
13
  analyzer: str
@@ -13,6 +15,7 @@ class AnalyzerResponse(APIResponseModel):
13
15
 
14
16
 
15
17
  class PromptInjectionResult(APIResponseModel):
18
+ action: _DetectorAction
16
19
  analyzer_responses: List[AnalyzerResponse]
17
20
  """Triggered prompt injection analyzers."""
18
21
 
@@ -20,7 +23,7 @@ class PromptInjectionResult(APIResponseModel):
20
23
  class PiiEntity(APIResponseModel):
21
24
  type: str
22
25
  value: str
23
- redacted: bool
26
+ action: _DetectorAction
24
27
  start_pos: Optional[int] = None
25
28
 
26
29
 
@@ -31,7 +34,7 @@ class PiiEntityResult(APIResponseModel):
31
34
  class MaliciousEntity(APIResponseModel):
32
35
  type: str
33
36
  value: str
34
- redacted: Optional[bool] = None
37
+ action: _DetectorAction
35
38
  start_pos: Optional[int] = None
36
39
  raw: Optional[Dict[str, Any]] = None
37
40
 
@@ -40,6 +43,28 @@ class MaliciousEntityResult(APIResponseModel):
40
43
  entities: List[MaliciousEntity]
41
44
 
42
45
 
46
+ class SecretsEntity(APIResponseModel):
47
+ type: str
48
+ value: str
49
+ action: _DetectorAction
50
+ start_pos: Optional[int] = None
51
+ redacted_value: Optional[str] = None
52
+
53
+
54
+ class SecretsEntityResult(APIResponseModel):
55
+ entities: List[SecretsEntity]
56
+
57
+
58
+ class LanguageDetectionResult(APIResponseModel):
59
+ language: str
60
+ action: _DetectorAction
61
+
62
+
63
+ class CodeDetectionResult(APIResponseModel):
64
+ language: str
65
+ action: _DetectorAction
66
+
67
+
43
68
  _T = TypeVar("_T")
44
69
 
45
70
 
@@ -52,6 +77,11 @@ class TextGuardDetectors(APIResponseModel):
52
77
  prompt_injection: Optional[TextGuardDetector[PromptInjectionResult]] = None
53
78
  pii_entity: Optional[TextGuardDetector[PiiEntityResult]] = None
54
79
  malicious_entity: Optional[TextGuardDetector[MaliciousEntityResult]] = None
80
+ secrets_detection: Optional[TextGuardDetector[SecretsEntityResult]] = None
81
+ profanity_and_toxicity: Optional[TextGuardDetector[Any]] = None
82
+ custom_entity: Optional[TextGuardDetector[Any]] = None
83
+ language_detection: Optional[TextGuardDetector[LanguageDetectionResult]] = None
84
+ code_detection: Optional[TextGuardDetector[CodeDetectionResult]] = None
55
85
 
56
86
 
57
87
  class TextGuardResult(PangeaResponseResult, Generic[_T]):
@@ -64,6 +94,8 @@ class TextGuardResult(PangeaResponseResult, Generic[_T]):
64
94
  prompt_messages: Optional[_T] = None
65
95
  """Updated structured prompt, if applicable."""
66
96
 
97
+ blocked: bool
98
+
67
99
 
68
100
  class AIGuard(ServiceBase):
69
101
  """AI Guard service client.
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "pangea-sdk"
3
- version = "5.5.0beta1"
3
+ version = "5.5.0beta2"
4
4
  description = "Pangea API SDK"
5
5
  authors = [
6
6
  {name = "Glenn Gallien", email = "glenn.gallien@pangea.cloud"}
@@ -21,7 +21,7 @@ dependencies = [
21
21
  "deprecated (>=1.2.15,<2.0.0)",
22
22
  "google-crc32c (>=1.5.0,<2.0.0)",
23
23
  "pydantic (>=2.10.5,<3.0.0)",
24
- "python-dateutil (>=2.9.0,<3.0.0)",
24
+ "python-dateutil (>=2.9.0.post0,<3.0.0)",
25
25
  "requests (>=2.31.0,<3.0.0)",
26
26
  "requests-toolbelt (>=1.0.0,<2.0.0)",
27
27
  "typing-extensions (>=4.12.2,<5.0.0)"