pangea-sdk 5.5.0b2__tar.gz → 5.5.0b3__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.0b2 → pangea_sdk-5.5.0b3}/PKG-INFO +7 -7
  2. {pangea_sdk-5.5.0b2 → pangea_sdk-5.5.0b3}/README.md +2 -2
  3. {pangea_sdk-5.5.0b2 → pangea_sdk-5.5.0b3}/pangea/__init__.py +1 -1
  4. {pangea_sdk-5.5.0b2 → pangea_sdk-5.5.0b3}/pangea/asyncio/services/ai_guard.py +3 -0
  5. {pangea_sdk-5.5.0b2 → pangea_sdk-5.5.0b3}/pangea/asyncio/services/prompt_guard.py +17 -4
  6. {pangea_sdk-5.5.0b2 → pangea_sdk-5.5.0b3}/pangea/asyncio/services/share.py +2 -2
  7. {pangea_sdk-5.5.0b2 → pangea_sdk-5.5.0b3}/pangea/services/ai_guard.py +10 -9
  8. {pangea_sdk-5.5.0b2 → pangea_sdk-5.5.0b3}/pangea/services/prompt_guard.py +19 -6
  9. {pangea_sdk-5.5.0b2 → pangea_sdk-5.5.0b3}/pangea/services/share/share.py +1 -1
  10. {pangea_sdk-5.5.0b2 → pangea_sdk-5.5.0b3}/pyproject.toml +7 -7
  11. {pangea_sdk-5.5.0b2 → pangea_sdk-5.5.0b3}/pangea/asyncio/__init__.py +0 -0
  12. {pangea_sdk-5.5.0b2 → pangea_sdk-5.5.0b3}/pangea/asyncio/file_uploader.py +0 -0
  13. {pangea_sdk-5.5.0b2 → pangea_sdk-5.5.0b3}/pangea/asyncio/request.py +0 -0
  14. {pangea_sdk-5.5.0b2 → pangea_sdk-5.5.0b3}/pangea/asyncio/services/__init__.py +0 -0
  15. {pangea_sdk-5.5.0b2 → pangea_sdk-5.5.0b3}/pangea/asyncio/services/audit.py +0 -0
  16. {pangea_sdk-5.5.0b2 → pangea_sdk-5.5.0b3}/pangea/asyncio/services/authn.py +0 -0
  17. {pangea_sdk-5.5.0b2 → pangea_sdk-5.5.0b3}/pangea/asyncio/services/authz.py +0 -0
  18. {pangea_sdk-5.5.0b2 → pangea_sdk-5.5.0b3}/pangea/asyncio/services/base.py +0 -0
  19. {pangea_sdk-5.5.0b2 → pangea_sdk-5.5.0b3}/pangea/asyncio/services/embargo.py +0 -0
  20. {pangea_sdk-5.5.0b2 → pangea_sdk-5.5.0b3}/pangea/asyncio/services/file_scan.py +0 -0
  21. {pangea_sdk-5.5.0b2 → pangea_sdk-5.5.0b3}/pangea/asyncio/services/intel.py +0 -0
  22. {pangea_sdk-5.5.0b2 → pangea_sdk-5.5.0b3}/pangea/asyncio/services/redact.py +0 -0
  23. {pangea_sdk-5.5.0b2 → pangea_sdk-5.5.0b3}/pangea/asyncio/services/sanitize.py +0 -0
  24. {pangea_sdk-5.5.0b2 → pangea_sdk-5.5.0b3}/pangea/asyncio/services/vault.py +0 -0
  25. {pangea_sdk-5.5.0b2 → pangea_sdk-5.5.0b3}/pangea/audit_logger.py +0 -0
  26. {pangea_sdk-5.5.0b2 → pangea_sdk-5.5.0b3}/pangea/config.py +0 -0
  27. {pangea_sdk-5.5.0b2 → pangea_sdk-5.5.0b3}/pangea/crypto/rsa.py +0 -0
  28. {pangea_sdk-5.5.0b2 → pangea_sdk-5.5.0b3}/pangea/deep_verify.py +0 -0
  29. {pangea_sdk-5.5.0b2 → pangea_sdk-5.5.0b3}/pangea/deprecated.py +0 -0
  30. {pangea_sdk-5.5.0b2 → pangea_sdk-5.5.0b3}/pangea/dump_audit.py +0 -0
  31. {pangea_sdk-5.5.0b2 → pangea_sdk-5.5.0b3}/pangea/exceptions.py +0 -0
  32. {pangea_sdk-5.5.0b2 → pangea_sdk-5.5.0b3}/pangea/file_uploader.py +0 -0
  33. {pangea_sdk-5.5.0b2 → pangea_sdk-5.5.0b3}/pangea/py.typed +0 -0
  34. {pangea_sdk-5.5.0b2 → pangea_sdk-5.5.0b3}/pangea/request.py +0 -0
  35. {pangea_sdk-5.5.0b2 → pangea_sdk-5.5.0b3}/pangea/response.py +0 -0
  36. {pangea_sdk-5.5.0b2 → pangea_sdk-5.5.0b3}/pangea/services/__init__.py +0 -0
  37. {pangea_sdk-5.5.0b2 → pangea_sdk-5.5.0b3}/pangea/services/audit/audit.py +0 -0
  38. {pangea_sdk-5.5.0b2 → pangea_sdk-5.5.0b3}/pangea/services/audit/exceptions.py +0 -0
  39. {pangea_sdk-5.5.0b2 → pangea_sdk-5.5.0b3}/pangea/services/audit/models.py +0 -0
  40. {pangea_sdk-5.5.0b2 → pangea_sdk-5.5.0b3}/pangea/services/audit/signing.py +0 -0
  41. {pangea_sdk-5.5.0b2 → pangea_sdk-5.5.0b3}/pangea/services/audit/util.py +0 -0
  42. {pangea_sdk-5.5.0b2 → pangea_sdk-5.5.0b3}/pangea/services/authn/authn.py +0 -0
  43. {pangea_sdk-5.5.0b2 → pangea_sdk-5.5.0b3}/pangea/services/authn/models.py +0 -0
  44. {pangea_sdk-5.5.0b2 → pangea_sdk-5.5.0b3}/pangea/services/authz.py +0 -0
  45. {pangea_sdk-5.5.0b2 → pangea_sdk-5.5.0b3}/pangea/services/base.py +0 -0
  46. {pangea_sdk-5.5.0b2 → pangea_sdk-5.5.0b3}/pangea/services/embargo.py +0 -0
  47. {pangea_sdk-5.5.0b2 → pangea_sdk-5.5.0b3}/pangea/services/file_scan.py +0 -0
  48. {pangea_sdk-5.5.0b2 → pangea_sdk-5.5.0b3}/pangea/services/intel.py +0 -0
  49. {pangea_sdk-5.5.0b2 → pangea_sdk-5.5.0b3}/pangea/services/redact.py +0 -0
  50. {pangea_sdk-5.5.0b2 → pangea_sdk-5.5.0b3}/pangea/services/sanitize.py +0 -0
  51. {pangea_sdk-5.5.0b2 → pangea_sdk-5.5.0b3}/pangea/services/share/file_format.py +0 -0
  52. {pangea_sdk-5.5.0b2 → pangea_sdk-5.5.0b3}/pangea/services/vault/models/asymmetric.py +0 -0
  53. {pangea_sdk-5.5.0b2 → pangea_sdk-5.5.0b3}/pangea/services/vault/models/common.py +0 -0
  54. {pangea_sdk-5.5.0b2 → pangea_sdk-5.5.0b3}/pangea/services/vault/models/keys.py +0 -0
  55. {pangea_sdk-5.5.0b2 → pangea_sdk-5.5.0b3}/pangea/services/vault/models/secret.py +0 -0
  56. {pangea_sdk-5.5.0b2 → pangea_sdk-5.5.0b3}/pangea/services/vault/models/symmetric.py +0 -0
  57. {pangea_sdk-5.5.0b2 → pangea_sdk-5.5.0b3}/pangea/services/vault/vault.py +0 -0
  58. {pangea_sdk-5.5.0b2 → pangea_sdk-5.5.0b3}/pangea/tools.py +0 -0
  59. {pangea_sdk-5.5.0b2 → pangea_sdk-5.5.0b3}/pangea/utils.py +0 -0
  60. {pangea_sdk-5.5.0b2 → pangea_sdk-5.5.0b3}/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.0b2
3
+ Version: 5.5.0b3
4
4
  Summary: Pangea API SDK
5
5
  License: MIT
6
6
  Keywords: Pangea,SDK,Audit
@@ -11,11 +11,11 @@ Classifier: Topic :: Software Development
11
11
  Classifier: Topic :: Software Development :: Libraries
12
12
  Requires-Dist: aiohttp (>=3.11.11,<4.0.0)
13
13
  Requires-Dist: cryptography (>=43.0.3,<44.0.0)
14
- Requires-Dist: deprecated (>=1.2.15,<2.0.0)
15
- Requires-Dist: google-crc32c (>=1.5.0,<2.0.0)
16
- Requires-Dist: pydantic (>=2.10.5,<3.0.0)
14
+ Requires-Dist: deprecated (>=1.2.18,<2.0.0)
15
+ Requires-Dist: google-crc32c (>=1.6.0,<2.0.0)
16
+ Requires-Dist: pydantic (>=2.10.6,<3.0.0)
17
17
  Requires-Dist: python-dateutil (>=2.9.0.post0,<3.0.0)
18
- Requires-Dist: requests (>=2.31.0,<3.0.0)
18
+ Requires-Dist: requests (>=2.32.3,<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)
21
21
  Description-Content-Type: text/markdown
@@ -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.0b2
66
+ $ pip3 install pangea-sdk==5.5.0b3
67
67
  ```
68
68
 
69
69
  Via poetry:
70
70
 
71
71
  ```bash
72
- $ poetry add pangea-sdk==5.5.0b2
72
+ $ poetry add pangea-sdk==5.5.0b3
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.0b2
44
+ $ pip3 install pangea-sdk==5.5.0b3
45
45
  ```
46
46
 
47
47
  Via poetry:
48
48
 
49
49
  ```bash
50
- $ poetry add pangea-sdk==5.5.0b2
50
+ $ poetry add pangea-sdk==5.5.0b3
51
51
  ```
52
52
 
53
53
  ## Usage
@@ -1,4 +1,4 @@
1
- __version__ = "5.5.0beta2"
1
+ __version__ = "5.5.0beta3"
2
2
 
3
3
  from pangea.asyncio.request import PangeaRequestAsync
4
4
  from pangea.config import PangeaConfig
@@ -143,6 +143,9 @@ class AIGuardAsync(ServiceBaseAsync):
143
143
  are to be applied to the text, such as defang malicious URLs.
144
144
  debug: Setting this value to true will provide a detailed analysis
145
145
  of the text data
146
+
147
+ Examples:
148
+ response = await ai_guard.guard_text("text")
146
149
  """
147
150
 
148
151
  return await self.request.post(
@@ -52,7 +52,12 @@ class PromptGuardAsync(ServiceBaseAsync):
52
52
  super().__init__(token, config, logger_name, config_id)
53
53
 
54
54
  async def guard(
55
- self, messages: Iterable[Message], *, analyzers: Iterable[str] | None = None
55
+ self,
56
+ messages: Iterable[Message],
57
+ *,
58
+ analyzers: Iterable[str] | None = None,
59
+ classify: bool | None = None,
60
+ threshold: float | None = None,
56
61
  ) -> PangeaResponse[GuardResult]:
57
62
  """
58
63
  Guard (Beta)
@@ -64,8 +69,12 @@ class PromptGuardAsync(ServiceBaseAsync):
64
69
  OperationId: prompt_guard_post_v1beta_guard
65
70
 
66
71
  Args:
67
- messages: Messages.
68
- analyzers: Specific analyzers to be used in the call.
72
+ messages: Prompt content and role array in JSON format. The
73
+ `content` is the text that will be analyzed for redaction.
74
+ analyzers: Specific analyzers to be used in the call
75
+ classify: Boolean to enable classification of the content
76
+ threshold: Threshold for the confidence score to consider the prompt
77
+ as malicious
69
78
 
70
79
  Examples:
71
80
  from pangea.asyncio.services.prompt_guard import Message
@@ -73,4 +82,8 @@ class PromptGuardAsync(ServiceBaseAsync):
73
82
  response = await prompt_guard.guard([Message(role="user", content="hello world")])
74
83
  """
75
84
 
76
- return await self.request.post("v1beta/guard", GuardResult, data={"messages": messages, "analyzers": analyzers})
85
+ return await self.request.post(
86
+ "v1beta/guard",
87
+ GuardResult,
88
+ data={"messages": messages, "analyzers": analyzers, "classify": classify, "threshold": threshold},
89
+ )
@@ -34,7 +34,7 @@ class ShareAsync(ServiceBaseAsync):
34
34
 
35
35
  Examples:
36
36
  config = PangeaConfig(domain="aws.us.pangea.cloud")
37
- authz = ShareAsync(token="pangea_token", config=config)
37
+ share = ShareAsync(token="pangea_token", config=config)
38
38
  """
39
39
 
40
40
  super().__init__(token, config, logger_name, config_id=config_id)
@@ -51,7 +51,7 @@ class ShareAsync(ServiceBaseAsync):
51
51
  A PangeaResponse. Available response fields can be found in our [API documentation](https://pangea.cloud/docs/api/share).
52
52
 
53
53
  Examples:
54
- response = share.buckets()
54
+ response = await share.buckets()
55
55
  """
56
56
 
57
57
  return await self.request.post("v1/buckets", m.BucketsResult)
@@ -1,13 +1,11 @@
1
1
  from __future__ import annotations
2
2
 
3
- from typing import Any, Dict, Generic, List, Literal, Optional, TypeVar, overload
3
+ from typing import Any, Dict, Generic, List, 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
-
11
9
 
12
10
  class AnalyzerResponse(APIResponseModel):
13
11
  analyzer: str
@@ -15,7 +13,7 @@ class AnalyzerResponse(APIResponseModel):
15
13
 
16
14
 
17
15
  class PromptInjectionResult(APIResponseModel):
18
- action: _DetectorAction
16
+ action: str
19
17
  analyzer_responses: List[AnalyzerResponse]
20
18
  """Triggered prompt injection analyzers."""
21
19
 
@@ -23,7 +21,7 @@ class PromptInjectionResult(APIResponseModel):
23
21
  class PiiEntity(APIResponseModel):
24
22
  type: str
25
23
  value: str
26
- action: _DetectorAction
24
+ action: str
27
25
  start_pos: Optional[int] = None
28
26
 
29
27
 
@@ -34,7 +32,7 @@ class PiiEntityResult(APIResponseModel):
34
32
  class MaliciousEntity(APIResponseModel):
35
33
  type: str
36
34
  value: str
37
- action: _DetectorAction
35
+ action: str
38
36
  start_pos: Optional[int] = None
39
37
  raw: Optional[Dict[str, Any]] = None
40
38
 
@@ -46,7 +44,7 @@ class MaliciousEntityResult(APIResponseModel):
46
44
  class SecretsEntity(APIResponseModel):
47
45
  type: str
48
46
  value: str
49
- action: _DetectorAction
47
+ action: str
50
48
  start_pos: Optional[int] = None
51
49
  redacted_value: Optional[str] = None
52
50
 
@@ -57,12 +55,12 @@ class SecretsEntityResult(APIResponseModel):
57
55
 
58
56
  class LanguageDetectionResult(APIResponseModel):
59
57
  language: str
60
- action: _DetectorAction
58
+ action: str
61
59
 
62
60
 
63
61
  class CodeDetectionResult(APIResponseModel):
64
62
  language: str
65
- action: _DetectorAction
63
+ action: str
66
64
 
67
65
 
68
66
  _T = TypeVar("_T")
@@ -228,6 +226,9 @@ class AIGuard(ServiceBase):
228
226
  are to be applied to the text, such as defang malicious URLs.
229
227
  debug: Setting this value to true will provide a detailed analysis
230
228
  of the text data
229
+
230
+ Examples:
231
+ response = ai_guard.guard_text("text")
231
232
  """
232
233
 
233
234
  return self.request.post(
@@ -19,8 +19,8 @@ class Classification(APIResponseModel):
19
19
  category: str
20
20
  """Classification category"""
21
21
 
22
- label: str
23
- """Classification label"""
22
+ detected: bool
23
+ """Classification detection result"""
24
24
 
25
25
  confidence: float
26
26
  """Confidence score for the classification"""
@@ -86,7 +86,12 @@ class PromptGuard(ServiceBase):
86
86
  super().__init__(token, config, logger_name, config_id)
87
87
 
88
88
  def guard(
89
- self, messages: Iterable[Message], *, analyzers: Iterable[str] | None = None
89
+ self,
90
+ messages: Iterable[Message],
91
+ *,
92
+ analyzers: Iterable[str] | None = None,
93
+ classify: bool | None = None,
94
+ threshold: float | None = None,
90
95
  ) -> PangeaResponse[GuardResult]:
91
96
  """
92
97
  Guard (Beta)
@@ -98,8 +103,12 @@ class PromptGuard(ServiceBase):
98
103
  OperationId: prompt_guard_post_v1beta_guard
99
104
 
100
105
  Args:
101
- messages: Prompt content and role array.
102
- analyzers: Specific analyzers to be used in the call.
106
+ messages: Prompt content and role array in JSON format. The
107
+ `content` is the text that will be analyzed for redaction.
108
+ analyzers: Specific analyzers to be used in the call
109
+ classify: Boolean to enable classification of the content
110
+ threshold: Threshold for the confidence score to consider the prompt
111
+ as malicious
103
112
 
104
113
  Examples:
105
114
  from pangea.services.prompt_guard import Message
@@ -107,4 +116,8 @@ class PromptGuard(ServiceBase):
107
116
  response = prompt_guard.guard([Message(role="user", content="hello world")])
108
117
  """
109
118
 
110
- return self.request.post("v1beta/guard", GuardResult, data={"messages": messages, "analyzers": analyzers})
119
+ return self.request.post(
120
+ "v1beta/guard",
121
+ GuardResult,
122
+ data={"messages": messages, "analyzers": analyzers, "classify": classify, "threshold": threshold},
123
+ )
@@ -762,7 +762,7 @@ class Share(ServiceBase):
762
762
 
763
763
  Examples:
764
764
  config = PangeaConfig(domain="aws.us.pangea.cloud")
765
- authz = Share(token="pangea_token", config=config)
765
+ share = Share(token="pangea_token", config=config)
766
766
  """
767
767
 
768
768
  super().__init__(token, config, logger_name, config_id=config_id)
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "pangea-sdk"
3
- version = "5.5.0beta2"
3
+ version = "5.5.0beta3"
4
4
  description = "Pangea API SDK"
5
5
  authors = [
6
6
  {name = "Glenn Gallien", email = "glenn.gallien@pangea.cloud"}
@@ -18,11 +18,11 @@ requires-python = ">=3.9,<4.0.0"
18
18
  dependencies = [
19
19
  "aiohttp (>=3.11.11,<4.0.0)",
20
20
  "cryptography (>=43.0.3,<44.0.0)",
21
- "deprecated (>=1.2.15,<2.0.0)",
22
- "google-crc32c (>=1.5.0,<2.0.0)",
23
- "pydantic (>=2.10.5,<3.0.0)",
21
+ "deprecated (>=1.2.18,<2.0.0)",
22
+ "google-crc32c (>=1.6.0,<2.0.0)",
23
+ "pydantic (>=2.10.6,<3.0.0)",
24
24
  "python-dateutil (>=2.9.0.post0,<3.0.0)",
25
- "requests (>=2.31.0,<3.0.0)",
25
+ "requests (>=2.32.3,<3.0.0)",
26
26
  "requests-toolbelt (>=1.0.0,<2.0.0)",
27
27
  "typing-extensions (>=4.12.2,<5.0.0)"
28
28
  ]
@@ -33,9 +33,9 @@ packages = [
33
33
  ]
34
34
 
35
35
  [tool.poetry.group.dev.dependencies]
36
- black = "^24.10.0"
36
+ black = "^25.1.0"
37
37
  docstring-parser = "^0.15"
38
- isort = "^5.13.2"
38
+ isort = "^6.0.0"
39
39
  mypy = "1.14.1"
40
40
  types-Deprecated = "^1.2.9.3"
41
41
  types-python-dateutil = "^2.8.19.14"