melodic-apple-60020
03/10/2026, 9:04 PMlk agent deploy and deploying a pre-built image rather than having the build happen in LiveKit cloud? My container build includes credentials and other dependencies for our SDLC infra, and I'd rather not add those long-lived credentials in my LiveKit agent's .env.tall-airline-16756
03/10/2026, 9:04 PMtall-airline-16756
03/10/2026, 9:05 PMlk agent deploy --image your-registry/your-agent:tag
This bypasses LiveKit’s cloud build so build-time credentials never need to exist in the agent’s .env.
Separate build-time vs runtime credentials
• Build-time credentials: keep these strictly in your CI/CD environment (pipeline secrets, ephemeral tokens). Use them only during image build to fetch private packages or private repos. Do NOT copy these into the final image or provide them to LiveKit.
• Runtime credentials: only include secrets needed at agent runtime (LLM keys, STT/TTS keys, runtime service credentials). Provide these via LiveKit’s secrets handling so they are injected at runtime and can be rotated without rebuilding the image.
How to supply runtime secrets to LiveKit
• Use the CLI secrets commands to provide runtime env vars to LiveKit (create/update secrets). Example patterns:
◦ Create with a secrets file: lk agent create --secrets-file .env --region us-east
◦ Update secrets without redeploying: lk agent update-secrets --secrets API_KEY=new-value --overwrite
Secrets provided this way are injected at runtime and can be updated independently of the container image.
Container build best practices
• Multi-stage builds: keep build-only tools and credentials in earlier stages so they aren’t present in the final image.
• .dockerignore: exclude local creds, CI artifacts, and any files that aren’t needed at runtime.
• Remove or avoid embedding credentials in images or source (use build args in CI only and never commit).
• Run non-root where possible and follow general image-hardening steps.
• Pre-download large models or heavy dependencies in the build stage so runtime startup is fast, but ensure those downloads don’t require long-lived secrets at runtime.
CI/CD recommendations
• Use short-lived tokens for any registry or repo access; scope them narrowly.
• Store secrets in your CI secret store (GitHub/GitLab secrets, Vault, AWS Secrets Manager) and inject them into the build step only.
• Scan images for accidentally included secrets before pushing (linting or secret-scanning tools).
If you want, I can help with:
• An example multi-stage Dockerfile that excludes build secrets.
• A CI pipeline snippet (GitHub Actions or GitLab CI) that builds, scans, pushes, and then runs lk agent deploy --image.
• Exact lk CLI command examples based on your agent name/region.
Which of those would be most helpful next?
Sources: Deployment reliability on LiveKit Cloud | LiveKit | Agents Framework | livekit/livekit_composite | DeepWiki | examples/drive-thru | livekit/livekit_composite | DeepWiki | Agents (Python) | livekit/livekit_composite | DeepWiki | Examples | livekit/livekit_composite | DeepWikimelodic-apple-60020
03/10/2026, 9:07 PM--image is a valid option for the lk agent deploy command - Where are the docs for this, and what version of lk do I need to be on?tall-airline-16756
03/10/2026, 9:07 PMlk agent deploy --image exists and which lk CLI version (or docs) show that option.
I don’t have a direct docs link or version note in front of me right now. To help track this down for you, please tell me:
• Which version of the lk CLI are you currently using? (Run lk --version and paste the output.)
• Which docs or resources have you already checked? (CLI reference, GitHub repo, changelog, etc.)
• If you can, paste the exact lk agent deploy --help output you see locally — that will show whether --image is present in your installed CLI.
With that info I can:
• Confirm whether --image is supported by your installed CLI binary.
• Look up the exact docs or release that introduced the flag, or provide alternative commands/workflows if the flag isn’t available in your version.melodic-apple-60020
03/10/2026, 9:08 PMamanda:~ % lk --version
lk version 2.13.1
amanda:~ % lk agent deploy --help
NAME:
lk agent deploy - Deploy a new version of the agent
USAGE:
lk agent deploy [options] [working-dir]
OPTIONS:
--secrets string [ --secrets string ] KEY=VALUE comma separated secrets. These will be injected as environment variables into the agent. These take precedence over secrets-file.
--secrets-file FILE FILE containing secret KEY=VALUE pairs, one per line. These will be injected as environment variables into the agent.
--secret-mount string [ --secret-mount string ] Local path to a secret file to be mounted on agent environment
--help, -h show help
GLOBAL OPTIONS:
--url URL URL to LiveKit instance (default: "<http://localhost:7880>") [$LIVEKIT_URL]
--api-key KEY Your KEY [$LIVEKIT_API_KEY]
--api-secret SECRET Your SECRET [$LIVEKIT_API_SECRET]
--dev Use developer credentials for local LiveKit server (default: false)
--project NAME NAME of a configured project
--subdomain SUBDOMAIN SUBDOMAIN of a configured project
--config TOML Config TOML to use in the working directory (default: "livekit.toml")
--curl Print curl commands for API actions (default: false)
--verbose (default: false)tall-airline-16756
03/10/2026, 9:09 PM