tollgate 1.0.0__py3-none-any.whl → 1.0.2__py3-none-any.whl

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.
tollgate/__init__.py CHANGED
@@ -31,7 +31,7 @@ from .types import (
31
31
  ToolRequest,
32
32
  )
33
33
 
34
- __version__ = "1.0.0"
34
+ __version__ = "1.0.2"
35
35
 
36
36
  __all__ = [
37
37
  "ControlTower",
@@ -0,0 +1,117 @@
1
+ Metadata-Version: 2.4
2
+ Name: tollgate
3
+ Version: 1.0.2
4
+ Summary: Runtime enforcement layer for AI agent tool calls using Identity + Intent + Policy
5
+ Author: Tollgate Maintainers
6
+ License-Expression: Apache-2.0
7
+ License-File: LICENSE
8
+ Keywords: agents,ai,enforcement,llm,policy,security
9
+ Classifier: Development Status :: 3 - Alpha
10
+ Classifier: Intended Audience :: Developers
11
+ Classifier: License :: OSI Approved :: Apache Software License
12
+ Classifier: Programming Language :: Python :: 3
13
+ Classifier: Programming Language :: Python :: 3.10
14
+ Classifier: Programming Language :: Python :: 3.11
15
+ Classifier: Programming Language :: Python :: 3.12
16
+ Requires-Python: >=3.10
17
+ Requires-Dist: pyyaml>=6.0.0
18
+ Provides-Extra: dev
19
+ Requires-Dist: build>=1.0.0; extra == 'dev'
20
+ Requires-Dist: pytest-asyncio>=0.21.0; extra == 'dev'
21
+ Requires-Dist: pytest>=7.0.0; extra == 'dev'
22
+ Requires-Dist: ruff>=0.1.0; extra == 'dev'
23
+ Requires-Dist: twine>=4.0.0; extra == 'dev'
24
+ Description-Content-Type: text/markdown
25
+
26
+ # tollgate 🚪
27
+
28
+ Runtime enforcement layer for AI agent tool calls using **Identity + Intent + Policy**.
29
+
30
+ `tollgate` provides a deterministic safety boundary for AI agents. It ensures every tool call is validated against a policy before execution, with support for async human-in-the-loop approvals, framework interception (MCP, Strands, LangChain, OpenAI), and structured audit logging.
31
+
32
+ **[🚀 Quickstart Guide](https://github.com/ravi-labs/tollgate/blob/main/QUICKSTART.md) | [📊 Integration Comparison](https://github.com/ravi-labs/tollgate/blob/main/COMPARISON.md)**
33
+
34
+ ```
35
+ ┌────────────┐ ┌─────────────────────┐ ┌──────────────────┐
36
+ │ AI Agent │────▶│ Tollgate Interceptor│────▶│ Policy + Registry│
37
+ └────────────┘ └─────────────────────┘ └────────┬─────────┘
38
+
39
+ ┌────────────────────────────────────┼────────────────────────────────────┐
40
+ │ │ │
41
+ ▼ ▼ ▼
42
+ ┌───────────┐ ┌───────────┐ ┌───────────┐
43
+ │ ALLOW │ │ ASK │ │ DENY │
44
+ └─────┬─────┘ └─────┬─────┘ └─────┬─────┘
45
+ │ │ │
46
+ ▼ ▼ ▼
47
+ ┌───────────┐ ┌───────────────┐ ┌───────────┐
48
+ │ Execute │ │Human Approval │ │ Block & │
49
+ │ Tool │ │ (Approved?) │ │ Audit │
50
+ └─────┬─────┘ └───────┬───────┘ └─────┬─────┘
51
+ │ ▼ ▼ │
52
+ │ Yes │ │ No │
53
+ │ ▼ ▼ │
54
+ │ ┌─────────┐ ┌─────────┐ │
55
+ │ │ Execute │ │ Block │ │
56
+ │ └────┬────┘ └────┬────┘ │
57
+ │ │ │ │
58
+ └─────────────────────────────┴───────────┴──────────────────────────────┘
59
+
60
+
61
+ ┌───────────┐
62
+ │ Audit Log │
63
+ └───────────┘
64
+ ```
65
+
66
+ ## ✨ v1 Core Principles
67
+
68
+ 1. **Interception-First**: Enforcement happens at the tool execution boundary via adapters.
69
+ 2. **Safe Defaults**: Any unknown tool effect or resource defaults to **DENY**.
70
+ 3. **Trust Model**: Tool metadata is trusted only if it comes from a developer-controlled **Tool Registry**.
71
+ 4. **Approval Integrity**: Approvals are bound to a request hash and correlation ID with replay protection.
72
+ 5. **Async-First**: Native support for asynchronous agent loops and non-blocking approvals.
73
+ 6. **Audit Integrity**: Every decision, approval, and outcome is recorded with full cryptographic context.
74
+
75
+ ## 🚀 v1 Integrations
76
+
77
+ ### MCP (Model Context Protocol)
78
+ Wrap an MCP client to gate all tool calls:
79
+ ```python
80
+ from tollgate import ControlTower, ToolRegistry
81
+ from tollgate.integrations.mcp import TollgateMCPClient
82
+
83
+ registry = ToolRegistry("manifest.yaml")
84
+ tower = ControlTower(...)
85
+ client = TollgateMCPClient(base_client, server_name="my_server", tower=tower, registry=registry)
86
+
87
+ # Calls are now gated!
88
+ await client.call_tool("read_data", {"id": 1}, agent_ctx=ctx, intent=intent)
89
+ ```
90
+
91
+ ### Strands Agents
92
+ Gate Strands tools with minimal friction:
93
+ ```python
94
+ from tollgate.integrations.strands import guard_tools
95
+
96
+ guarded = guard_tools(my_strands_tools, tower, registry)
97
+
98
+ # Use guarded tools in your agent
99
+ await guarded[0]("input", agent_ctx=ctx, intent=intent)
100
+ ```
101
+
102
+ ## 📜 Development
103
+
104
+ ```bash
105
+ # Install
106
+ make install
107
+
108
+ # Run Tests
109
+ make test
110
+
111
+ # Run Examples (non-interactive)
112
+ python examples/mcp_minimal/demo.py
113
+ python examples/strands_minimal/demo.py
114
+ ```
115
+
116
+ ## ⚖️ License
117
+ Apache-2.0
@@ -1,4 +1,4 @@
1
- tollgate/__init__.py,sha256=IFGFmwaby9j_F67ji8z9Zd6fvEcN6O4tFu_Zz5ruoU8,1322
1
+ tollgate/__init__.py,sha256=o-IL79mjKN0M_68YJ6y54aECDhpPQFbRxNNByCpmofI,1322
2
2
  tollgate/approvals.py,sha256=82DjgRSugFnJGlH6TNYjGwC5jWAtOmEWV8rJju7G5LI,7083
3
3
  tollgate/audit.py,sha256=ugMhuuLoyBNdYD2S_MjGN_ac4nHdtRz15MElqElREIs,1279
4
4
  tollgate/exceptions.py,sha256=2yYY3esnHz26dyJlx_Cd_J64ryhexrgc4KliDmiVJSs,882
@@ -14,7 +14,7 @@ tollgate/interceptors/__init__.py,sha256=0c3MYyVKGYrBOZ1mMolgrAowrqZrULzAl0vv-s8
14
14
  tollgate/interceptors/base.py,sha256=uJxHzH0eurcGEVknbk1kQkk_2u2qNtnM--ZRCp52Wyo,1390
15
15
  tollgate/interceptors/langchain.py,sha256=_8vXCjWkRKeTlxtXm33a67Gf4po9YiHS7faThMJLohc,2963
16
16
  tollgate/interceptors/openai.py,sha256=--xSussx3HY5DYBLO4F7_h6_amer47PtpqGyRDUPwGc,2680
17
- tollgate-1.0.0.dist-info/METADATA,sha256=0QRShziPp_TIZOijHzxCssg5Ef2GOC6qvam6yDZ-fGM,3345
18
- tollgate-1.0.0.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
19
- tollgate-1.0.0.dist-info/licenses/LICENSE,sha256=psuoW8kuDP96RQsdhzwOqi6fyWv0ct8CR6Jr7He_P_k,10173
20
- tollgate-1.0.0.dist-info/RECORD,,
17
+ tollgate-1.0.2.dist-info/METADATA,sha256=Q5Njrg5fscAEimYJafqwarIqMv_JFiTZM0ybn4-Udd0,6787
18
+ tollgate-1.0.2.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
19
+ tollgate-1.0.2.dist-info/licenses/LICENSE,sha256=EZ9SehMCkcatlggcoT7WV0tx-ku4OsAoQf9LmJZvG1g,10806
20
+ tollgate-1.0.2.dist-info/RECORD,,
@@ -1,3 +1,19 @@
1
+ Copyright 2026 Ravi Labs
2
+
3
+ Licensed under the Apache License, Version 2.0 (the "License");
4
+ you may not use this file except in compliance with the License.
5
+ You may obtain a copy of the License at
6
+
7
+ http://www.apache.org/licenses/LICENSE-2.0
8
+
9
+ Unless required by applicable law or agreed to in writing, software
10
+ distributed under the License is distributed on an "AS IS" BASIS,
11
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ See the License for the specific language governing permissions and
13
+ limitations under the License.
14
+
15
+ --------------------------------------------------------------------------------
16
+
1
17
  Apache License
2
18
  Version 2.0, January 2004
3
19
  http://www.apache.org/licenses/
@@ -1,98 +0,0 @@
1
- Metadata-Version: 2.4
2
- Name: tollgate
3
- Version: 1.0.0
4
- Summary: Runtime enforcement layer for AI agent tool calls using Identity + Intent + Policy
5
- Author: Tollgate Maintainers
6
- License-Expression: Apache-2.0
7
- License-File: LICENSE
8
- Keywords: agents,ai,enforcement,llm,policy,security
9
- Classifier: Development Status :: 3 - Alpha
10
- Classifier: Intended Audience :: Developers
11
- Classifier: License :: OSI Approved :: Apache Software License
12
- Classifier: Programming Language :: Python :: 3
13
- Classifier: Programming Language :: Python :: 3.10
14
- Classifier: Programming Language :: Python :: 3.11
15
- Classifier: Programming Language :: Python :: 3.12
16
- Requires-Python: >=3.10
17
- Requires-Dist: pyyaml>=6.0.0
18
- Provides-Extra: dev
19
- Requires-Dist: build>=1.0.0; extra == 'dev'
20
- Requires-Dist: pytest-asyncio>=0.21.0; extra == 'dev'
21
- Requires-Dist: pytest>=7.0.0; extra == 'dev'
22
- Requires-Dist: ruff>=0.1.0; extra == 'dev'
23
- Requires-Dist: twine>=4.0.0; extra == 'dev'
24
- Description-Content-Type: text/markdown
25
-
26
- # tollgate 🚪
27
-
28
- Runtime enforcement layer for AI agent tool calls using **Identity + Intent + Policy**.
29
-
30
- `tollgate` provides a deterministic safety boundary for AI agents. It ensures every tool call is validated against a policy before execution, with support for async human-in-the-loop approvals, framework interception (MCP, Strands, LangChain, OpenAI), and structured audit logging.
31
-
32
- **[🚀 Quickstart Guide](./QUICKSTART.md) | [📊 Integration Comparison](./COMPARISON.md)**
33
-
34
- ```mermaid
35
- graph TD
36
- A[AI Agent] -->|Tool Call| B(Tollgate Interceptor)
37
- B --> C{Policy + Registry}
38
- C -->|ALLOW| D[Execute Tool]
39
- C -->|DENY| E[Block & Audit]
40
- C -->|ASK| F{Human Approval}
41
- F -->|Approved| D
42
- F -->|Denied| E
43
- D --> G[Audit Log]
44
- E --> G
45
- ```
46
-
47
- ## ✨ v1 Core Principles
48
-
49
- 1. **Interception-First**: Enforcement happens at the tool execution boundary via adapters.
50
- 2. **Safe Defaults**: Any unknown tool effect or resource defaults to **DENY**.
51
- 3. **Trust Model**: Tool metadata is trusted only if it comes from a developer-controlled **Tool Registry**.
52
- 4. **Approval Integrity**: Approvals are bound to a request hash and correlation ID with replay protection.
53
- 5. **Async-First**: Native support for asynchronous agent loops and non-blocking approvals.
54
- 6. **Audit Integrity**: Every decision, approval, and outcome is recorded with full cryptographic context.
55
-
56
- ## 🚀 v1 Integrations
57
-
58
- ### MCP (Model Context Protocol)
59
- Wrap an MCP client to gate all tool calls:
60
- ```python
61
- from tollgate import ControlTower, ToolRegistry
62
- from tollgate.integrations.mcp import TollgateMCPClient
63
-
64
- registry = ToolRegistry("manifest.yaml")
65
- tower = ControlTower(...)
66
- client = TollgateMCPClient(base_client, server_name="my_server", tower=tower, registry=registry)
67
-
68
- # Calls are now gated!
69
- await client.call_tool("read_data", {"id": 1}, agent_ctx=ctx, intent=intent)
70
- ```
71
-
72
- ### Strands Agents
73
- Gate Strands tools with minimal friction:
74
- ```python
75
- from tollgate.integrations.strands import guard_tools
76
-
77
- guarded = guard_tools(my_strands_tools, tower, registry)
78
-
79
- # Use guarded tools in your agent
80
- await guarded[0]("input", agent_ctx=ctx, intent=intent)
81
- ```
82
-
83
- ## 📜 Development
84
-
85
- ```bash
86
- # Install
87
- make install
88
-
89
- # Run Tests
90
- make test
91
-
92
- # Run Examples (non-interactive)
93
- python examples/mcp_minimal/demo.py
94
- python examples/strands_minimal/demo.py
95
- ```
96
-
97
- ## ⚖️ License
98
- Apache-2.0