sentisec-sdk 0.1.0a0__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.
- sentisec_sdk-0.1.0a0/.gitignore +17 -0
- sentisec_sdk-0.1.0a0/LICENSE +196 -0
- sentisec_sdk-0.1.0a0/PKG-INFO +89 -0
- sentisec_sdk-0.1.0a0/README.md +53 -0
- sentisec_sdk-0.1.0a0/pyproject.toml +91 -0
- sentisec_sdk-0.1.0a0/src/sentisec_sdk/__init__.py +48 -0
- sentisec_sdk-0.1.0a0/src/sentisec_sdk/cli/__init__.py +374 -0
- sentisec_sdk-0.1.0a0/src/sentisec_sdk/cli/_scenarios.py +242 -0
- sentisec_sdk-0.1.0a0/src/sentisec_sdk/cli/demo.py +511 -0
- sentisec_sdk-0.1.0a0/src/sentisec_sdk/credentials.py +313 -0
- sentisec_sdk-0.1.0a0/src/sentisec_sdk/login.py +680 -0
- sentisec_sdk-0.1.0a0/src/sentisec_sdk/monitor.py +130 -0
- sentisec_sdk-0.1.0a0/src/sentisec_sdk/py.typed +0 -0
- sentisec_sdk-0.1.0a0/src/sentisec_sdk/session.py +63 -0
- sentisec_sdk-0.1.0a0/src/sentisec_sdk/wrappers/__init__.py +27 -0
- sentisec_sdk-0.1.0a0/src/sentisec_sdk/wrappers/anthropic.py +75 -0
- sentisec_sdk-0.1.0a0/src/sentisec_sdk/wrappers/openai.py +93 -0
|
@@ -0,0 +1,196 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
+
the copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
+
other entities that control, are controlled by, or are under common
|
|
17
|
+
control with that entity. For the purposes of this definition,
|
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
+
direction or management of such entity, whether by contract or
|
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
+
exercising permissions granted by this License.
|
|
25
|
+
|
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
+
including but not limited to software source code, documentation
|
|
28
|
+
source, and configuration files.
|
|
29
|
+
|
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
|
31
|
+
transformation or translation of a Source form, including but
|
|
32
|
+
not limited to compiled object code, generated documentation,
|
|
33
|
+
and conversions to other media types.
|
|
34
|
+
|
|
35
|
+
"Work" shall mean the work of authorship made available under
|
|
36
|
+
the License, as indicated by a copyright notice that is included in
|
|
37
|
+
or attached to the work (an example is provided in the Appendix below).
|
|
38
|
+
|
|
39
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
40
|
+
form, that is based on (or derived from) the Work and for which the
|
|
41
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
42
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
43
|
+
of this License, Derivative Works shall not include works that remain
|
|
44
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
45
|
+
the Work and Derivative Works thereof.
|
|
46
|
+
|
|
47
|
+
"Contribution" shall mean, as submitted to the Licensor for inclusion
|
|
48
|
+
in the Work by the copyright owner or by an individual or Legal Entity
|
|
49
|
+
authorized to submit on behalf of the copyright owner. For the purposes
|
|
50
|
+
of this definition, "submitted" means any form of electronic, verbal,
|
|
51
|
+
or written communication sent to the Licensor or its representatives,
|
|
52
|
+
including but not limited to communication on electronic mailing lists,
|
|
53
|
+
source code control systems, and issue tracking systems that are managed
|
|
54
|
+
by, or on behalf of, the Licensor for the purpose of discussing and
|
|
55
|
+
improving the Work, but excluding communication that is conspicuously
|
|
56
|
+
marked or designated in writing by the copyright owner as "Not a
|
|
57
|
+
Contribution."
|
|
58
|
+
|
|
59
|
+
"Contributor" shall mean Licensor and any Legal Entity on behalf of
|
|
60
|
+
whom a Contribution has been received by the Licensor and included
|
|
61
|
+
within the Work.
|
|
62
|
+
|
|
63
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
64
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
65
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
66
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
67
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
68
|
+
Work and such Derivative Works in Source or Object form.
|
|
69
|
+
|
|
70
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
71
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
72
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
73
|
+
(except as stated in this section) patent license to make, have made,
|
|
74
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
75
|
+
where such license applies only to those patent claims licensable
|
|
76
|
+
by such Contributor that are necessarily infringed by their
|
|
77
|
+
Contribution(s) alone or by the combination of their Contribution(s)
|
|
78
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
79
|
+
institute patent litigation against any entity (including a cross-claim
|
|
80
|
+
or counterclaim in a lawsuit) alleging that the Work or any
|
|
81
|
+
Contribution embodied within the Work constitutes direct or
|
|
82
|
+
contributory patent infringement, then any patent licenses granted to
|
|
83
|
+
You under this License for that Work shall terminate as of the date
|
|
84
|
+
such litigation is filed.
|
|
85
|
+
|
|
86
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
87
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
88
|
+
modifications, and in Source or Object form, provided that You
|
|
89
|
+
meet the following conditions:
|
|
90
|
+
|
|
91
|
+
(a) You must give any other recipients of the Work or Derivative
|
|
92
|
+
Works a copy of this License; and
|
|
93
|
+
|
|
94
|
+
(b) You must cause any modified files to carry prominent notices
|
|
95
|
+
stating that You changed the files; and
|
|
96
|
+
|
|
97
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
98
|
+
that You distribute, all copyright, patent, trademark, and
|
|
99
|
+
attribution notices from the Source form of the Work,
|
|
100
|
+
excluding those notices that do not pertain to any part of
|
|
101
|
+
the Derivative Works; and
|
|
102
|
+
|
|
103
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
104
|
+
distribution, You must include a readable copy of the
|
|
105
|
+
attribution notices contained within such NOTICE file, in
|
|
106
|
+
at least one of the following places: within a NOTICE text
|
|
107
|
+
file distributed as part of the Derivative Works; within
|
|
108
|
+
the Source form or documentation, if provided along with the
|
|
109
|
+
Derivative Works; or, within a display generated by the
|
|
110
|
+
Derivative Works, if and wherever such third-party notices
|
|
111
|
+
normally appear. The contents of the NOTICE file are for
|
|
112
|
+
informational purposes only and do not modify the License.
|
|
113
|
+
You may add Your own attribution notices within Derivative
|
|
114
|
+
Works that You distribute, alongside or as an addendum to
|
|
115
|
+
the NOTICE text from the Work, provided that such additional
|
|
116
|
+
attribution notices cannot be construed as modifying the
|
|
117
|
+
License.
|
|
118
|
+
|
|
119
|
+
You may add Your own license statement for Your modifications and
|
|
120
|
+
may provide additional grant of rights to use, copy, modify, merge,
|
|
121
|
+
publish, distribute, sublicense, and/or sell copies of the
|
|
122
|
+
Contribution, either on an unrestricted basis or subject only to
|
|
123
|
+
certain additional terms described in writing by the copyright owner
|
|
124
|
+
as described in Sections 4(b) and 4(d).
|
|
125
|
+
|
|
126
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
127
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
128
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
129
|
+
this License, without any additional terms or conditions.
|
|
130
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
131
|
+
the terms of any separate license agreement you may have executed
|
|
132
|
+
with Licensor regarding such Contributions.
|
|
133
|
+
|
|
134
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
135
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
136
|
+
except as required for reasonable and customary use in describing the
|
|
137
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
138
|
+
|
|
139
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
140
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
141
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
142
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
143
|
+
implied, including, without limitation, any warranties or conditions
|
|
144
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
145
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
146
|
+
appropriateness of using or reproducing the Work and assume any
|
|
147
|
+
risks associated with Your exercise of permissions under this License.
|
|
148
|
+
|
|
149
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
150
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
151
|
+
unless required by applicable law (such as deliberate and grossly
|
|
152
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
153
|
+
liable to You for damages, including any direct, indirect, special,
|
|
154
|
+
incidental, or exemplary damages of any character arising as a
|
|
155
|
+
result of this License or out of the use or inability to use the
|
|
156
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
157
|
+
work stoppage, computer failure or malfunction, or all other
|
|
158
|
+
commercial damages or losses), even if such Contributor has been
|
|
159
|
+
advised of the possibility of such damages.
|
|
160
|
+
|
|
161
|
+
9. Accepting Warranty or Liability. While redistributing the Work or
|
|
162
|
+
Derivative Works thereof, You may choose to offer, and charge a fee
|
|
163
|
+
for, acceptance of support, warranty, indemnity, or other liability
|
|
164
|
+
obligations and/or rights consistent with this License. However, in
|
|
165
|
+
accepting such obligations, You may offer such conditions only on
|
|
166
|
+
Your own behalf and on Your sole responsibility, not on behalf of
|
|
167
|
+
any other Contributor, and only if You agree to indemnify, defend,
|
|
168
|
+
and hold each Contributor harmless for any liability incurred by,
|
|
169
|
+
or claims asserted against, such Contributor by reason of your
|
|
170
|
+
accepting any warranty or additional liability.
|
|
171
|
+
|
|
172
|
+
END OF TERMS AND CONDITIONS
|
|
173
|
+
|
|
174
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
175
|
+
|
|
176
|
+
To apply the Apache License to your work, attach the following
|
|
177
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
178
|
+
replaced with your own identifying information. (Don't include
|
|
179
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
180
|
+
comment syntax for the syntax of the file format. Please also
|
|
181
|
+
include the word "NOTICE" in any file that you include in the
|
|
182
|
+
distribution alongside this License.
|
|
183
|
+
|
|
184
|
+
Copyright 2026 Sentisec
|
|
185
|
+
|
|
186
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
187
|
+
you may not use this file except in compliance with the License.
|
|
188
|
+
You may obtain a copy of the License at
|
|
189
|
+
|
|
190
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
191
|
+
|
|
192
|
+
Unless required by applicable law or agreed to in writing, software
|
|
193
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
194
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
195
|
+
See the License for the specific language governing permissions and
|
|
196
|
+
limitations under the License.
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: sentisec-sdk
|
|
3
|
+
Version: 0.1.0a0
|
|
4
|
+
Summary: Sentisec public SDK — cognitive integrity monitoring for autonomous agents (thin client).
|
|
5
|
+
Project-URL: Homepage, https://sentisec.ch
|
|
6
|
+
Project-URL: Documentation, https://docs.sentisec.ch
|
|
7
|
+
Project-URL: Support, https://sentisec.ch
|
|
8
|
+
Author-email: Sentisec <hello@sentisec.ch>
|
|
9
|
+
License-Expression: Apache-2.0
|
|
10
|
+
License-File: LICENSE
|
|
11
|
+
Keywords: agent-monitoring,ai-safety,anthropic,llm,openai,sentisec
|
|
12
|
+
Classifier: Development Status :: 3 - Alpha
|
|
13
|
+
Classifier: Intended Audience :: Developers
|
|
14
|
+
Classifier: License :: OSI Approved :: Apache Software License
|
|
15
|
+
Classifier: Operating System :: OS Independent
|
|
16
|
+
Classifier: Programming Language :: Python :: 3
|
|
17
|
+
Classifier: Programming Language :: Python :: 3 :: Only
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
21
|
+
Classifier: Topic :: Security
|
|
22
|
+
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
23
|
+
Requires-Python: >=3.11
|
|
24
|
+
Requires-Dist: httpx>=0.27
|
|
25
|
+
Requires-Dist: pydantic>=2.9
|
|
26
|
+
Provides-Extra: anthropic
|
|
27
|
+
Requires-Dist: anthropic>=0.40.0; extra == 'anthropic'
|
|
28
|
+
Provides-Extra: dev
|
|
29
|
+
Requires-Dist: build>=1.2; extra == 'dev'
|
|
30
|
+
Requires-Dist: mypy>=1.10; extra == 'dev'
|
|
31
|
+
Requires-Dist: pytest>=8.0; extra == 'dev'
|
|
32
|
+
Requires-Dist: ruff>=0.6; extra == 'dev'
|
|
33
|
+
Provides-Extra: openai
|
|
34
|
+
Requires-Dist: openai>=1.54.0; extra == 'openai'
|
|
35
|
+
Description-Content-Type: text/markdown
|
|
36
|
+
|
|
37
|
+
# sentisec-sdk
|
|
38
|
+
|
|
39
|
+
Public Python SDK for [Sentisec](https://sentisec.ch).
|
|
40
|
+
|
|
41
|
+
`sentisec-sdk` is a thin client. You install it with `pip`, point it at
|
|
42
|
+
your workspace, and wrap your existing OpenAI / Anthropic client. Your
|
|
43
|
+
agent's tool calls then flow through Sentisec's hosted control plane,
|
|
44
|
+
where they are evaluated and either allowed, rewritten, or blocked
|
|
45
|
+
before they reach the world.
|
|
46
|
+
|
|
47
|
+
## Install
|
|
48
|
+
|
|
49
|
+
```sh
|
|
50
|
+
pip install sentisec-sdk
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
Python 3.11+ is required.
|
|
54
|
+
|
|
55
|
+
## Quick start
|
|
56
|
+
|
|
57
|
+
```python
|
|
58
|
+
from sentisec_sdk import Monitor
|
|
59
|
+
|
|
60
|
+
monitor = Monitor() # picks up ~/.sentisec/credentials.toml after `sentisec login`
|
|
61
|
+
client = monitor.wrap_openai(...)
|
|
62
|
+
client = monitor.wrap_anthropic(...)
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
The `sentisec` CLI is shipped in the same wheel:
|
|
66
|
+
|
|
67
|
+
```sh
|
|
68
|
+
sentisec login
|
|
69
|
+
sentisec status
|
|
70
|
+
sentisec demo run
|
|
71
|
+
sentisec logout
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
> Note (alpha): the public surface is being assembled across a small
|
|
75
|
+
> set of release tasks. Calling `Monitor()` / `Session()` in this
|
|
76
|
+
> alpha pre-release raises `NotImplementedError` pointing at the
|
|
77
|
+
> tracking task — install the `0.1.0` (non-alpha) release for the
|
|
78
|
+
> working client.
|
|
79
|
+
|
|
80
|
+
## Documentation
|
|
81
|
+
|
|
82
|
+
- Product overview: <https://sentisec.ch>
|
|
83
|
+
- Developer docs: <https://docs.sentisec.ch>
|
|
84
|
+
- Dashboard: <https://app.sentisec.ch>
|
|
85
|
+
- Support: <mailto:support@sentisec.ch>
|
|
86
|
+
|
|
87
|
+
## License
|
|
88
|
+
|
|
89
|
+
Apache License 2.0. See [LICENSE](./LICENSE).
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
# sentisec-sdk
|
|
2
|
+
|
|
3
|
+
Public Python SDK for [Sentisec](https://sentisec.ch).
|
|
4
|
+
|
|
5
|
+
`sentisec-sdk` is a thin client. You install it with `pip`, point it at
|
|
6
|
+
your workspace, and wrap your existing OpenAI / Anthropic client. Your
|
|
7
|
+
agent's tool calls then flow through Sentisec's hosted control plane,
|
|
8
|
+
where they are evaluated and either allowed, rewritten, or blocked
|
|
9
|
+
before they reach the world.
|
|
10
|
+
|
|
11
|
+
## Install
|
|
12
|
+
|
|
13
|
+
```sh
|
|
14
|
+
pip install sentisec-sdk
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
Python 3.11+ is required.
|
|
18
|
+
|
|
19
|
+
## Quick start
|
|
20
|
+
|
|
21
|
+
```python
|
|
22
|
+
from sentisec_sdk import Monitor
|
|
23
|
+
|
|
24
|
+
monitor = Monitor() # picks up ~/.sentisec/credentials.toml after `sentisec login`
|
|
25
|
+
client = monitor.wrap_openai(...)
|
|
26
|
+
client = monitor.wrap_anthropic(...)
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
The `sentisec` CLI is shipped in the same wheel:
|
|
30
|
+
|
|
31
|
+
```sh
|
|
32
|
+
sentisec login
|
|
33
|
+
sentisec status
|
|
34
|
+
sentisec demo run
|
|
35
|
+
sentisec logout
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
> Note (alpha): the public surface is being assembled across a small
|
|
39
|
+
> set of release tasks. Calling `Monitor()` / `Session()` in this
|
|
40
|
+
> alpha pre-release raises `NotImplementedError` pointing at the
|
|
41
|
+
> tracking task — install the `0.1.0` (non-alpha) release for the
|
|
42
|
+
> working client.
|
|
43
|
+
|
|
44
|
+
## Documentation
|
|
45
|
+
|
|
46
|
+
- Product overview: <https://sentisec.ch>
|
|
47
|
+
- Developer docs: <https://docs.sentisec.ch>
|
|
48
|
+
- Dashboard: <https://app.sentisec.ch>
|
|
49
|
+
- Support: <mailto:support@sentisec.ch>
|
|
50
|
+
|
|
51
|
+
## License
|
|
52
|
+
|
|
53
|
+
Apache License 2.0. See [LICENSE](./LICENSE).
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["hatchling>=1.18"]
|
|
3
|
+
build-backend = "hatchling.build"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "sentisec-sdk"
|
|
7
|
+
version = "0.1.0a0"
|
|
8
|
+
description = "Sentisec public SDK — cognitive integrity monitoring for autonomous agents (thin client)."
|
|
9
|
+
readme = "README.md"
|
|
10
|
+
requires-python = ">=3.11"
|
|
11
|
+
license = "Apache-2.0"
|
|
12
|
+
license-files = ["LICENSE"]
|
|
13
|
+
authors = [
|
|
14
|
+
{ name = "Sentisec", email = "hello@sentisec.ch" }
|
|
15
|
+
]
|
|
16
|
+
keywords = [
|
|
17
|
+
"sentisec",
|
|
18
|
+
"ai-safety",
|
|
19
|
+
"llm",
|
|
20
|
+
"agent-monitoring",
|
|
21
|
+
"openai",
|
|
22
|
+
"anthropic",
|
|
23
|
+
]
|
|
24
|
+
classifiers = [
|
|
25
|
+
"Development Status :: 3 - Alpha",
|
|
26
|
+
"Intended Audience :: Developers",
|
|
27
|
+
"License :: OSI Approved :: Apache Software License",
|
|
28
|
+
"Operating System :: OS Independent",
|
|
29
|
+
"Programming Language :: Python :: 3",
|
|
30
|
+
"Programming Language :: Python :: 3 :: Only",
|
|
31
|
+
"Programming Language :: Python :: 3.11",
|
|
32
|
+
"Programming Language :: Python :: 3.12",
|
|
33
|
+
"Programming Language :: Python :: 3.13",
|
|
34
|
+
"Topic :: Security",
|
|
35
|
+
"Topic :: Software Development :: Libraries :: Python Modules",
|
|
36
|
+
]
|
|
37
|
+
dependencies = [
|
|
38
|
+
"httpx>=0.27",
|
|
39
|
+
"pydantic>=2.9",
|
|
40
|
+
]
|
|
41
|
+
|
|
42
|
+
[project.optional-dependencies]
|
|
43
|
+
openai = ["openai>=1.54.0"]
|
|
44
|
+
anthropic = ["anthropic>=0.40.0"]
|
|
45
|
+
dev = [
|
|
46
|
+
"build>=1.2",
|
|
47
|
+
"pytest>=8.0",
|
|
48
|
+
"ruff>=0.6",
|
|
49
|
+
"mypy>=1.10",
|
|
50
|
+
]
|
|
51
|
+
|
|
52
|
+
[project.urls]
|
|
53
|
+
Homepage = "https://sentisec.ch"
|
|
54
|
+
Documentation = "https://docs.sentisec.ch"
|
|
55
|
+
Support = "https://sentisec.ch"
|
|
56
|
+
|
|
57
|
+
# The Hatch build backend reads ``[project.scripts]`` and writes a
|
|
58
|
+
# ``sentisec`` console-script wrapper into the wheel's ``Scripts`` /
|
|
59
|
+
# ``bin`` directory.
|
|
60
|
+
[project.scripts]
|
|
61
|
+
sentisec = "sentisec_sdk.cli:main"
|
|
62
|
+
|
|
63
|
+
[tool.hatch.build.targets.wheel]
|
|
64
|
+
packages = ["src/sentisec_sdk"]
|
|
65
|
+
|
|
66
|
+
[tool.hatch.build.targets.sdist]
|
|
67
|
+
# Restrict locally-built sdists to the same allowlisted tree as the wheel so
|
|
68
|
+
# accidental `python -m build --sdist` invocations cannot leak repo internals.
|
|
69
|
+
include = [
|
|
70
|
+
"src/sentisec_sdk",
|
|
71
|
+
"README.md",
|
|
72
|
+
"LICENSE",
|
|
73
|
+
"pyproject.toml",
|
|
74
|
+
]
|
|
75
|
+
|
|
76
|
+
[tool.ruff]
|
|
77
|
+
line-length = 100
|
|
78
|
+
target-version = "py311"
|
|
79
|
+
|
|
80
|
+
[tool.mypy]
|
|
81
|
+
python_version = "3.11"
|
|
82
|
+
strict = true
|
|
83
|
+
files = ["src/sentisec_sdk"]
|
|
84
|
+
|
|
85
|
+
[tool.pytest.ini_options]
|
|
86
|
+
# Tests live in ``tests/`` and import from ``src/sentisec_sdk`` without
|
|
87
|
+
# installing the package. ``src`` is prepended to ``sys.path`` via pythonpath
|
|
88
|
+
# so ``from sentisec_sdk.credentials import ...`` resolves.
|
|
89
|
+
pythonpath = ["src"]
|
|
90
|
+
testpaths = ["tests"]
|
|
91
|
+
addopts = "-q"
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
"""Sentisec public Python SDK — thin client.
|
|
2
|
+
|
|
3
|
+
This package is the public distribution surface published to PyPI as
|
|
4
|
+
``sentisec-sdk``. It ships only the client-side primitives an end-user
|
|
5
|
+
agent loop needs: a transport, a credentials loader, ``login`` /
|
|
6
|
+
``logout`` helpers, ``Monitor`` / ``Session`` types, and ``wrap_openai``
|
|
7
|
+
/ ``wrap_anthropic`` adapters that route subsequent client calls through
|
|
8
|
+
the Sentisec control plane.
|
|
9
|
+
|
|
10
|
+
The control-plane computation itself runs server-side and is not part
|
|
11
|
+
of this wheel. See https://docs.sentisec.ch for the public reference.
|
|
12
|
+
|
|
13
|
+
Public surface
|
|
14
|
+
--------------
|
|
15
|
+
|
|
16
|
+
::
|
|
17
|
+
|
|
18
|
+
from sentisec_sdk import (
|
|
19
|
+
Monitor,
|
|
20
|
+
Session,
|
|
21
|
+
wrap_openai,
|
|
22
|
+
wrap_anthropic,
|
|
23
|
+
__version__,
|
|
24
|
+
)
|
|
25
|
+
|
|
26
|
+
Importing the public names always succeeds. The ``Monitor`` constructor
|
|
27
|
+
resolves credentials lazily and raises a clear error when none are
|
|
28
|
+
present, naming ``sentisec login`` as the recovery path.
|
|
29
|
+
"""
|
|
30
|
+
|
|
31
|
+
from __future__ import annotations
|
|
32
|
+
|
|
33
|
+
from .monitor import Monitor
|
|
34
|
+
from .session import Session
|
|
35
|
+
from .wrappers import wrap_anthropic, wrap_openai
|
|
36
|
+
|
|
37
|
+
__all__ = [
|
|
38
|
+
"Monitor",
|
|
39
|
+
"Session",
|
|
40
|
+
"__version__",
|
|
41
|
+
"wrap_anthropic",
|
|
42
|
+
"wrap_openai",
|
|
43
|
+
]
|
|
44
|
+
|
|
45
|
+
# Keep this in lockstep with ``[project].version`` in ``pyproject.toml``.
|
|
46
|
+
# Bumped on every public release; the publish workflow verifies the
|
|
47
|
+
# tag, the wheel metadata, and this constant agree.
|
|
48
|
+
__version__: str = "0.1.0a0"
|