Python SDK for AgentBox private agent state and scoped sharing.
Project description
AgentBox Python SDK
niuniu-agentbox is a small Python wrapper around the AgentBox REST API for agent
developers and application developers.
from agentbox import AgentBoxClient
client = AgentBoxClient(
base_url="http://127.0.0.1:3000",
actor="research-agent",
token="dev-token",
)
created = client.create_box({"name": "Research agent private store"})
box_id = created["data"]["box"]["box_id"]
client.put_item({
"box_id": box_id,
"key": "research/summary",
"value": "AgentBox stores durable state.",
"expected_version": 0,
})
The SDK supports the same auth modes as the JavaScript SDK:
- local/admin or grant compatibility auth:
actor+token - OIDC auth:
identity_token - optional
grant_tokenfor OIDC callers using an AgentBox grant
With OIDC, the identity proof and AgentBox grant token are sent separately:
writer = AgentBoxClient(
base_url="https://agent-box.example",
identity_token="oidc.jwt.token",
grant_token="abx_grant_token",
)
Use with_auth() to derive a client with different credentials:
grant = client.create_grant({
"box_id": box_id,
"subject": "writer-agent",
"permissions": ["read"],
"key_prefixes": ["research/"],
"ttl_seconds": 3600,
})
writer = client.with_auth(
actor="writer-agent",
token=grant["data"]["access_token"],
)
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()
list_agents(admin=True)
update_agent_status({"identity_key": ..., "status": "blocked"}, admin=True)
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)
list_audit({"box_id": ...})
with_auth(actor=None, token=None, identity_token=None, grant_token=None, auth_scheme=None)
Non-2xx responses and AgentBox { "ok": false } responses raise
AgentBoxApiError.
Release Check
python3 -m pip wheel packages/sdk-python --no-deps --wheel-dir /tmp/niuniu-agentbox-python-wheel
Publishing is not enabled until the project owner confirms PyPI namespace, package credentials, and versioning.
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.0.tar.gz.
File metadata
- Download URL: niuniu_agentbox-0.1.0.tar.gz
- Upload date:
- Size: 9.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1595efee1ce8d202c739293258ea49d2235fb12b76e0bf52525c789cf7aa4fe6
|
|
| MD5 |
6f35583684bbabc4225674c358922d8d
|
|
| BLAKE2b-256 |
88456b512c75752e5d0a98332b98fa090f6269a32780056674ae11a753baca0f
|
Provenance
The following attestation bundles were made for niuniu_agentbox-0.1.0.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.0.tar.gz -
Subject digest:
1595efee1ce8d202c739293258ea49d2235fb12b76e0bf52525c789cf7aa4fe6 - Sigstore transparency entry: 1630786633
- Sigstore integration time:
-
Permalink:
pengmu/agent-box@d6fb76e376cee8918197ce6a02f28ef380e73fc9 -
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@d6fb76e376cee8918197ce6a02f28ef380e73fc9 -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file niuniu_agentbox-0.1.0-py3-none-any.whl.
File metadata
- Download URL: niuniu_agentbox-0.1.0-py3-none-any.whl
- Upload date:
- Size: 8.8 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 |
cbf6a80d5039e6259b1e53b09cb5c4fd00266de9dbec63884682a2e097256b95
|
|
| MD5 |
1173c75ffa465e630bc8fad496c87837
|
|
| BLAKE2b-256 |
4d3a090cf57fc0ebe35d5125a1536a54246247a194c8b3757458220bd89d387e
|
Provenance
The following attestation bundles were made for niuniu_agentbox-0.1.0-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.0-py3-none-any.whl -
Subject digest:
cbf6a80d5039e6259b1e53b09cb5c4fd00266de9dbec63884682a2e097256b95 - Sigstore transparency entry: 1630786671
- Sigstore integration time:
-
Permalink:
pengmu/agent-box@d6fb76e376cee8918197ce6a02f28ef380e73fc9 -
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@d6fb76e376cee8918197ce6a02f28ef380e73fc9 -
Trigger Event:
workflow_dispatch
-
Statement type: