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, simply pass auth=True to the @agent decorator:
import cycls

agent = cycls.Agent()

@agent("cake", title="My Secure Agent", auth=True)
async def cake_agent(context):
    # Only authenticated users can reach this code
    user = context.user
    yield f"Hello, {user.email}!"

agent.deploy(prod=False)

Accessing User Data

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

agent = cycls.Agent()

@agent("my-agent", auth=True)
async def user_agent(context):
    # Access user information
    user_id = context.user.id
    user_name = context.user.name
    user_email = context.user.email
    user_org = context.user.org
    
    return f"Hello, {user_name} from {user_org}!"

agent.deploy(prod=True)
PropertyTypeDescription
idstringUnique identifier for the user
emailstringUser’s email address
namestringUser’s full name
orgstringOrganization ID the user belongs to

User Management

When auth is enabled, Cycls handles the entire login flow, including:
  • 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.