Python SDK

From the public repository checkout, install the source package:

1python -m pip install ./sdk/python

Python 3.10+ is required. Supply a short-lived access token through your runtime’s secret manager after authentication.

1import os
2from agenttrunk import AgentTrunk
3from agenttrunk.verified import read_verified_file
4
5client = AgentTrunk(access_token=lambda: os.environ["AGENTTRUNK_ACCESS_TOKEN"])
6page = client.workspaces.list()
7# Select the intended workspace; continue next_cursor when present.
8
9content = read_verified_file(
10 client,
11 os.environ["AGENTTRUNK_WORKSPACE_ID"],
12 os.environ["AGENTTRUNK_CONTEXT_KEY"],
13 os.environ["AGENTTRUNK_REVISION_ID"],
14 "SKILL.md",
15)
16# Supply an actual immutable revision ID, not "production".

The helper checks the manifest, byte count, and SHA-256. AsyncAgentTrunk and async_read_verified_file provide the asynchronous equivalent. Response fields use snake_case, including next_cursor and revision_id.

The client does not read .env files automatically. Default retries are zero; writes are not automatically retried. See the Python reference for resource methods and configuration, and the language examples for runnable requests.