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, open_files, bytes, result_bytes — 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/agentd/dataplane.go's serveConn — service exactly one
Request/Response exchange over a connection and then close it. So:
Connection(fromconnect()) is a single-exchange object. Its socket is opened onrequest()and closed as soon as the Response is read; a secondrequest()raisesTransportClosedErrorrather than the bareBrokenPipeErrorthe kernel would give you.Appis the reusable handle. It opens a freshConnectionper governed verb, which is why repeatedquery/action/synthesizecalls 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 socket path
connect() — and therefore open_app() — raises
zetify_app.TransportUnavailableError immediately if TILION_AGENTD_UDS is
unset. A process not spawned inside a daemon-hosted sandbox has nothing to
connect to, and this package never falls back to a default socket path: it
fails loudly, before any app logic runs, rather than silently talking to the
wrong peer.
The socket path and the per-invocation peer-auth token
(TILION_AGENTD_UDS_TOKEN, attached to every request frame by construction)
are read from the child env by the SDK. An app never handles either.
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: Python 3 standard library only — dependencies = [].
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
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 zetify_app-0.1.1.tar.gz.
File metadata
- Download URL: zetify_app-0.1.1.tar.gz
- Upload date:
- Size: 50.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e6cbd932bf5fd265c7116fb6ed8d450b8b9ec5e7046a6463afe81f3a0c9d3249
|
|
| MD5 |
eb471eb6c2e93476bb6de89a8e9291ec
|
|
| BLAKE2b-256 |
ab0ee8616792e5054e50ccf88de83d337cfaf35d44c1ce7162104837626fa831
|
Provenance
The following attestation bundles were made for zetify_app-0.1.1.tar.gz:
Publisher:
publish-zetify-app.yml on ZetifyAI/zetify
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
zetify_app-0.1.1.tar.gz -
Subject digest:
e6cbd932bf5fd265c7116fb6ed8d450b8b9ec5e7046a6463afe81f3a0c9d3249 - Sigstore transparency entry: 2514476785
- Sigstore integration time:
-
Permalink:
ZetifyAI/zetify@87a94a119ab2d8b02200125af3790224fed5a1d9 -
Branch / Tag:
refs/tags/zetify-app-v0.1.1 - Owner: https://github.com/ZetifyAI
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
self-hosted -
Publication workflow:
publish-zetify-app.yml@87a94a119ab2d8b02200125af3790224fed5a1d9 -
Trigger Event:
push
-
Statement type:
File details
Details for the file zetify_app-0.1.1-py3-none-any.whl.
File metadata
- Download URL: zetify_app-0.1.1-py3-none-any.whl
- Upload date:
- Size: 33.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
299bfd90b06cccd406386caadb90ab9509d54d0721d6e91cc0e96d7c51b66f38
|
|
| MD5 |
a3f8f0dedc6c08b5e5c67413a2107463
|
|
| BLAKE2b-256 |
056163d1d83427d4d1288e572f8fab57caefc5e6a355dbbd7e5be12af29d5bd6
|
Provenance
The following attestation bundles were made for zetify_app-0.1.1-py3-none-any.whl:
Publisher:
publish-zetify-app.yml on ZetifyAI/zetify
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
zetify_app-0.1.1-py3-none-any.whl -
Subject digest:
299bfd90b06cccd406386caadb90ab9509d54d0721d6e91cc0e96d7c51b66f38 - Sigstore transparency entry: 2514476792
- Sigstore integration time:
-
Permalink:
ZetifyAI/zetify@87a94a119ab2d8b02200125af3790224fed5a1d9 -
Branch / Tag:
refs/tags/zetify-app-v0.1.1 - Owner: https://github.com/ZetifyAI
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
self-hosted -
Publication workflow:
publish-zetify-app.yml@87a94a119ab2d8b02200125af3790224fed5a1d9 -
Trigger Event:
push
-
Statement type: