lively-coat-10905
10/23/2025, 4:23 AMtall-airline-16756
10/23/2025, 4:23 AMtall-airline-16756
10/23/2025, 4:24 AMws_url, api_key, and api_secret from environment variables (LIVEKIT_URL, LIVEKIT_API_KEY, LIVEKIT_API_SECRET) if these aren't set directly in the code.
• Using these credentials, it creates a JWT access token with the necessary permissions (such as room_join=True) to authenticate securely.
• During initialization, an internal _worker_token is filled from the LIVEKIT_WORKER_TOKEN environment variable. This token is then included as a URL parameter (worker_token) whenever the worker connects to the LiveKit server.
• This _worker_token acts as a secure, short-lived credential, allowing the worker to authenticate and function without needing long-term API keys during runtime.
This thoughtful setup helps ensure your worker connects securely and automatically to rooms, unless you choose to configure it differently. If you have any more questions or need further clarification, feel free to ask—I'm here to help!
Sources: LiveKit Docs | livekit-plugins/livekit-plugins-bey/livekit/plugins/bey/avatar.pylively-coat-10905
10/23/2025, 4:35 AMtall-airline-16756
10/23/2025, 4:35 AMLIVEKIT_API_KEY, LIVEKIT_API_SECRET, and LIVEKIT_URL. If these aren’t set, the agent will typically show an error.
• When you deploy agents using the lk CLI, it usually takes care of injecting these credentials into the agent’s environment for you. This happens via local config, environment variables, or flags you provide.
• Another option is managing secrets (including credentials) during deployment with the CLI’s --secrets flag or by using a secrets-file.
If you haven’t manually added credentials, it’s quite possible that your deployment process (like the CLI or a pre-set environment) is handling this behind the scenes. I’m here to help if you want to dig into your deployment setup together to make sure everything’s configured just right.
Sources: Server-Side SDKs & Authentication | livekit/livekit_composite | DeepWiki | agent-console/components/credential-settings.tsx | agents/src/worker.ts | Secrets management | LiveKit Docs | cmd/lk/utils.golively-coat-10905
10/23/2025, 4:49 AMtall-airline-16756
10/23/2025, 4:49 AMlk CLI), you’ll provide credentials like LIVEKIT_API_KEY, LIVEKIT_API_SECRET, and LIVEKIT_URL. You can do this in a couple of ways:
◦ Using command-line flags: lk agent deploy --secrets LIVEKIT_API_KEY=abc,LIVEKIT_API_SECRET=xyz
◦ Or by providing a secrets file: lk agent deploy --secrets-file .env
• Secure Transmission: Rest assured, the CLI securely sends these credentials to the LiveKit server during deployment, where they’re safely stored and then injected into the agent’s runtime environment as environment variables.
• Environment Variable Injection: Inside the deployed agent container, you’ll find these credentials available as environment variables, so they’re never hardcoded in your source code—keeping things nice and secure.
• Third-Party Platforms: If you’re deploying on platforms like Fly.io or Render, you’ll want to manually set these credentials as environment variables through the platform’s dashboard or CLI.
• Configuration File: The livekit.toml file created during deployment will include the agent’s ID and project subdomain, but for your security, it won’t store any credentials.
If you haven’t explicitly provided credentials, it might be that your deployment process (like the CLI or hosting platform) is automatically injecting them based on pre-configured secrets. If you’d like, I’m here to help you dig into your specific deployment setup and make sure everything’s working smoothly!
Sources: fly.io/README.md | CLI Tools & Token Management | livekit/livekit_composite | DeepWiki | Agent deployment CLI reference | LiveKit Docs | protobufs/livekit_cloud_agent.proto | cmd/lk/agent.golively-coat-10905
10/23/2025, 4:53 AMtall-airline-16756
10/23/2025, 4:53 AMlk agent create command. It doesn’t automatically pass your account credentials to the agent. Instead, the LiveKit CLI uses your credentials behind the scenes to authenticate with the LiveKit Cloud API when creating the agent. Usually, these credentials come from your project configuration (like livekit.toml) or your default project settings.
If you’d like the agent to have specific credentials in its environment, you’ll need to provide them explicitly during creation using flags such as --secrets, --secrets-file, or --secret-mount. Just a heads up, credentials like LIVEKIT_API_KEY, LIVEKIT_API_SECRET, and LIVEKIT_URL aren’t automatically added to the agent’s environment.
If you want, I’m here to help you explore how your project configuration or deployment setup might be managing these credentials. Just let me know!
Sources: CLI Tools & Token Management | livekit/livekit_composite | DeepWiki | cmd/lk/agent.go | Agent deployment CLI reference | LiveKit Docs