Skip to main content
Cycls provides built-in authentication to secure your agents. By setting auth=True, you can gate access to your agent and manage users effortlessly.

Enabling Auth

To enable authentication, pass auth=True to the @cycls.app() decorator:
import cycls

@cycls.app(auth=True)
async def app(context):
    # Only authenticated users can reach this code
    user = context.user
    yield f"Hello, {user.email}!"

app.local()

Accessing User Data

When auth=True, the context.user object is populated with the authenticated user’s information:
import cycls

@cycls.app(auth=True)
async def app(context):
    user = context.user

    yield f"Hello, {user.name}!\n"
    yield f"Email: {user.email}\n"
    yield f"Organization: {user.org}\n"
    yield f"Plan: {user.plan}"

app.local()

User Properties

PropertyTypeDescription
idstringUnique identifier for the user
emailstringUser’s email address
namestringUser’s full name
orgstringOrganization ID the user belongs to
planstringUser’s subscription plan

Monetization with Cycls Pass

Enable subscription-based access with plan="cycls_pass":
import cycls

@cycls.app(auth=True, plan="cycls_pass")
async def app(context):
    user = context.user

    if user.plan == "cycls_pass":
        yield "Welcome, premium user! Here's your exclusive content."
    else:
        yield "Upgrade to Cycls Pass for premium features!"

app.local()
When plan="cycls_pass" is set:
  • Users are prompted to subscribe via Cycls Pass
  • Subscription status is available via context.user.plan
  • You can gate features based on the user’s plan

User Management

When auth is enabled, Cycls handles the entire login flow:
  • Sign up / Sign in UI
  • Email verification
  • Session management
  • JWT token handling
User management via the Cycls Dashboard is coming soon.

Next Steps

Cloud Deployment

Deploy your agent to a global serverless network.