tappass 0.6.0__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.
- tappass-0.6.0/.gitignore +14 -0
- tappass-0.6.0/LICENSE +17 -0
- tappass-0.6.0/PKG-INFO +161 -0
- tappass-0.6.0/README.md +102 -0
- tappass-0.6.0/pyproject.toml +91 -0
- tappass-0.6.0/tappass/__init__.py +127 -0
- tappass-0.6.0/tappass/_async_http.py +192 -0
- tappass-0.6.0/tappass/_cli.py +268 -0
- tappass-0.6.0/tappass/_govern_call.py +181 -0
- tappass-0.6.0/tappass/_retry.py +58 -0
- tappass-0.6.0/tappass/_sync_bridge.py +78 -0
- tappass-0.6.0/tappass/admin.py +86 -0
- tappass-0.6.0/tappass/anthropic.py +255 -0
- tappass-0.6.0/tappass/approval.py +590 -0
- tappass-0.6.0/tappass/capability_token.py +642 -0
- tappass-0.6.0/tappass/client.py +167 -0
- tappass-0.6.0/tappass/constraints.py +927 -0
- tappass-0.6.0/tappass/errors.py +187 -0
- tappass-0.6.0/tappass/govern.py +360 -0
- tappass-0.6.0/tappass/guard.py +511 -0
- tappass-0.6.0/tappass/integrations/__init__.py +60 -0
- tappass-0.6.0/tappass/integrations/a2a.py +190 -0
- tappass-0.6.0/tappass/integrations/claude_code.py +210 -0
- tappass-0.6.0/tappass/integrations/crewai.py +263 -0
- tappass-0.6.0/tappass/integrations/fastapi.py +456 -0
- tappass-0.6.0/tappass/integrations/fastapi_mandate.py +441 -0
- tappass-0.6.0/tappass/integrations/google_adk.py +496 -0
- tappass-0.6.0/tappass/integrations/langchain.py +523 -0
- tappass-0.6.0/tappass/integrations/langgraph.py +328 -0
- tappass-0.6.0/tappass/integrations/mcp.py +339 -0
- tappass-0.6.0/tappass/integrations/mcp_server.py +504 -0
- tappass-0.6.0/tappass/integrations/openai.py +601 -0
- tappass-0.6.0/tappass/integrations/temporal.py +415 -0
- tappass-0.6.0/tappass/openai.py +301 -0
- tappass-0.6.0/tappass/py.typed +0 -0
- tappass-0.6.0/tappass/reporter.py +159 -0
- tappass-0.6.0/tappass/resilience.py +617 -0
- tappass-0.6.0/tappass/sandbox.py +230 -0
- tappass-0.6.0/tappass/session.py +159 -0
- tappass-0.6.0/tappass/signing.py +243 -0
- tappass-0.6.0/tappass/sor.py +193 -0
- tappass-0.6.0/tappass/testing.py +342 -0
- tappass-0.6.0/tappass/types.py +430 -0
tappass-0.6.0/.gitignore
ADDED
tappass-0.6.0/LICENSE
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
Copyright 2026 Cogniqor BV
|
|
6
|
+
|
|
7
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
8
|
+
you may not use this file except in compliance with the License.
|
|
9
|
+
You may obtain a copy of the License at
|
|
10
|
+
|
|
11
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
12
|
+
|
|
13
|
+
Unless required by applicable law or agreed to in writing, software
|
|
14
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
15
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
16
|
+
See the License for the specific language governing permissions and
|
|
17
|
+
limitations under the License.
|
tappass-0.6.0/PKG-INFO
ADDED
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: tappass
|
|
3
|
+
Version: 0.6.0
|
|
4
|
+
Summary: TapPass SDK — Zero Trust AI Agent Platform. Cryptographic capability tokens, governance pipeline, agent trust scoring.
|
|
5
|
+
Project-URL: Homepage, https://tappass.ai
|
|
6
|
+
Project-URL: Documentation, https://docs.tappass.ai
|
|
7
|
+
Project-URL: Repository, https://github.com/tappass/tappass-sdk
|
|
8
|
+
Project-URL: Changelog, https://github.com/tappass/tappass-sdk/blob/main/CHANGELOG.md
|
|
9
|
+
Project-URL: Issues, https://github.com/tappass/tappass-sdk/issues
|
|
10
|
+
Author-email: Jens Bontinck <jens@tappass.ai>
|
|
11
|
+
License: Apache-2.0
|
|
12
|
+
License-File: LICENSE
|
|
13
|
+
Keywords: ai-agents,audit,capability-tokens,crewai,eu-ai-act,gdpr,governance,langchain,llm,openai,pii-detection,prompt-injection,security
|
|
14
|
+
Classifier: Development Status :: 4 - Beta
|
|
15
|
+
Classifier: Intended Audience :: Developers
|
|
16
|
+
Classifier: License :: OSI Approved :: Apache Software License
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
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
|
+
Classifier: Typing :: Typed
|
|
24
|
+
Requires-Python: >=3.11
|
|
25
|
+
Requires-Dist: cryptography>=41.0
|
|
26
|
+
Requires-Dist: httpx>=0.25
|
|
27
|
+
Provides-Extra: all
|
|
28
|
+
Requires-Dist: crewai>=0.50; extra == 'all'
|
|
29
|
+
Requires-Dist: fastapi>=0.100; extra == 'all'
|
|
30
|
+
Requires-Dist: langchain-core>=0.2; extra == 'all'
|
|
31
|
+
Requires-Dist: nono-py>=0.1.0; extra == 'all'
|
|
32
|
+
Requires-Dist: openai>=1.0; extra == 'all'
|
|
33
|
+
Requires-Dist: temporalio>=1.5; extra == 'all'
|
|
34
|
+
Provides-Extra: crewai
|
|
35
|
+
Requires-Dist: crewai>=0.50; extra == 'crewai'
|
|
36
|
+
Provides-Extra: dev
|
|
37
|
+
Requires-Dist: anthropic>=0.40; extra == 'dev'
|
|
38
|
+
Requires-Dist: fastapi>=0.100; extra == 'dev'
|
|
39
|
+
Requires-Dist: mypy>=1.10; extra == 'dev'
|
|
40
|
+
Requires-Dist: openai>=1.0; extra == 'dev'
|
|
41
|
+
Requires-Dist: pyjwt>=2.10; extra == 'dev'
|
|
42
|
+
Requires-Dist: pytest-asyncio>=0.23; extra == 'dev'
|
|
43
|
+
Requires-Dist: pytest>=8.0; extra == 'dev'
|
|
44
|
+
Requires-Dist: respx>=0.21; extra == 'dev'
|
|
45
|
+
Provides-Extra: fastapi
|
|
46
|
+
Requires-Dist: fastapi>=0.100; extra == 'fastapi'
|
|
47
|
+
Requires-Dist: starlette>=0.27; extra == 'fastapi'
|
|
48
|
+
Provides-Extra: google-adk
|
|
49
|
+
Requires-Dist: google-adk>=0.1; extra == 'google-adk'
|
|
50
|
+
Provides-Extra: langchain
|
|
51
|
+
Requires-Dist: langchain-core>=0.2; extra == 'langchain'
|
|
52
|
+
Provides-Extra: openai
|
|
53
|
+
Requires-Dist: openai>=1.0; extra == 'openai'
|
|
54
|
+
Provides-Extra: sandbox
|
|
55
|
+
Requires-Dist: nono-py>=0.1.0; extra == 'sandbox'
|
|
56
|
+
Provides-Extra: temporal
|
|
57
|
+
Requires-Dist: temporalio>=1.5; extra == 'temporal'
|
|
58
|
+
Description-Content-Type: text/markdown
|
|
59
|
+
|
|
60
|
+
# tappass — Zero Trust Control Plane for Agentic AI (Python SDK)
|
|
61
|
+
|
|
62
|
+
Runtime governance for your LLM, agent, and tool calls. Embed in your code, get a typed audit trail, surface governance decisions as Python exceptions.
|
|
63
|
+
|
|
64
|
+
**What this SDK is for:**
|
|
65
|
+
- Governing LLM calls, agent runs, and tool executions at runtime.
|
|
66
|
+
- Emitting structured audit events with correlation IDs.
|
|
67
|
+
- Handling governance decisions (block, redact, approve, trust-tier, break-glass) as typed exceptions in your code.
|
|
68
|
+
|
|
69
|
+
**What this SDK is NOT for:**
|
|
70
|
+
- Policy CRUD, compliance report generation, Verified credential issuance, retention config, break-glass invocation, tool-integrity approval. Those live in the [TapPass dashboard](https://app.tappass.ai) — not in your agent code.
|
|
71
|
+
|
|
72
|
+
## Requirements
|
|
73
|
+
|
|
74
|
+
- Python ≥ 3.11.
|
|
75
|
+
- `tappass` server ≥ 0.6.0. (The SDK rejects older servers at construction time.)
|
|
76
|
+
|
|
77
|
+
## Install
|
|
78
|
+
|
|
79
|
+
pip install tappass
|
|
80
|
+
|
|
81
|
+
## Quickstart — a governed chat call
|
|
82
|
+
|
|
83
|
+
from tappass import Agent
|
|
84
|
+
|
|
85
|
+
agent = Agent("https://tappass.example.com", api_key="tp_...")
|
|
86
|
+
r = agent.chat("Summarize Q4 revenue")
|
|
87
|
+
print(r.content)
|
|
88
|
+
print(r.session_id, r.audit_url) # correlation IDs, deep link to dashboard
|
|
89
|
+
|
|
90
|
+
## Quickstart — govern a CrewAI run
|
|
91
|
+
|
|
92
|
+
from crewai import Agent, Task, Crew
|
|
93
|
+
from tappass.integrations.crewai import guard_crew
|
|
94
|
+
|
|
95
|
+
crew = Crew(agents=[...], tasks=[...])
|
|
96
|
+
|
|
97
|
+
with guard_crew(crew, tappass_url="https://tappass.example.com", api_key="tp_...") as session:
|
|
98
|
+
result = session.kickoff()
|
|
99
|
+
print(session.id, session.audit_url)
|
|
100
|
+
|
|
101
|
+
## Decisions are typed exceptions
|
|
102
|
+
|
|
103
|
+
from tappass import GovernanceDecision, PolicyBlockError, ApprovalRequired
|
|
104
|
+
|
|
105
|
+
try:
|
|
106
|
+
r = agent.chat("Show me all customer SSNs")
|
|
107
|
+
except PolicyBlockError as e:
|
|
108
|
+
print(f"Blocked by {e.blocked_by}: {e.reason}. See {e.audit_url}")
|
|
109
|
+
except ApprovalRequired as e:
|
|
110
|
+
print(f"Awaiting approval: {e.approval_url}")
|
|
111
|
+
except GovernanceDecision as e:
|
|
112
|
+
print(f"Governance decision: {e}")
|
|
113
|
+
|
|
114
|
+
## What's new in 0.6
|
|
115
|
+
|
|
116
|
+
See `CHANGELOG.md`. Breaking changes — no back-compat with 0.5.x. See the [migration guide](https://docs.tappass.ai/sdk/migration-0.6/).
|
|
117
|
+
|
|
118
|
+
## Publishing a release
|
|
119
|
+
|
|
120
|
+
Releases ship to PyPI via GitHub Actions using OIDC Trusted Publishing — no long-lived API token is stored anywhere. The workflow is `.github/workflows/release.yml`.
|
|
121
|
+
|
|
122
|
+
### One-time PyPI configuration
|
|
123
|
+
|
|
124
|
+
Only needed once per project (or whenever the workflow name / environment changes):
|
|
125
|
+
|
|
126
|
+
1. Log in to <https://pypi.org/manage/account/publishing/>.
|
|
127
|
+
2. Under **Add a new pending publisher** (if the project isn't on PyPI yet) or the existing project's **Publishing** tab, add a GitHub publisher with:
|
|
128
|
+
- **PyPI Project Name:** `tappass`
|
|
129
|
+
- **Owner:** `tappass`
|
|
130
|
+
- **Repository name:** `tappass-sdk`
|
|
131
|
+
- **Workflow name:** `release.yml`
|
|
132
|
+
- **Environment name:** `pypi`
|
|
133
|
+
3. In the GitHub repo, go to **Settings → Environments** and create an environment named `pypi`. Optionally add a required-reviewers protection rule so a human approves each release.
|
|
134
|
+
|
|
135
|
+
That's it — no secrets, no tokens.
|
|
136
|
+
|
|
137
|
+
### Cutting a release
|
|
138
|
+
|
|
139
|
+
1. Bump `version` in `pyproject.toml` (and `__version__` in `tappass/__init__.py`).
|
|
140
|
+
2. Update `CHANGELOG.md`: flip `## [X.Y.Z] — Unreleased` to `## [X.Y.Z] — YYYY-MM-DD`.
|
|
141
|
+
3. Commit: `git commit -am "release: X.Y.Z"`.
|
|
142
|
+
4. Tag and push:
|
|
143
|
+
```
|
|
144
|
+
git tag vX.Y.Z
|
|
145
|
+
git push origin main --tags
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
The workflow then:
|
|
149
|
+
1. Verifies the tag matches `pyproject.toml` version (fails the release if not).
|
|
150
|
+
2. Builds wheel + sdist.
|
|
151
|
+
3. Runs `twine check`.
|
|
152
|
+
4. Publishes to PyPI via OIDC.
|
|
153
|
+
5. Creates a GitHub Release with the wheel + sdist attached and auto-generated notes.
|
|
154
|
+
|
|
155
|
+
### Dry run
|
|
156
|
+
|
|
157
|
+
To build the artifacts without publishing, use **Actions → Release to PyPI → Run workflow** with `dry_run` checked. The `publish` and `github_release` jobs are skipped; the `build` job's artifacts are retained for inspection.
|
|
158
|
+
|
|
159
|
+
## License
|
|
160
|
+
|
|
161
|
+
Apache-2.0. See `LICENSE`.
|
tappass-0.6.0/README.md
ADDED
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
# tappass — Zero Trust Control Plane for Agentic AI (Python SDK)
|
|
2
|
+
|
|
3
|
+
Runtime governance for your LLM, agent, and tool calls. Embed in your code, get a typed audit trail, surface governance decisions as Python exceptions.
|
|
4
|
+
|
|
5
|
+
**What this SDK is for:**
|
|
6
|
+
- Governing LLM calls, agent runs, and tool executions at runtime.
|
|
7
|
+
- Emitting structured audit events with correlation IDs.
|
|
8
|
+
- Handling governance decisions (block, redact, approve, trust-tier, break-glass) as typed exceptions in your code.
|
|
9
|
+
|
|
10
|
+
**What this SDK is NOT for:**
|
|
11
|
+
- Policy CRUD, compliance report generation, Verified credential issuance, retention config, break-glass invocation, tool-integrity approval. Those live in the [TapPass dashboard](https://app.tappass.ai) — not in your agent code.
|
|
12
|
+
|
|
13
|
+
## Requirements
|
|
14
|
+
|
|
15
|
+
- Python ≥ 3.11.
|
|
16
|
+
- `tappass` server ≥ 0.6.0. (The SDK rejects older servers at construction time.)
|
|
17
|
+
|
|
18
|
+
## Install
|
|
19
|
+
|
|
20
|
+
pip install tappass
|
|
21
|
+
|
|
22
|
+
## Quickstart — a governed chat call
|
|
23
|
+
|
|
24
|
+
from tappass import Agent
|
|
25
|
+
|
|
26
|
+
agent = Agent("https://tappass.example.com", api_key="tp_...")
|
|
27
|
+
r = agent.chat("Summarize Q4 revenue")
|
|
28
|
+
print(r.content)
|
|
29
|
+
print(r.session_id, r.audit_url) # correlation IDs, deep link to dashboard
|
|
30
|
+
|
|
31
|
+
## Quickstart — govern a CrewAI run
|
|
32
|
+
|
|
33
|
+
from crewai import Agent, Task, Crew
|
|
34
|
+
from tappass.integrations.crewai import guard_crew
|
|
35
|
+
|
|
36
|
+
crew = Crew(agents=[...], tasks=[...])
|
|
37
|
+
|
|
38
|
+
with guard_crew(crew, tappass_url="https://tappass.example.com", api_key="tp_...") as session:
|
|
39
|
+
result = session.kickoff()
|
|
40
|
+
print(session.id, session.audit_url)
|
|
41
|
+
|
|
42
|
+
## Decisions are typed exceptions
|
|
43
|
+
|
|
44
|
+
from tappass import GovernanceDecision, PolicyBlockError, ApprovalRequired
|
|
45
|
+
|
|
46
|
+
try:
|
|
47
|
+
r = agent.chat("Show me all customer SSNs")
|
|
48
|
+
except PolicyBlockError as e:
|
|
49
|
+
print(f"Blocked by {e.blocked_by}: {e.reason}. See {e.audit_url}")
|
|
50
|
+
except ApprovalRequired as e:
|
|
51
|
+
print(f"Awaiting approval: {e.approval_url}")
|
|
52
|
+
except GovernanceDecision as e:
|
|
53
|
+
print(f"Governance decision: {e}")
|
|
54
|
+
|
|
55
|
+
## What's new in 0.6
|
|
56
|
+
|
|
57
|
+
See `CHANGELOG.md`. Breaking changes — no back-compat with 0.5.x. See the [migration guide](https://docs.tappass.ai/sdk/migration-0.6/).
|
|
58
|
+
|
|
59
|
+
## Publishing a release
|
|
60
|
+
|
|
61
|
+
Releases ship to PyPI via GitHub Actions using OIDC Trusted Publishing — no long-lived API token is stored anywhere. The workflow is `.github/workflows/release.yml`.
|
|
62
|
+
|
|
63
|
+
### One-time PyPI configuration
|
|
64
|
+
|
|
65
|
+
Only needed once per project (or whenever the workflow name / environment changes):
|
|
66
|
+
|
|
67
|
+
1. Log in to <https://pypi.org/manage/account/publishing/>.
|
|
68
|
+
2. Under **Add a new pending publisher** (if the project isn't on PyPI yet) or the existing project's **Publishing** tab, add a GitHub publisher with:
|
|
69
|
+
- **PyPI Project Name:** `tappass`
|
|
70
|
+
- **Owner:** `tappass`
|
|
71
|
+
- **Repository name:** `tappass-sdk`
|
|
72
|
+
- **Workflow name:** `release.yml`
|
|
73
|
+
- **Environment name:** `pypi`
|
|
74
|
+
3. In the GitHub repo, go to **Settings → Environments** and create an environment named `pypi`. Optionally add a required-reviewers protection rule so a human approves each release.
|
|
75
|
+
|
|
76
|
+
That's it — no secrets, no tokens.
|
|
77
|
+
|
|
78
|
+
### Cutting a release
|
|
79
|
+
|
|
80
|
+
1. Bump `version` in `pyproject.toml` (and `__version__` in `tappass/__init__.py`).
|
|
81
|
+
2. Update `CHANGELOG.md`: flip `## [X.Y.Z] — Unreleased` to `## [X.Y.Z] — YYYY-MM-DD`.
|
|
82
|
+
3. Commit: `git commit -am "release: X.Y.Z"`.
|
|
83
|
+
4. Tag and push:
|
|
84
|
+
```
|
|
85
|
+
git tag vX.Y.Z
|
|
86
|
+
git push origin main --tags
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
The workflow then:
|
|
90
|
+
1. Verifies the tag matches `pyproject.toml` version (fails the release if not).
|
|
91
|
+
2. Builds wheel + sdist.
|
|
92
|
+
3. Runs `twine check`.
|
|
93
|
+
4. Publishes to PyPI via OIDC.
|
|
94
|
+
5. Creates a GitHub Release with the wheel + sdist attached and auto-generated notes.
|
|
95
|
+
|
|
96
|
+
### Dry run
|
|
97
|
+
|
|
98
|
+
To build the artifacts without publishing, use **Actions → Release to PyPI → Run workflow** with `dry_run` checked. The `publish` and `github_release` jobs are skipped; the `build` job's artifacts are retained for inspection.
|
|
99
|
+
|
|
100
|
+
## License
|
|
101
|
+
|
|
102
|
+
Apache-2.0. See `LICENSE`.
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["hatchling"]
|
|
3
|
+
build-backend = "hatchling.build"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "tappass"
|
|
7
|
+
version = "0.6.0"
|
|
8
|
+
description = "TapPass SDK — Zero Trust AI Agent Platform. Cryptographic capability tokens, governance pipeline, agent trust scoring."
|
|
9
|
+
readme = "README.md"
|
|
10
|
+
requires-python = ">=3.11"
|
|
11
|
+
dependencies = ["httpx>=0.25", "cryptography>=41.0"]
|
|
12
|
+
license = {text = "Apache-2.0"}
|
|
13
|
+
authors = [
|
|
14
|
+
{name = "Jens Bontinck", email = "jens@tappass.ai"},
|
|
15
|
+
]
|
|
16
|
+
keywords = [
|
|
17
|
+
"ai-agents",
|
|
18
|
+
"governance",
|
|
19
|
+
"security",
|
|
20
|
+
"capability-tokens",
|
|
21
|
+
"audit",
|
|
22
|
+
"gdpr",
|
|
23
|
+
"eu-ai-act",
|
|
24
|
+
"langchain",
|
|
25
|
+
"crewai",
|
|
26
|
+
"openai",
|
|
27
|
+
"llm",
|
|
28
|
+
"prompt-injection",
|
|
29
|
+
"pii-detection",
|
|
30
|
+
]
|
|
31
|
+
classifiers = [
|
|
32
|
+
"Development Status :: 4 - Beta",
|
|
33
|
+
"Intended Audience :: Developers",
|
|
34
|
+
"Topic :: Security",
|
|
35
|
+
"Topic :: Software Development :: Libraries :: Python Modules",
|
|
36
|
+
"Programming Language :: Python :: 3.10",
|
|
37
|
+
"Programming Language :: Python :: 3.11",
|
|
38
|
+
"Programming Language :: Python :: 3.12",
|
|
39
|
+
"Programming Language :: Python :: 3.13",
|
|
40
|
+
"License :: OSI Approved :: Apache Software License",
|
|
41
|
+
"Typing :: Typed",
|
|
42
|
+
]
|
|
43
|
+
|
|
44
|
+
[project.scripts]
|
|
45
|
+
tappass = "tappass._cli:main"
|
|
46
|
+
tappass-sign = "tappass.signing:main"
|
|
47
|
+
tappass-claude-code-hook = "tappass.integrations.claude_code:main"
|
|
48
|
+
|
|
49
|
+
[project.optional-dependencies]
|
|
50
|
+
sandbox = ["nono-py>=0.1.0"]
|
|
51
|
+
openai = ["openai>=1.0"]
|
|
52
|
+
langchain = ["langchain-core>=0.2"]
|
|
53
|
+
crewai = ["crewai>=0.50"]
|
|
54
|
+
fastapi = ["fastapi>=0.100", "starlette>=0.27"]
|
|
55
|
+
temporal = ["temporalio>=1.5"]
|
|
56
|
+
google-adk = ["google-adk>=0.1"]
|
|
57
|
+
all = ["nono-py>=0.1.0", "openai>=1.0", "langchain-core>=0.2", "crewai>=0.50", "fastapi>=0.100", "temporalio>=1.5"]
|
|
58
|
+
dev = [
|
|
59
|
+
"pytest>=8.0",
|
|
60
|
+
"pytest-asyncio>=0.23",
|
|
61
|
+
"respx>=0.21",
|
|
62
|
+
"mypy>=1.10",
|
|
63
|
+
# Test-only — tests/test_fastapi_mandate.py exercises the JWS
|
|
64
|
+
# verifier and the example FastAPI route.
|
|
65
|
+
"pyjwt>=2.10",
|
|
66
|
+
"fastapi>=0.100",
|
|
67
|
+
# Drop-in client tests (test_openai_drop_in, test_anthropic_drop_in)
|
|
68
|
+
# import these directly; without them CI fails with ModuleNotFoundError.
|
|
69
|
+
"openai>=1.0",
|
|
70
|
+
"anthropic>=0.40",
|
|
71
|
+
]
|
|
72
|
+
|
|
73
|
+
[project.urls]
|
|
74
|
+
Homepage = "https://tappass.ai"
|
|
75
|
+
Documentation = "https://docs.tappass.ai"
|
|
76
|
+
Repository = "https://github.com/tappass/tappass-sdk"
|
|
77
|
+
Changelog = "https://github.com/tappass/tappass-sdk/blob/main/CHANGELOG.md"
|
|
78
|
+
Issues = "https://github.com/tappass/tappass-sdk/issues"
|
|
79
|
+
|
|
80
|
+
[tool.hatch.build.targets.wheel]
|
|
81
|
+
packages = ["tappass"]
|
|
82
|
+
|
|
83
|
+
[tool.hatch.build.targets.sdist]
|
|
84
|
+
include = ["tappass/", "README.md", "LICENSE"]
|
|
85
|
+
|
|
86
|
+
[tool.ruff]
|
|
87
|
+
target-version = "py310"
|
|
88
|
+
line-length = 120
|
|
89
|
+
|
|
90
|
+
[tool.pytest.ini_options]
|
|
91
|
+
asyncio_mode = "auto"
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
"""TapPass — Zero Trust Control Plane for Agentic AI (SDK 0.6.0).
|
|
2
|
+
|
|
3
|
+
Runtime governance for LLM, agent, and tool calls. For admin surface
|
|
4
|
+
(policy CRUD, compliance reports, retention, etc.) use the dashboard.
|
|
5
|
+
"""
|
|
6
|
+
from __future__ import annotations
|
|
7
|
+
|
|
8
|
+
__version__ = "0.6.0"
|
|
9
|
+
|
|
10
|
+
# ── Core runtime ──────────────────────────────────────────────
|
|
11
|
+
from tappass.client import Agent, AsyncAgent
|
|
12
|
+
from tappass.admin import TapPass, AsyncTapPass
|
|
13
|
+
from tappass.govern import govern
|
|
14
|
+
from tappass.sor import govern_sor_write, govern_sor_write_async
|
|
15
|
+
from tappass._govern_call import GovernanceBlocked, GovernanceUnavailable
|
|
16
|
+
from tappass.session import (
|
|
17
|
+
current_session,
|
|
18
|
+
tappass_session,
|
|
19
|
+
tappass_session_async,
|
|
20
|
+
)
|
|
21
|
+
|
|
22
|
+
# ── Capability tokens ─────────────────────────────────────────
|
|
23
|
+
from tappass.capability_token import (
|
|
24
|
+
CapabilityToken,
|
|
25
|
+
Authorizer,
|
|
26
|
+
AuthorizationResult,
|
|
27
|
+
SigningKey,
|
|
28
|
+
PublicKey,
|
|
29
|
+
Clearance,
|
|
30
|
+
TokenType,
|
|
31
|
+
)
|
|
32
|
+
|
|
33
|
+
# ── Constraints ───────────────────────────────────────────────
|
|
34
|
+
from tappass.constraints import (
|
|
35
|
+
Constraint, ConstraintSet,
|
|
36
|
+
Exact, Pattern, Range, OneOf, NotOneOf,
|
|
37
|
+
Subpath, UrlSafe, Shlex, Cidr, UrlPattern, Regex, CEL, Wildcard,
|
|
38
|
+
)
|
|
39
|
+
|
|
40
|
+
# ── Guard ─────────────────────────────────────────────────────
|
|
41
|
+
from tappass.guard import (
|
|
42
|
+
guard, token_scope, key_scope, authorizer_scope, guard_scope,
|
|
43
|
+
bypass_scope,
|
|
44
|
+
AuthorizationDenied as GuardDenied,
|
|
45
|
+
MissingContext, MissingSigningKey,
|
|
46
|
+
)
|
|
47
|
+
|
|
48
|
+
# ── Approval ──────────────────────────────────────────────────
|
|
49
|
+
from tappass.approval import (
|
|
50
|
+
ApprovalPolicy, ApprovalRequest, ApprovalResult, ApprovalStatus,
|
|
51
|
+
ApprovalRegistry, SignedApproval,
|
|
52
|
+
approve, require_approval, auto_approve, auto_deny, cli_prompt,
|
|
53
|
+
)
|
|
54
|
+
|
|
55
|
+
# ── Resilience ────────────────────────────────────────────────
|
|
56
|
+
from tappass.resilience import (
|
|
57
|
+
ResiliencePolicy, FailMode, ResilienceManager,
|
|
58
|
+
TapPassCircuitBreaker, LocalAuditBuffer,
|
|
59
|
+
)
|
|
60
|
+
|
|
61
|
+
# ── Exceptions ────────────────────────────────────────────────
|
|
62
|
+
from tappass.errors import (
|
|
63
|
+
TapPassError,
|
|
64
|
+
TapPassConnectionError,
|
|
65
|
+
TapPassConfigError,
|
|
66
|
+
GovernanceDecision,
|
|
67
|
+
PolicyBlockError,
|
|
68
|
+
RedactionApplied,
|
|
69
|
+
ApprovalRequired,
|
|
70
|
+
TrustTierDenied,
|
|
71
|
+
BreakGlassActive,
|
|
72
|
+
ToolIntegrityViolation,
|
|
73
|
+
)
|
|
74
|
+
|
|
75
|
+
# ── Types ─────────────────────────────────────────────────────
|
|
76
|
+
from tappass.types import (
|
|
77
|
+
ChatResponse,
|
|
78
|
+
ChatChunk,
|
|
79
|
+
Usage,
|
|
80
|
+
ToolCall,
|
|
81
|
+
StepResult,
|
|
82
|
+
PipelineResult,
|
|
83
|
+
Redaction,
|
|
84
|
+
AuditEvent,
|
|
85
|
+
Session,
|
|
86
|
+
HealthStatus,
|
|
87
|
+
AgentInfo,
|
|
88
|
+
)
|
|
89
|
+
|
|
90
|
+
__all__ = [
|
|
91
|
+
"__version__",
|
|
92
|
+
# Runtime
|
|
93
|
+
"Agent", "AsyncAgent",
|
|
94
|
+
"TapPass", "AsyncTapPass",
|
|
95
|
+
"govern",
|
|
96
|
+
"govern_sor_write", "govern_sor_write_async",
|
|
97
|
+
"GovernanceBlocked", "GovernanceUnavailable",
|
|
98
|
+
"tappass_session", "tappass_session_async", "current_session",
|
|
99
|
+
# Capability tokens
|
|
100
|
+
"CapabilityToken", "Authorizer", "AuthorizationResult",
|
|
101
|
+
"SigningKey", "PublicKey", "Clearance", "TokenType",
|
|
102
|
+
# Constraints
|
|
103
|
+
"Constraint", "ConstraintSet",
|
|
104
|
+
"Exact", "Pattern", "Range", "OneOf", "NotOneOf",
|
|
105
|
+
"Subpath", "UrlSafe", "Shlex", "Cidr", "UrlPattern",
|
|
106
|
+
"Regex", "CEL", "Wildcard",
|
|
107
|
+
# Guard
|
|
108
|
+
"guard", "token_scope", "key_scope", "authorizer_scope",
|
|
109
|
+
"guard_scope", "bypass_scope",
|
|
110
|
+
"GuardDenied", "MissingContext", "MissingSigningKey",
|
|
111
|
+
# Approval
|
|
112
|
+
"ApprovalPolicy", "ApprovalRequest", "ApprovalResult",
|
|
113
|
+
"ApprovalStatus", "ApprovalRegistry", "SignedApproval",
|
|
114
|
+
"approve", "require_approval", "auto_approve", "auto_deny", "cli_prompt",
|
|
115
|
+
# Resilience
|
|
116
|
+
"ResiliencePolicy", "FailMode", "ResilienceManager",
|
|
117
|
+
"TapPassCircuitBreaker", "LocalAuditBuffer",
|
|
118
|
+
# Exceptions
|
|
119
|
+
"TapPassError", "TapPassConnectionError", "TapPassConfigError",
|
|
120
|
+
"GovernanceDecision", "PolicyBlockError", "RedactionApplied",
|
|
121
|
+
"ApprovalRequired", "TrustTierDenied", "BreakGlassActive",
|
|
122
|
+
"ToolIntegrityViolation",
|
|
123
|
+
# Types
|
|
124
|
+
"ChatResponse", "ChatChunk", "Usage", "ToolCall", "StepResult",
|
|
125
|
+
"PipelineResult", "Redaction", "AuditEvent", "Session",
|
|
126
|
+
"HealthStatus", "AgentInfo",
|
|
127
|
+
]
|