@cycls.app is a function that returns an ASGI application. Cycls serves it,
gives it a URL, and wires in identity and storage.
notes.py
The decorator
The body runs inside the container at startup. Import heavy dependencies there,
not at module level, so your local process stays light.
Identity
Withauth= set, two dependencies become available on the decorated object.
user carries id, org_id, org_slug, org_role, org_permissions, plan
and features. See Authentication for providers and claims.
Storage
notes.workspace resolves a per-user scope on the volume mounted at
/workspace. Two things live there:
- Key-value
- Files
Serving a front end
Bundle the HTML with the image and return it from a route.Running untrusted commands
cycls.Sandbox is a fluent wrapper around bubblewrap for executing commands
with a read-only root, a cleared environment and no network unless you ask.
cycls.Sandbox() already mounts /tmp, /dev and /proc and dies with its
parent. cycls.SandboxResult carries stdout and stderr as bytes, the exit
code, timed_out, and .output, both streams decoded into one string.
env= is the environment of bwrap itself, not of the command. Without it,
bwrap runs with your app’s full environment, secrets included, so pass a
minimal one as the example does.
Programmatic control
python notes.py to serve, guard it the usual way:
Next
Agents
The chat layer on top of apps: a managed model loop, tools and a web UI.