brutor-runtime-hooks 0.2.0__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.
- brutor/runtime_hooks/__init__.py +46 -0
- brutor/runtime_hooks/_delegation.py +92 -0
- brutor/runtime_hooks/_env.py +39 -0
- brutor/runtime_hooks/_http.py +174 -0
- brutor/runtime_hooks/_jcs.py +123 -0
- brutor/runtime_hooks/_verdict.py +148 -0
- brutor/runtime_hooks/adapters/__init__.py +16 -0
- brutor/runtime_hooks/adapters/agent_framework.py +118 -0
- brutor/runtime_hooks/adapters/claude_agent_sdk.py +352 -0
- brutor/runtime_hooks/adapters/langgraph.py +623 -0
- brutor/runtime_hooks/adapters/openai_agents.py +450 -0
- brutor/runtime_hooks/bundle.py +294 -0
- brutor/runtime_hooks/errors.py +92 -0
- brutor/runtime_hooks/interceptor.py +495 -0
- brutor/runtime_hooks/minimise.py +105 -0
- brutor/runtime_hooks/py.typed +0 -0
- brutor/runtime_hooks/resolver.py +175 -0
- brutor/runtime_hooks/session.py +566 -0
- brutor/runtime_hooks/transform.py +184 -0
- brutor_runtime_hooks-0.2.0.dist-info/METADATA +172 -0
- brutor_runtime_hooks-0.2.0.dist-info/RECORD +24 -0
- brutor_runtime_hooks-0.2.0.dist-info/WHEEL +4 -0
- brutor_runtime_hooks-0.2.0.dist-info/licenses/LICENSE +52 -0
- brutor_runtime_hooks-0.2.0.dist-info/licenses/NOTICE +23 -0
|
@@ -0,0 +1,184 @@
|
|
|
1
|
+
# Copyright 2026 Brutor AI Ltd. All rights reserved.
|
|
2
|
+
# SPDX-License-Identifier: LicenseRef-Brutor-Enterprise-SDK
|
|
3
|
+
|
|
4
|
+
"""Applying a ``transform`` verdict: the Agent Hooks 0.1 path grammar, as the agent-hooks core has it.
|
|
5
|
+
|
|
6
|
+
A transform names a place in the point's ``target`` and the value to put there::
|
|
7
|
+
|
|
8
|
+
{"decision": "transform", "transform": {"path": "$target.content", "value": "[REDACTED]"}}
|
|
9
|
+
|
|
10
|
+
The path is ``$target`` (or its deprecated alias ``$policy_target``) followed by segments:
|
|
11
|
+
``.name`` and ``["name"]`` (a member that must already exist; names are ASCII letters, digits,
|
|
12
|
+
``_`` and ``-``) and ``[n]`` (an index that must be in range). ``$target`` alone replaces the whole
|
|
13
|
+
target. Anything else is refused: a path not rooted at ``$target`` with
|
|
14
|
+
``host_error:transform_target_forbidden``, any other path, or one that does not resolve, with
|
|
15
|
+
``host_error:transform_invalid``. A transform at ``agent_startup`` or ``agent_shutdown`` is
|
|
16
|
+
forbidden: those points have nothing to rewrite.
|
|
17
|
+
|
|
18
|
+
A transformed target must still be what its point's context requires (``target_fits``): the
|
|
19
|
+
arguments of a tool call stay an object, ``input`` keeps its ``content`` and ``role``, and so on.
|
|
20
|
+
A host that would otherwise build a context the Agent Hooks schema refuses denies instead
|
|
21
|
+
(``host_error:context_invalid``, as the agent-hooks core does when a transform leaves the I-JSON
|
|
22
|
+
domain).
|
|
23
|
+
|
|
24
|
+
This is the same language, byte for byte, as the agent-hooks core's ``path.rs``; the SDK's tests hold
|
|
25
|
+
it to the core itself.
|
|
26
|
+
"""
|
|
27
|
+
|
|
28
|
+
from __future__ import annotations
|
|
29
|
+
|
|
30
|
+
import json
|
|
31
|
+
from typing import Any
|
|
32
|
+
|
|
33
|
+
TRANSFORM_INVALID = "host_error:transform_invalid"
|
|
34
|
+
TRANSFORM_TARGET_FORBIDDEN = "host_error:transform_target_forbidden"
|
|
35
|
+
# The message of the deny a transform becomes where a framework cannot carry the transformed value.
|
|
36
|
+
REDACTION_REQUIRED = "redaction required"
|
|
37
|
+
_ROOTS = ("$target", "$policy_target")
|
|
38
|
+
_MEMBER_CHARS = frozenset("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789_-")
|
|
39
|
+
_DIGITS = frozenset("0123456789")
|
|
40
|
+
_NO_TRANSFORM = frozenset({"agent_startup", "agent_shutdown"})
|
|
41
|
+
_POINTS = frozenset(
|
|
42
|
+
{"input", "pre_model_call", "post_model_call", "pre_tool_call", "post_tool_call", "output"} | _NO_TRANSFORM
|
|
43
|
+
)
|
|
44
|
+
|
|
45
|
+
Segment = str | int
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
class TransformRefused(ValueError):
|
|
49
|
+
"""A transform the host cannot apply: ``reason`` is the reserved deny reason it becomes."""
|
|
50
|
+
|
|
51
|
+
def __init__(self, reason: str) -> None:
|
|
52
|
+
self.reason = reason
|
|
53
|
+
super().__init__(reason)
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
def cannot_carry() -> dict[str, Any]:
|
|
57
|
+
"""The deny a transform becomes where the framework cannot carry the transformed value (fail closed)."""
|
|
58
|
+
return {"decision": "deny", "reason": TRANSFORM_INVALID, "message": REDACTION_REQUIRED}
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
def transform_permitted(point: str) -> bool:
|
|
62
|
+
"""Whether a transform may be applied at ``point`` (every point with a target to rewrite)."""
|
|
63
|
+
return point in _POINTS and point not in _NO_TRANSFORM
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
_ROLES = frozenset({"user", "system", "external"})
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
def _fits_tool_calls(calls: Any) -> bool:
|
|
70
|
+
return isinstance(calls, list) and all(
|
|
71
|
+
isinstance(c, dict)
|
|
72
|
+
and isinstance(c.get("name"), str)
|
|
73
|
+
and isinstance(c.get("args"), dict)
|
|
74
|
+
and isinstance(c.get("id", ""), str)
|
|
75
|
+
for c in calls
|
|
76
|
+
)
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
def target_fits(point: str, target: Any) -> bool:
|
|
80
|
+
"""Whether ``target`` is a value the point's context member may hold (the Agent Hooks context schema)."""
|
|
81
|
+
if point == "input":
|
|
82
|
+
return isinstance(target, dict) and "content" in target and target.get("role") in _ROLES
|
|
83
|
+
if point == "pre_model_call":
|
|
84
|
+
return isinstance(target, list) and all(
|
|
85
|
+
isinstance(m, dict) and isinstance(m.get("role"), str) and "content" in m for m in target
|
|
86
|
+
)
|
|
87
|
+
if point == "post_model_call":
|
|
88
|
+
return (
|
|
89
|
+
isinstance(target, dict)
|
|
90
|
+
and "content" in target
|
|
91
|
+
and _fits_tool_calls(target.get("tool_calls"))
|
|
92
|
+
and isinstance(target.get("finish_reason"), str)
|
|
93
|
+
)
|
|
94
|
+
if point == "pre_tool_call":
|
|
95
|
+
return isinstance(target, dict)
|
|
96
|
+
if point == "post_tool_call":
|
|
97
|
+
return True
|
|
98
|
+
if point == "output":
|
|
99
|
+
return isinstance(target, dict) and "content" in target
|
|
100
|
+
return False
|
|
101
|
+
|
|
102
|
+
|
|
103
|
+
def parse_path(path: Any) -> list[Segment]:
|
|
104
|
+
"""The path's segments (member names and indexes), or ``TransformRefused``."""
|
|
105
|
+
if not isinstance(path, str):
|
|
106
|
+
raise TransformRefused(TRANSFORM_INVALID)
|
|
107
|
+
rest = next((path[len(root) :] for root in _ROOTS if path.startswith(root)), None)
|
|
108
|
+
if rest is None:
|
|
109
|
+
raise TransformRefused(TRANSFORM_TARGET_FORBIDDEN)
|
|
110
|
+
segments: list[Segment] = []
|
|
111
|
+
i, n = 0, len(rest)
|
|
112
|
+
while i < n:
|
|
113
|
+
char = rest[i]
|
|
114
|
+
if char == ".":
|
|
115
|
+
start = i = i + 1
|
|
116
|
+
while i < n and rest[i] in _MEMBER_CHARS:
|
|
117
|
+
i += 1
|
|
118
|
+
if i == start:
|
|
119
|
+
raise TransformRefused(TRANSFORM_INVALID)
|
|
120
|
+
segments.append(rest[start:i])
|
|
121
|
+
elif char == "[":
|
|
122
|
+
i += 1
|
|
123
|
+
if i < n and rest[i] == '"':
|
|
124
|
+
start = i = i + 1
|
|
125
|
+
while i < n and rest[i] != '"':
|
|
126
|
+
if rest[i] not in _MEMBER_CHARS:
|
|
127
|
+
raise TransformRefused(TRANSFORM_INVALID)
|
|
128
|
+
i += 1
|
|
129
|
+
# the core accepts an empty bracketed name, and so does this
|
|
130
|
+
if i + 1 >= n or rest[i] != '"' or rest[i + 1] != "]":
|
|
131
|
+
raise TransformRefused(TRANSFORM_INVALID)
|
|
132
|
+
segments.append(rest[start:i])
|
|
133
|
+
i += 2
|
|
134
|
+
else:
|
|
135
|
+
start = i
|
|
136
|
+
while i < n and rest[i] in _DIGITS:
|
|
137
|
+
i += 1
|
|
138
|
+
if i == start or i >= n or rest[i] != "]":
|
|
139
|
+
raise TransformRefused(TRANSFORM_INVALID)
|
|
140
|
+
segments.append(int(rest[start:i]))
|
|
141
|
+
i += 1
|
|
142
|
+
else:
|
|
143
|
+
raise TransformRefused(TRANSFORM_INVALID)
|
|
144
|
+
return segments
|
|
145
|
+
|
|
146
|
+
|
|
147
|
+
def _json(value: Any) -> Any:
|
|
148
|
+
"""``value`` as plain JSON (dicts, lists, strings, numbers, booleans, null): a fresh copy."""
|
|
149
|
+
try:
|
|
150
|
+
return json.loads(json.dumps(value, ensure_ascii=False, allow_nan=False))
|
|
151
|
+
except (TypeError, ValueError):
|
|
152
|
+
raise TransformRefused(TRANSFORM_INVALID) from None
|
|
153
|
+
|
|
154
|
+
|
|
155
|
+
def _step(node: Any, segment: Segment) -> Any:
|
|
156
|
+
if isinstance(node, dict) and isinstance(segment, str):
|
|
157
|
+
if segment not in node:
|
|
158
|
+
raise TransformRefused(TRANSFORM_INVALID)
|
|
159
|
+
return node[segment]
|
|
160
|
+
if isinstance(node, list) and isinstance(segment, int):
|
|
161
|
+
if segment >= len(node):
|
|
162
|
+
raise TransformRefused(TRANSFORM_INVALID)
|
|
163
|
+
return node[segment]
|
|
164
|
+
raise TransformRefused(TRANSFORM_INVALID)
|
|
165
|
+
|
|
166
|
+
|
|
167
|
+
def apply_transform(target: Any, path: Any, value: Any) -> Any:
|
|
168
|
+
"""``target`` with the value at ``path`` replaced by ``value``: a new value, ``target`` is not changed.
|
|
169
|
+
|
|
170
|
+
Raises ``TransformRefused`` when the path is outside the grammar or does not resolve (the last
|
|
171
|
+
member must exist, an index must be in range), or when the target or the value is not JSON.
|
|
172
|
+
"""
|
|
173
|
+
segments = parse_path(path)
|
|
174
|
+
replacement = _json(value)
|
|
175
|
+
if not segments:
|
|
176
|
+
return replacement
|
|
177
|
+
out = _json(target)
|
|
178
|
+
node = out
|
|
179
|
+
for segment in segments[:-1]:
|
|
180
|
+
node = _step(node, segment)
|
|
181
|
+
last = segments[-1]
|
|
182
|
+
_step(node, last) # the place must exist: a transform rewrites, it never adds
|
|
183
|
+
node[last] = replacement
|
|
184
|
+
return out
|
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
Metadata-Version: 2.5
|
|
2
|
+
Name: brutor-runtime-hooks
|
|
3
|
+
Version: 0.2.0
|
|
4
|
+
Summary: Agent Hooks interceptor for Brutor Agent Control: governs the tool calls, prompts and answers an agent handles in its own process
|
|
5
|
+
Project-URL: Documentation, https://docs.brutor.ai/runtime-hooks/
|
|
6
|
+
Author: Brutor AI Ltd.
|
|
7
|
+
License-Expression: LicenseRef-Brutor-Enterprise-SDK
|
|
8
|
+
License-File: LICENSE
|
|
9
|
+
License-File: NOTICE
|
|
10
|
+
Keywords: agent control specification,agent framework,agent hooks,agents,approvals,claude agent sdk,governance,langgraph,openai agents,policy
|
|
11
|
+
Classifier: Development Status :: 4 - Beta
|
|
12
|
+
Classifier: Framework :: AsyncIO
|
|
13
|
+
Classifier: Intended Audience :: Developers
|
|
14
|
+
Classifier: License :: Other/Proprietary 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: Programming Language :: Python :: 3.14
|
|
22
|
+
Classifier: Programming Language :: Python :: 3.15
|
|
23
|
+
Classifier: Topic :: Security
|
|
24
|
+
Classifier: Typing :: Typed
|
|
25
|
+
Requires-Python: >=3.11
|
|
26
|
+
Requires-Dist: brutor-agent-auth<0.3,>=0.2
|
|
27
|
+
Requires-Dist: httpx<1,>=0.27
|
|
28
|
+
Provides-Extra: agent-framework
|
|
29
|
+
Requires-Dist: agent-framework-core==1.26.0; extra == 'agent-framework'
|
|
30
|
+
Requires-Dist: agent-hooks-sdk==0.1.0b3; extra == 'agent-framework'
|
|
31
|
+
Provides-Extra: bundle
|
|
32
|
+
Requires-Dist: agent-control-spec==0.4.0b2; extra == 'bundle'
|
|
33
|
+
Provides-Extra: claude-agent-sdk
|
|
34
|
+
Requires-Dist: claude-agent-sdk<0.3,>=0.2.185; extra == 'claude-agent-sdk'
|
|
35
|
+
Provides-Extra: langgraph
|
|
36
|
+
Requires-Dist: langgraph<1.3,>=1.2; extra == 'langgraph'
|
|
37
|
+
Provides-Extra: openai-agents
|
|
38
|
+
Requires-Dist: openai-agents<0.26,>=0.25; extra == 'openai-agents'
|
|
39
|
+
Description-Content-Type: text/markdown
|
|
40
|
+
|
|
41
|
+
# Brutor Agent Control — Runtime Hooks for Python (Enterprise)
|
|
42
|
+
|
|
43
|
+
Governed runtime hooks for agents that run outside the gateway.
|
|
44
|
+
|
|
45
|
+
**Edition:** Enterprise
|
|
46
|
+
|
|
47
|
+
## What it is
|
|
48
|
+
|
|
49
|
+
Runtime hooks for Brutor Agent Control. Your agent calls tools, reads prompts
|
|
50
|
+
and writes answers in its own process, out of the gateway's sight. With this package each of those
|
|
51
|
+
steps is decided by the gateway, under the same grants, argument policies, data scope, run policies,
|
|
52
|
+
guardrails and approvals as its own traffic. The decision travels as an
|
|
53
|
+
[Agent Hooks 0.1](https://github.com/responsibleai/agent-hooks) interceptor call.
|
|
54
|
+
|
|
55
|
+
The package is a client of the Enterprise Edition gateway and is licensed under the Brutor
|
|
56
|
+
Enterprise SDK Licence (see License below). You can install it and evaluate it against any gateway,
|
|
57
|
+
including an Enterprise trial. Production use needs an Enterprise licence on the gateway.
|
|
58
|
+
|
|
59
|
+
Documentation: https://docs.brutor.ai/runtime-hooks/
|
|
60
|
+
|
|
61
|
+
## Requirements
|
|
62
|
+
|
|
63
|
+
Python 3.11 or later (CI runs 3.11 to 3.15). Dependencies: `brutor-agent-auth` (>=0.2,<0.3) and `httpx`.
|
|
64
|
+
|
|
65
|
+
## Install
|
|
66
|
+
|
|
67
|
+
```bash
|
|
68
|
+
pip install brutor-runtime-hooks # the interceptor and HookSession
|
|
69
|
+
pip install 'brutor-runtime-hooks[agent-framework]' # Microsoft Agent Framework
|
|
70
|
+
pip install 'brutor-runtime-hooks[claude-agent-sdk]' # Claude Agent SDK (Python)
|
|
71
|
+
pip install 'brutor-runtime-hooks[openai-agents]' # OpenAI Agents SDK
|
|
72
|
+
pip install 'brutor-runtime-hooks[langgraph]' # LangGraph
|
|
73
|
+
pip install 'brutor-runtime-hooks[bundle]' # the local bundle cache
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
The agent authenticates with `brutor-agent-auth` (a dependency): a short-lived workload token from
|
|
77
|
+
the platform it runs on, so no secret is stored in the agent.
|
|
78
|
+
|
|
79
|
+
## Quick start
|
|
80
|
+
|
|
81
|
+
```python
|
|
82
|
+
from brutor.runtime_hooks import BrutorApprovalResolver, BrutorInterceptor, HookSession
|
|
83
|
+
|
|
84
|
+
interceptor = BrutorInterceptor() # BRUTOR_GATEWAY_URL; credential from brutor.auth.WorkloadAuth()
|
|
85
|
+
resolver = BrutorApprovalResolver(interceptor)
|
|
86
|
+
|
|
87
|
+
async with HookSession(
|
|
88
|
+
interceptor, agent_id="loan-screening", framework="langgraph", tools=["write_file"], resolver=resolver
|
|
89
|
+
) as hooks:
|
|
90
|
+
pre = await hooks.pre_tool_call("call_1", "write_file", {"path": "/letters/APP-1042.md"})
|
|
91
|
+
if pre.proceeds: # pre.target: the arguments as allowed, or as the gateway transformed them
|
|
92
|
+
result = write_file(**pre.target)
|
|
93
|
+
await hooks.post_tool_call("call_1", "write_file", pre.target, result)
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
Each step returns a `HookOutcome` (`verdict`, `proceeds`, `target`, `transformed`): act only when
|
|
97
|
+
`proceeds`, and always with `target`, which is the redacted or rewritten value after a `transform`.
|
|
98
|
+
|
|
99
|
+
Turn runtime hooks on for the AI System first (Admin Console, the AI System's Runtime hooks tab):
|
|
100
|
+
`observe` shows what `enforce` would decide and blocks nothing; `enforce` applies the decisions.
|
|
101
|
+
|
|
102
|
+
- **Microsoft Agent Framework**: `middleware=[brutor_middleware(interceptor)]` from
|
|
103
|
+
`brutor.runtime_hooks.adapters.agent_framework`. The framework is the Agent Hooks host for all
|
|
104
|
+
eight interception points.
|
|
105
|
+
- **Claude Agent SDK**: `async with BrutorClaudeSession(interceptor, options, agent_id=...) as client:`
|
|
106
|
+
from `brutor.runtime_hooks.adapters.claude_agent_sdk`. It covers prompts, tool calls and answers;
|
|
107
|
+
model calls are governed by pointing the SDK at the gateway.
|
|
108
|
+
- **OpenAI Agents SDK**: `await BrutorRunner(interceptor).run(agent, prompt)` from
|
|
109
|
+
`brutor.runtime_hooks.adapters.openai_agents`, in place of `Runner.run`. Brutor's guardrails are
|
|
110
|
+
added to copies of your agents; tools the SDK's guardrails cannot see (hosted tools, built-in
|
|
111
|
+
execution tools, agents used as tools) are refused unless you name them in `allow_uncovered`.
|
|
112
|
+
- **LangGraph**: `brutor_tool_node(tools, interceptor)` in place of `ToolNode(tools)`, and
|
|
113
|
+
`await governed_invoke(graph, inputs, config, interceptor, agent_id=...)` to run the graph. A hold
|
|
114
|
+
interrupts the graph; resuming it re-evaluates the same decision with the approval. Add
|
|
115
|
+
`BrutorState` to a checkpointed graph's state so the session survives checkpoints.
|
|
116
|
+
|
|
117
|
+
## The local bundle cache
|
|
118
|
+
|
|
119
|
+
`BrutorInterceptor(bundle=True)` evaluates Brutor's stateless tool rules in the agent's process
|
|
120
|
+
(the agent's export, fetched after `agent_startup`). A definite local deny is answered at once and
|
|
121
|
+
still recorded by the gateway; everything else, a local allow included, is decided by the gateway.
|
|
122
|
+
It is off by default.
|
|
123
|
+
|
|
124
|
+
## An agent reached as a delegate
|
|
125
|
+
|
|
126
|
+
An agent that another agent calls through the gateway receives the delegation in
|
|
127
|
+
`x-brutor-delegation-*` headers. Start its session with them, and send the run handle (never the
|
|
128
|
+
delegation headers) on its own gateway calls:
|
|
129
|
+
|
|
130
|
+
```python
|
|
131
|
+
from brutor.runtime_hooks import HookSession, delegation_from_headers
|
|
132
|
+
|
|
133
|
+
async with HookSession(
|
|
134
|
+
interceptor, agent_id="fraud-screener", framework="custom", delegation=delegation_from_headers(request.headers)
|
|
135
|
+
) as hooks:
|
|
136
|
+
headers = hooks.outbound_headers({"Content-Type": "application/json"}) # X-Brutor-Run-Id
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
The adapters take the same `delegation=` argument.
|
|
140
|
+
|
|
141
|
+
## Failing closed
|
|
142
|
+
|
|
143
|
+
When the gateway gives no usable decision (an error, a timeout, an answer that is not a valid
|
|
144
|
+
verdict), `BrutorInterceptor` raises `DecisionUnavailable` and the host denies the step.
|
|
145
|
+
`HookSession` and the adapters do this for you. The SDK never logs a credential, a run handle, an
|
|
146
|
+
approval token or the content of a step. Content that the gateway's checks do not read is replaced
|
|
147
|
+
by its hash before it is sent.
|
|
148
|
+
|
|
149
|
+
## Development
|
|
150
|
+
|
|
151
|
+
From `sdk/enterprise/python/brutor-runtime-hooks` in the Brutor Agent Control repository (tools
|
|
152
|
+
pinned in `requirements-dev.txt`). The `sdk-enterprise.yml` workflow runs these gates:
|
|
153
|
+
|
|
154
|
+
```bash
|
|
155
|
+
python -m pip install -r requirements-dev.txt -e ../../../python/brutor-agent-auth -e '.[agent-framework,claude-agent-sdk,openai-agents,langgraph,bundle]'
|
|
156
|
+
ruff check . && ruff format --check .
|
|
157
|
+
mypy --strict src
|
|
158
|
+
python scripts/env_registry.py --check
|
|
159
|
+
python -m pytest # fails below 95% coverage
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
## Documentation
|
|
163
|
+
|
|
164
|
+
https://docs.brutor.ai/runtime-hooks/
|
|
165
|
+
|
|
166
|
+
## Security
|
|
167
|
+
|
|
168
|
+
See SECURITY.md at the repository root.
|
|
169
|
+
|
|
170
|
+
## License
|
|
171
|
+
|
|
172
|
+
Proprietary: the Brutor Enterprise SDK Licence (see `LICENSE`). It is not an open-source license.
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
brutor/runtime_hooks/__init__.py,sha256=PNtjGqEclHLlrMIGhHNuI5F5Ko_hfeAICWLzQb_5XsI,2050
|
|
2
|
+
brutor/runtime_hooks/_delegation.py,sha256=wHECg9vuZlDRxMVKSjr2UhBCXV68Jy471HtBmIFM0eo,4274
|
|
3
|
+
brutor/runtime_hooks/_env.py,sha256=aTjbFUXnKWFkA5_ICJVL7c1RYmhITI0O_KTRQRyyI8I,1425
|
|
4
|
+
brutor/runtime_hooks/_http.py,sha256=_kfj-J_O644ACWQiPK8inloC6kCCRoI5-2fZ2Okt4lk,7133
|
|
5
|
+
brutor/runtime_hooks/_jcs.py,sha256=CNVlNmLKZoVilo_aAos53B1kidMoYvV8fGHPtW4zg0o,4116
|
|
6
|
+
brutor/runtime_hooks/_verdict.py,sha256=ZT3-fEoT7-pGQJTDWa3L8IrQrXv2tefrps4oRmnBphc,7319
|
|
7
|
+
brutor/runtime_hooks/bundle.py,sha256=1bpwz7dqlB536wkO00GoxAMYJvfM5fAUaw83iVb-JMA,12469
|
|
8
|
+
brutor/runtime_hooks/errors.py,sha256=eNYmc3Mb7_sFzPw5t0v6imvfKlVzUliLlFPEZjtY0T0,3790
|
|
9
|
+
brutor/runtime_hooks/interceptor.py,sha256=dnY-_X535X5ljbgWtG8IZa5iFc74FCN7iGSNMhpiFOA,24097
|
|
10
|
+
brutor/runtime_hooks/minimise.py,sha256=jS8E3RSxfUcRdjLRIpD-ys-z4BknBWX8_qabfXT8mgk,3809
|
|
11
|
+
brutor/runtime_hooks/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
12
|
+
brutor/runtime_hooks/resolver.py,sha256=EmUiQ5njAbK7kxAq8h6iE4ZtAYSZ2U3E-pYuEUkJNHk,8230
|
|
13
|
+
brutor/runtime_hooks/session.py,sha256=HiC7mdPjo4ypDGOEwRGgU9adIQNGQSNe04JtqN8Ujog,25024
|
|
14
|
+
brutor/runtime_hooks/transform.py,sha256=8dQcYwn2qu6OVQxx9c5ZZgYg6HZxSe8p67ELJGtN74s,7461
|
|
15
|
+
brutor/runtime_hooks/adapters/__init__.py,sha256=C-KbROiscU7qNbmmP132zlm3gFErhWI3rg8I5yJyB5Y,981
|
|
16
|
+
brutor/runtime_hooks/adapters/agent_framework.py,sha256=6a252R3G4mc4nTmfSCKtY9l-YW1_ztQkzgJ8UC8gT_M,5062
|
|
17
|
+
brutor/runtime_hooks/adapters/claude_agent_sdk.py,sha256=XrKfwum4oaYN8NOgTEIPVd_-keNY9XfbNscKNzzYVeE,16638
|
|
18
|
+
brutor/runtime_hooks/adapters/langgraph.py,sha256=Pm_gFopxmNNLUKbvotLAXxWV-V06xhzKzhuy54RgMS0,27658
|
|
19
|
+
brutor/runtime_hooks/adapters/openai_agents.py,sha256=psjISfB-jYaoqIt0_D84NiJ1iv3ItGNgiZtHWYkYx8M,20590
|
|
20
|
+
brutor_runtime_hooks-0.2.0.dist-info/METADATA,sha256=icfw8OOPdINZwHrAZuN9TuuLkcy2FUvKNMrVDSKOOL0,8058
|
|
21
|
+
brutor_runtime_hooks-0.2.0.dist-info/WHEEL,sha256=2iZrJkDIkeDh0k9SikKMqFuRP-ua6mb4Ir1AsER4BEw,87
|
|
22
|
+
brutor_runtime_hooks-0.2.0.dist-info/licenses/LICENSE,sha256=DoPgR7375x75Ax0c4h6bffhiCn2u8ohK1lIkAuRvU4Q,3814
|
|
23
|
+
brutor_runtime_hooks-0.2.0.dist-info/licenses/NOTICE,sha256=9hCCSHTiAf39qwPfKz1VyJzZdzbWaEEImdV9ppfhJkA,1224
|
|
24
|
+
brutor_runtime_hooks-0.2.0.dist-info/RECORD,,
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
Brutor Enterprise SDK Licence, version 1.0 (1 December 2026)
|
|
2
|
+
Copyright 2026 Brutor AI Ltd. All rights reserved.
|
|
3
|
+
SPDX-License-Identifier: LicenseRef-Brutor-Enterprise-SDK
|
|
4
|
+
|
|
5
|
+
This licence covers the Brutor Agent Control Enterprise SDKs: brutor-runtime-hooks (PyPI),
|
|
6
|
+
@brutor-ai/runtime-hooks (npm), and Brutor.RuntimeHooks, Brutor.RuntimeHooks.AgentFramework and
|
|
7
|
+
Brutor.RuntimeHooks.Bundle (NuGet), in every version published with this file (the "SDK").
|
|
8
|
+
The licensor is Brutor AI Ltd, a company registered in England and Wales ("Brutor AI").
|
|
9
|
+
"You" means the person or organisation that installs or uses the SDK.
|
|
10
|
+
|
|
11
|
+
The SDK is a client of the Brutor Agent Control Enterprise Edition gateway. An "Enterprise
|
|
12
|
+
licence" is a licence key issued by Brutor AI for the Enterprise Edition (BRUTOR_LICENSE_KEY),
|
|
13
|
+
either a trial licence or an Enterprise licence, that has not expired.
|
|
14
|
+
|
|
15
|
+
1. What you may do without a subscription. You may install the SDK, read its source code, and
|
|
16
|
+
run it to develop and evaluate your own software against any Brutor Agent Control gateway,
|
|
17
|
+
including an Enterprise Edition trial.
|
|
18
|
+
You may change the SDK for your own internal use, for example to debug it.
|
|
19
|
+
2. Production use. Using the SDK with real users, data or workloads requires that every gateway
|
|
20
|
+
it talks to runs under a valid Enterprise licence. A trial licence counts while it is valid.
|
|
21
|
+
3. Redistribution. You may distribute the SDK only unmodified and only as a dependency of your
|
|
22
|
+
own application: declared in its package manifest, or inside its container image or installer,
|
|
23
|
+
with this file and the NOTICE file kept.
|
|
24
|
+
You may not sell, sublicense or publish the SDK as a package of its own, or distribute a
|
|
25
|
+
modified copy.
|
|
26
|
+
4. Restrictions. You may not remove or change a licence or copyright notice in the SDK, or use
|
|
27
|
+
the SDK to get around a licence check, feature flag or limit of the Enterprise Edition.
|
|
28
|
+
5. Ownership. Brutor AI and its licensors keep every right this licence does not expressly
|
|
29
|
+
grant. "Brutor" and the Brutor logos are trademarks of Brutor AI Ltd; this licence grants no
|
|
30
|
+
right to use them.
|
|
31
|
+
6. Third-party components. Parts of the SDK come from other authors and are listed in NOTICE.
|
|
32
|
+
Each stays under its own licence, which governs that part instead of this one. Packages the
|
|
33
|
+
SDK depends on, or names as optional, are installed by you from their own registries under
|
|
34
|
+
their own terms; Brutor AI does not distribute them.
|
|
35
|
+
7. No warranty. THE SDK IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
|
|
36
|
+
INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
|
|
37
|
+
PURPOSE AND NONINFRINGEMENT.
|
|
38
|
+
8. Limitation of liability. To the fullest extent the law allows, Brutor AI is not liable for
|
|
39
|
+
any indirect, incidental, special or consequential loss, or for loss of profits, data, use or
|
|
40
|
+
goodwill, arising from the SDK or its use, whether in contract, tort or otherwise. Brutor AI's
|
|
41
|
+
total liability under this licence is limited to one hundred pounds sterling (GBP 100).
|
|
42
|
+
Nothing in this licence limits liability for death or personal injury caused by negligence,
|
|
43
|
+
for fraud or fraudulent misrepresentation, or for anything else the law does not allow to be
|
|
44
|
+
limited.
|
|
45
|
+
9. Termination. This licence ends automatically if you break it. You must then stop using and
|
|
46
|
+
distributing the SDK. Sections 5 to 11 survive.
|
|
47
|
+
10. Your agreement with Brutor AI. If you have a signed agreement with Brutor AI for the
|
|
48
|
+
Enterprise Edition, that agreement prevails over this licence where they conflict.
|
|
49
|
+
11. Governing law. This licence is governed by the laws of England and Wales, and the courts of
|
|
50
|
+
England and Wales have exclusive jurisdiction.
|
|
51
|
+
|
|
52
|
+
Questions about this licence: legal@brutor.ai. An Enterprise licence or a trial: hello@brutor.ai.
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
Brutor Agent Control Enterprise SDK: brutor-runtime-hooks
|
|
2
|
+
Copyright 2026 Brutor AI Ltd. All rights reserved.
|
|
3
|
+
Licensed under the Brutor Enterprise SDK Licence (see LICENSE).
|
|
4
|
+
|
|
5
|
+
Software this package works with but does not distribute
|
|
6
|
+
|
|
7
|
+
You install these yourself from PyPI, as dependencies or optional extras.
|
|
8
|
+
Each one is under its own licence:
|
|
9
|
+
|
|
10
|
+
brutor-agent-auth Brutor AI Ltd, Apache License 2.0
|
|
11
|
+
httpx BSD 3-Clause License
|
|
12
|
+
agent-hooks-sdk 0.1.0b3 Microsoft Corporation, MIT License
|
|
13
|
+
(extra agent-framework)
|
|
14
|
+
agent-framework-core 1.26.0 Microsoft Corporation, MIT License
|
|
15
|
+
(extra agent-framework)
|
|
16
|
+
agent-control-spec 0.4.0b2 Microsoft Corporation, MIT License (extra bundle)
|
|
17
|
+
claude-agent-sdk >=0.2.185,<0.3
|
|
18
|
+
MIT License per its package metadata; its
|
|
19
|
+
platform wheels also contain the Claude Code
|
|
20
|
+
program, which is under Anthropic's terms
|
|
21
|
+
(extra claude-agent-sdk)
|
|
22
|
+
openai-agents >=0.25,<0.26 MIT License (extra openai-agents)
|
|
23
|
+
langgraph >=1.2,<1.3 MIT License (extra langgraph)
|