Skip to main content

act-sdk

Python SDK for building ACT (Agent Component Tools) components — sandboxed WASM tools for AI agents that work across MCP, HTTP, CLI, and browser hosts.

Install

Requires Python 3.14+.

uv add act-sdk
# or
pip install act-sdk

Quick start

from act_sdk import component, tool, ActError

@component
class MyComponent:
    @tool(description="Say hello", read_only=True)
    async def hello(self, name: str = "world") -> str:
        return f"Hello, {name}!"

    @tool(description="Divide two numbers")
    async def divide(self, a: float, b: float) -> float:
        if b == 0:
            raise ActError("std:invalid-args", "Cannot divide by zero")
        return a / b

Package with componentize-py + act-build pack to produce a .wasm component that exposes these tools over every ACT transport.

What you get

  • @component — declares the class as an ACT component. Generates the act:tools/tool-provider@0.2.0 WIT export.
  • @tool — declares a method as a tool. Parameters, return type, and docstrings become the JSON Schema automatically (via type hints).
  • ActError("std:kind", "message") — raise this from a tool body to produce a structured tool-error the host forwards to the caller.
  • Json[T] / Content(mime, data) — explicit return types for when you need control over the wire format; otherwise returns are CBOR-encoded.
  • Bytes(data) — a binary value. Serializes to a CBOR byte string — the {"$bytes": "<base64>"} envelope on JSON transports — and its JSON Schema is that envelope. Use it for binary tool parameters and structured byte-string results. (For a raw mime-typed blob use Content(mime, data); for an opaque octet-stream return plain bytes.)

Tool naming

Tool method names are exposed as-is (snake_case). async def get_weather(...) becomes the tool name get_weather on the wire. See the tool naming guidelines for the recommended style.

Capabilities

Declare host capabilities inline in pyproject.toml:

[project]
name = "my-component"
version = "0.1.0"
description = "..."

[tool.act.std.capabilities."wasi:http"]

act-build pack picks up [tool.act] and embeds it in the component's act:component custom section. The component cannot reach the network unless the host links wasi:http at load time. Filesystem, sockets, and other WASI capabilities follow the same pattern.

A separate act.toml also works as a last-wins override layer if you need to keep capability metadata out of your build configuration — but for most components, inline pyproject.toml is the recommended source of truth.

License

MIT OR Apache-2.0

Metadata

Release files for act-sdk 0.6.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for act-sdk 0.6.0
File Size Uploaded
act_sdk-0.6.0.tar.gz 39.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for act-sdk 0.6.0
File Interpreter ABI Platform
act_sdk-0.6.0-py3-none-any.whl Python 3 none any Details

Total release size: 56.5 kB

Release files / act_sdk-0.6.0.tar.gz

Download URL act_sdk-0.6.0.tar.gz
Size 39.2 kB
Tags Source
SHA-256 checksum
How to use checksums
6a6e78b25c824a70edebbbcbfa3502748d78ac94873d24e402be00f374f03242
BLAKE2b-256 checksum
How to use checksums
a90cf0c849a734df6b1f5a6d1de7c1488d9390a31f428a0d9f2cc05fc6940cf1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jun 29, 2026.

Transparency log

Release files / act_sdk-0.6.0-py3-none-any.whl

Download URL act_sdk-0.6.0-py3-none-any.whl
Size 17.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
254fb73cca775fd8dd2d10fb646282035b9c769178dc4f24a9fad4e849dec0ea
BLAKE2b-256 checksum
How to use checksums
d773494dd31d74baba67f8d4a2872cea423ee99e0966ab8c08e8b7b91f5da9dd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jun 29, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.6.0 This release

2 release files

0.4.0

2 release files

0.2.0

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page