Skip to main content

app-sdk (zetify_app)

The Python app SDK — the one client a customer app imports to reach the platform from inside a daemon-hosted sandbox.

The governed verbs

The platform's governed callback surface has four legs — query, action, synthesize and fold_write. open_app() returns the handle you hold for the whole invocation; call the three legs this SDK exposes a method for on it as many times as you need:

import zetify_app

with zetify_app.open_app() as app:
    rows = app.query("customers.list", {"limit": 10})  # the READ leg
    created = app.action("orders.create", {"sku": "widget"})  # the WRITE leg
    digest = app.synthesize("reports.summarize", {"doc_id": "d1"})

Each verb returns the decoded summary from the broker's Response. params is placed on the wire as a JSON object — brokeruds.Request.ParamsJSON is a json.RawMessage that the daemon forwards verbatim as the upstream request body, so it must never be pre-serialised into a JSON string.

The fourth leg, fold_write (/v1/folds/{fold}), is what a manifest-declared write fold writes through. This SDK exposes no method for it — it is reachable only through the lower-level zetify_app.connect() seam, and no shipped app uses it today.

app.action is the only leg that may carry out_path, naming a local file inside the invocation's file-scope root whose bytes the daemon merges into the upstream call — that is how a result larger than the 1 MiB wire frame reaches the platform without crossing the socket.

Refusals are typed, never wire-shaped. A platform refusal raises LimitExceeded / PolicyDenied / PlatformRefusal / AppUsageError (all under ZetifyAppError), and an outcome token this SDK version does not yet recognise still surfaces as a catchable PlatformRefusal with the raw token on .outcome — never dropped.

Ceilings, never hand-copied. app.limits is a read-only mapping of the effective per-invocation ceilings the enforcing daemon resolved for this run (memory, cpu, processes, bytes, result_bytes — five keys; open_files is retired — only the dimensions actually delivered appear as keys):

budget = app.limits["result_bytes"]

One Request → one Response per connection

Both real brokers — internal/apprund/udsproxy.go's handleConn and internal/agentdhost/dataplane.go's serveConn — service exactly one Request/Response exchange over a connection and then close it. So:

  • Connection (from connect()) is a single-exchange object. Its socket is opened on request() and closed as soon as the Response is read; a second request() raises TransportClosedError rather than the bare BrokenPipeError the kernel would give you.
  • App is the reusable handle. It opens a fresh Connection per governed verb, which is why repeated query/action/synthesize calls just work.

Apps do not need to manage any of this — use open_app(). The lower-level connect() seam stays supported for a single raw exchange (e.g. packages/app-uv-fixture/app_main.py):

with zetify_app.connect() as conn:
    response = conn.request({"kind": "action", "verb": "query", "action": "some.verb"})

No fallback endpoint

connect() — and therefore open_app() — raises zetify_app.TransportUnavailableError immediately if neither TILION_AGENTD_UDS nor ZETIFY_AGENTD_TCP_ADDR is set. A process not spawned inside a daemon-hosted sandbox has nothing to connect to, and this package never falls back to a default endpoint: it fails loudly, before any app logic runs, rather than silently talking to the wrong peer.

Resolution (ENG-10285): when ZETIFY_AGENTD_TCP_ADDR is set (Kubernetes / Docker app plane — the daemon's governed app-proxy TCP arm), both connect() and the HTTP governed client (open_governed_app() / GovernedApp) dial that host:port over TCP and take it over the UDS path. Otherwise they dial the UDS socket named by TILION_AGENTD_UDS (single-host containerd plane). The peer-auth token (TILION_AGENTD_UDS_TOKEN — the framed request frame's auth_token, or the HTTP leg's Authorization: Bearer) is read from the child env either way. An app never handles the endpoint or the token.

Wire format

A 4-byte big-endian uint32 length prefix followed by that many bytes of JSON body, capped at MAX_FRAME_BYTES (1 MiB) in both directions — must match internal/brokeruds/proto.go exactly.

Dependencies: httpx>=0.27 (declared in pyproject.toml) — the governed-verbs client builds on httpx.Client over the daemon's UDS socket or, on the Pod plane, the published TCP address (ENG-10285); the framed leg (import zetify_app, connect()/open_app()) is standard library only.

Naming

The PyPI distribution is zetify-app; the importable module is zetify_app; the base of the exception tree is ZetifyAppError. There is no alias, shim, or transition window for the pre-rename spellings — every app in apps/ and packages/ was migrated in the same change (ENG-3966), and nothing outside this monorepo has ever been able to install this package. Zetify is the only name this SDK has ever presented on a public index.

Tests

uv run --package zetify-app pytest packages/app-sdk/tests

Those run against a fake broker and are the fast guard. The evidence that the governed verbs work is Go-side, because both halves of the contract this SDK has to satisfy live in Go: internal/apprund/appsdk_governed_verbs_test.go drives the real udsproxy with a real spawned python3 running this package, and asserts the frames it emits survive the real Go decoders. A fake broker that is more permissive than the wire it stands in for pins whatever the client happens to do — which is how ENG-3649 and ENG-3650 shipped green.

go test ./internal/apprund/ -run TestAppSDK_GovernedVerbs

Metadata

Release files for zetify-app 0.1.2

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

Source distribution (sdist)

Source distribution for zetify-app 0.1.2
File Size Uploaded Provenance Actions
zetify_app-0.1.2.tar.gz 68.2 kB With provenance Details for zetify_app-0.1.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for zetify-app 0.1.2
File Interpreter ABI Platform Actions
zetify_app-0.1.2-py3-none-any.whl Python 3 none any Details for zetify_app-0.1.2-py3-none-any.whl

Total release size: 107.8 kB

Release files / zetify_app-0.1.2.tar.gz

Download URL zetify_app-0.1.2.tar.gz
Size 68.2 kB
Tags Source
SHA-256 checksum
How to use checksums
5272050e29e53d24f9fe4e7e30d1beb38824a632eb857067dda2926bf3743536
BLAKE2b-256 checksum
How to use checksums
4790862052dee60b3b1dc9d30c0a208f7f63d0175529c03dbaa742aa64c66bd6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Oct 16, 2026.

Transparency log

Release files / zetify_app-0.1.2-py3-none-any.whl

Download URL zetify_app-0.1.2-py3-none-any.whl
Size 39.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
eeb065eff32aebb17353dc44c91370c926d165d7683064b899bd3ed6500b9fb8
BLAKE2b-256 checksum
How to use checksums
0932f51552abe555122c20abe195b92bdc246cf55fec496d013735dd1e366f32
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Oct 16, 2026.

Transparency log

Security for zetify-app 0.1.2

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.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for zetify_app-0.1.2.tar.gz

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 Oct 16, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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