backplanes 0.2.0__tar.gz → 0.2.1__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.
- {backplanes-0.2.0 → backplanes-0.2.1}/PKG-INFO +2 -2
- {backplanes-0.2.0 → backplanes-0.2.1}/README.md +1 -1
- {backplanes-0.2.0 → backplanes-0.2.1}/backplanes/__init__.py +2 -1
- {backplanes-0.2.0 → backplanes-0.2.1}/backplanes/_core.py +4 -3
- {backplanes-0.2.0 → backplanes-0.2.1}/backplanes.egg-info/PKG-INFO +2 -2
- {backplanes-0.2.0 → backplanes-0.2.1}/pyproject.toml +1 -1
- {backplanes-0.2.0 → backplanes-0.2.1}/tests/test_sdk.py +9 -0
- {backplanes-0.2.0 → backplanes-0.2.1}/LICENSE +0 -0
- {backplanes-0.2.0 → backplanes-0.2.1}/backplanes/_peer.py +0 -0
- {backplanes-0.2.0 → backplanes-0.2.1}/backplanes/_policy.py +0 -0
- {backplanes-0.2.0 → backplanes-0.2.1}/backplanes/_proto/__init__.py +0 -0
- {backplanes-0.2.0 → backplanes-0.2.1}/backplanes/_proto/collector_pb2.py +0 -0
- {backplanes-0.2.0 → backplanes-0.2.1}/backplanes/_proto/collector_pb2_grpc.py +0 -0
- {backplanes-0.2.0 → backplanes-0.2.1}/backplanes/_proto/redaction_pb2.py +0 -0
- {backplanes-0.2.0 → backplanes-0.2.1}/backplanes/_proto/spotlight_pb2.py +0 -0
- {backplanes-0.2.0 → backplanes-0.2.1}/backplanes/_spans.py +0 -0
- {backplanes-0.2.0 → backplanes-0.2.1}/backplanes/claude.py +0 -0
- {backplanes-0.2.0 → backplanes-0.2.1}/backplanes/openai_agents.py +0 -0
- {backplanes-0.2.0 → backplanes-0.2.1}/backplanes.egg-info/SOURCES.txt +0 -0
- {backplanes-0.2.0 → backplanes-0.2.1}/backplanes.egg-info/dependency_links.txt +0 -0
- {backplanes-0.2.0 → backplanes-0.2.1}/backplanes.egg-info/requires.txt +0 -0
- {backplanes-0.2.0 → backplanes-0.2.1}/backplanes.egg-info/top_level.txt +0 -0
- {backplanes-0.2.0 → backplanes-0.2.1}/setup.cfg +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: backplanes
|
|
3
|
-
Version: 0.2.
|
|
3
|
+
Version: 0.2.1
|
|
4
4
|
Summary: Backplanes SDK: agent telemetry, tool policy and peer identity for AI agents.
|
|
5
5
|
License-Expression: LicenseRef-Proprietary
|
|
6
6
|
Classifier: Programming Language :: Python :: 3
|
|
@@ -50,7 +50,7 @@ That's it for the Claude Agent SDK and the OpenAI Agents SDK. For other framewor
|
|
|
50
50
|
| Setting | Environment | Default |
|
|
51
51
|
| --- | --- | --- |
|
|
52
52
|
| `agent` | `BACKPLANES_AGENT_NAME` | required |
|
|
53
|
-
| `api_key` | `BACKPLANES_API_KEY` | required: a v1 API key (`bpk_v1_…`) or an agent key (`AK_…`) |
|
|
53
|
+
| `api_key` | `BACKPLANES_API_KEY` | required: a v1 API key (`bpk_v1_…`) or an agent key (`bpak_v1_…`, or `AK_…` from before it) |
|
|
54
54
|
| `endpoint` | `BACKPLANES_ENDPOINT` | `https://api.backplanes.com` |
|
|
55
55
|
| | `BACKPLANES_TLS_CA_FILE` | system roots |
|
|
56
56
|
| | `BACKPLANES_CAPTURE_CONTENT` | `1`: prompts, tool arguments and results are sent. `0` sends tool calls without them. |
|
|
@@ -22,7 +22,7 @@ That's it for the Claude Agent SDK and the OpenAI Agents SDK. For other framewor
|
|
|
22
22
|
| Setting | Environment | Default |
|
|
23
23
|
| --- | --- | --- |
|
|
24
24
|
| `agent` | `BACKPLANES_AGENT_NAME` | required |
|
|
25
|
-
| `api_key` | `BACKPLANES_API_KEY` | required: a v1 API key (`bpk_v1_…`) or an agent key (`AK_…`) |
|
|
25
|
+
| `api_key` | `BACKPLANES_API_KEY` | required: a v1 API key (`bpk_v1_…`) or an agent key (`bpak_v1_…`, or `AK_…` from before it) |
|
|
26
26
|
| `endpoint` | `BACKPLANES_ENDPOINT` | `https://api.backplanes.com` |
|
|
27
27
|
| | `BACKPLANES_TLS_CA_FILE` | system roots |
|
|
28
28
|
| | `BACKPLANES_CAPTURE_CONTENT` | `1`: prompts, tool arguments and results are sent. `0` sends tool calls without them. |
|
|
@@ -50,7 +50,8 @@ def init(
|
|
|
50
50
|
"""Enroll this process as `agent`, export its spans to Backplanes, and load its policy.
|
|
51
51
|
|
|
52
52
|
`api_key` (default ``BACKPLANES_API_KEY``) is a v1 API key (``bpk_v1_…``), which registers
|
|
53
|
-
the agent, or an agent key (``AK_…``). `endpoint`
|
|
53
|
+
the agent, or an agent key (``bpak_v1_…``, or ``AK_…`` from before it). `endpoint`
|
|
54
|
+
defaults to ``BACKPLANES_ENDPOINT``.
|
|
54
55
|
If Backplanes can't be reached, this logs the error and the app runs without it.
|
|
55
56
|
"""
|
|
56
57
|
with _init_lock:
|
|
@@ -27,7 +27,7 @@ from opentelemetry.sdk.trace.export import BatchSpanProcessor
|
|
|
27
27
|
from backplanes._proto import collector_pb2 as pb
|
|
28
28
|
from backplanes._proto import collector_pb2_grpc as rpc
|
|
29
29
|
|
|
30
|
-
VERSION = "0.2.
|
|
30
|
+
VERSION = "0.2.1"
|
|
31
31
|
SCOPE = "com.backplanes.sdk.python"
|
|
32
32
|
AGENT_KEY_HEADER = "x-backplanes-agent-key"
|
|
33
33
|
DEFAULT_ENDPOINT = "https://api.backplanes.com"
|
|
@@ -98,8 +98,9 @@ def signing_key(api_key: str) -> tuple[str, str]:
|
|
|
98
98
|
|
|
99
99
|
def enroll(api_key: str, agent: str, endpoint: str, ca_file: str | None) -> Identity:
|
|
100
100
|
"""A v1 API key registers `agent` and runs with the agent key it returns; an agent key
|
|
101
|
-
(`AK_…`) is used as is (its agent and org come back with
|
|
102
|
-
|
|
101
|
+
(`bpak_v1_…`, or `AK_…` from before it) is used as is (its agent and org come back with
|
|
102
|
+
the first policy fetch)."""
|
|
103
|
+
if api_key.startswith(("bpak_v1_", "AK_")):
|
|
103
104
|
return Identity(endpoint, ca_file, api_key, agent)
|
|
104
105
|
response = stub(Identity(endpoint, ca_file, "", agent)).RegisterAgent(
|
|
105
106
|
pb.RegisterAgentRequest(
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: backplanes
|
|
3
|
-
Version: 0.2.
|
|
3
|
+
Version: 0.2.1
|
|
4
4
|
Summary: Backplanes SDK: agent telemetry, tool policy and peer identity for AI agents.
|
|
5
5
|
License-Expression: LicenseRef-Proprietary
|
|
6
6
|
Classifier: Programming Language :: Python :: 3
|
|
@@ -50,7 +50,7 @@ That's it for the Claude Agent SDK and the OpenAI Agents SDK. For other framewor
|
|
|
50
50
|
| Setting | Environment | Default |
|
|
51
51
|
| --- | --- | --- |
|
|
52
52
|
| `agent` | `BACKPLANES_AGENT_NAME` | required |
|
|
53
|
-
| `api_key` | `BACKPLANES_API_KEY` | required: a v1 API key (`bpk_v1_…`) or an agent key (`AK_…`) |
|
|
53
|
+
| `api_key` | `BACKPLANES_API_KEY` | required: a v1 API key (`bpk_v1_…`) or an agent key (`bpak_v1_…`, or `AK_…` from before it) |
|
|
54
54
|
| `endpoint` | `BACKPLANES_ENDPOINT` | `https://api.backplanes.com` |
|
|
55
55
|
| | `BACKPLANES_TLS_CA_FILE` | system roots |
|
|
56
56
|
| | `BACKPLANES_CAPTURE_CONTENT` | `1`: prompts, tool arguments and results are sent. `0` sends tool calls without them. |
|
|
@@ -32,6 +32,15 @@ def test_a_key_with_a_bad_checksum_is_refused():
|
|
|
32
32
|
_core.signing_key(VECTOR_KEY[:-1] + ("0" if VECTOR_KEY[-1] != "0" else "1"))
|
|
33
33
|
|
|
34
34
|
|
|
35
|
+
AGENT_KEY_V1 = "bpak_v1_" + "A" * 22 + "." + "B" * 43 + ".0123abcd"
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
@pytest.mark.parametrize("agent_key", [AGENT_KEY_V1, "AK_abcd1234.secret"])
|
|
39
|
+
def test_an_agent_key_is_used_as_is_without_registering(agent_key, monkeypatch):
|
|
40
|
+
monkeypatch.setattr(_core, "stub", lambda *_: pytest.fail("an agent key must not register"))
|
|
41
|
+
assert _core.enroll(agent_key, "a", "http://x", None).agent_key == agent_key
|
|
42
|
+
|
|
43
|
+
|
|
35
44
|
@pytest.mark.parametrize(
|
|
36
45
|
("arguments", "expected"),
|
|
37
46
|
[
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|