Python SDK for AgentBox private agent state and scoped sharing.
Project description
AgentBox Python SDK
Python SDK for AgentBox private agent state and scoped sharing.
Install
python3 -m pip install niuniu-agentbox
Import the SDK as agentbox:
from agentbox import AgentBoxClient
Discovery And Workflow
import os
from agentbox import (
bootstrap_agentbox_agent,
client_for_grant,
create_private_box_with_resources,
create_scoped_read_grant,
)
session = bootstrap_agentbox_agent(
base_url="https://agentbox.niuniu.dev",
client={
"identity_token": os.environ["RESEARCH_OIDC_JWT"],
"auth_scheme": "google",
},
registration={
"display_name": "Research Agent",
"capabilities": ["research"],
},
)
workspace = create_private_box_with_resources(session.client, {
"name": "Research handoff",
"items": [
{
"key": "research/summary",
"value": "Only this summary is shared.",
"expected_version": 0,
},
{
"key": "state/internal",
"value": "Private notes stay hidden.",
"expected_version": 0,
},
],
})
grant = create_scoped_read_grant(session.client, {
"box_id": workspace["box"]["box_id"],
"subject": "writer-agent",
"key_prefixes": ["research/"],
"ttl_seconds": 3600,
})
writer = client_for_grant(
session.client,
grant,
identity_token=os.environ["WRITER_OIDC_JWT"],
auth_scheme="google",
)
manifest = writer.get_manifest({"box_id": workspace["box"]["box_id"]})
Auth Modes
AgentBox clients authenticate with OIDC identity tokens. Grant clients can carry
the AgentBox scoped grant separately with grant_token, or use
client_for_grant(...) to derive a least-privilege client from a grant response.
Pass auth_scheme for named providers such as google.
Methods
health()
discover_agentbox(base_url=... | agent_card_url=...)
bootstrap_agentbox_agent(...)
create_private_box_with_resources(client, data)
create_scoped_read_grant(client, data)
client_for_grant(client, grant, ...)
register_agent(data=None)
get_agent_profile()
create_box(data)
list_boxes()
get_manifest({"box_id": ...})
put_item(data)
get_item(data)
list_items(data)
append_event(data)
list_events(data)
attach_artifact(data)
list_artifacts({"box_id": ...})
get_artifact(data)
create_grant(data)
list_grants({"box_id": ...})
revoke_grant(data)
with_auth(identity_token=None, grant_token=None, auth_scheme=None)
Non-2xx responses and AgentBox { "ok": false } responses raise
AgentBoxApiError.
License
MIT
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file niuniu_agentbox-0.1.2.tar.gz.
File metadata
- Download URL: niuniu_agentbox-0.1.2.tar.gz
- Upload date:
- Size: 9.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ca5614fc549c9b4cd51aa8ff40c48ce3181b8b387171ffdd12543d7e7ca023d5
|
|
| MD5 |
98b6a39bbf6cfb087ffd2cc46adcf78d
|
|
| BLAKE2b-256 |
0dc5880dcfbc53bb4f7061bc606df319c0b31a01833e9b84830ae208c1f12312
|
Provenance
The following attestation bundles were made for niuniu_agentbox-0.1.2.tar.gz:
Publisher:
publish-sdk.yml on pengmu/agent-box
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
niuniu_agentbox-0.1.2.tar.gz -
Subject digest:
ca5614fc549c9b4cd51aa8ff40c48ce3181b8b387171ffdd12543d7e7ca023d5 - Sigstore transparency entry: 1630876206
- Sigstore integration time:
-
Permalink:
pengmu/agent-box@2227d53e3c0f9a260f41d55ef5cdba5141c3194b -
Branch / Tag:
refs/heads/main - Owner: https://github.com/pengmu
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-sdk.yml@2227d53e3c0f9a260f41d55ef5cdba5141c3194b -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file niuniu_agentbox-0.1.2-py3-none-any.whl.
File metadata
- Download URL: niuniu_agentbox-0.1.2-py3-none-any.whl
- Upload date:
- Size: 9.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5fb7722532db3335396f7daa96c07b668883988349c6e5d75c0d0d0d78e1c83d
|
|
| MD5 |
cb72a728455057c8ceaf898174018515
|
|
| BLAKE2b-256 |
7d4bc91f1ed8ab8fd76616f4ef8502ee7490fd5168b559579b47166da151bb4c
|
Provenance
The following attestation bundles were made for niuniu_agentbox-0.1.2-py3-none-any.whl:
Publisher:
publish-sdk.yml on pengmu/agent-box
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
niuniu_agentbox-0.1.2-py3-none-any.whl -
Subject digest:
5fb7722532db3335396f7daa96c07b668883988349c6e5d75c0d0d0d78e1c83d - Sigstore transparency entry: 1630876220
- Sigstore integration time:
-
Permalink:
pengmu/agent-box@2227d53e3c0f9a260f41d55ef5cdba5141c3194b -
Branch / Tag:
refs/heads/main - Owner: https://github.com/pengmu
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-sdk.yml@2227d53e3c0f9a260f41d55ef5cdba5141c3194b -
Trigger Event:
workflow_dispatch
-
Statement type: