Autonomous Workflows
In autonomous mode, an agent handles the full development lifecycle without a developer in the loop: deploying an Okteto environment, writing code, running tests against live services, and opening a pull request when everything passes. This is the basis of a Software Factory, where agents pick up work from tickets or CI triggers, execute against real infrastructure, and deliver tested pull requests. The developer reviews the output, not the process.
How it works
- Agent reads the ticket or issue for requirements and acceptance criteria
okteto deploy --waitto spin up the full environmentokteto endpointsto capture live URLs- Agent makes code changes based on requirements
okteto deploy --waitto rebuild and redeploy with updated codeokteto test <name>to run test containers- Smoke-test live endpoints (e.g.,
curlagainst the URLs from step 3) okteto logs <service> --since 5mto check for runtime errors- If anything fails: fix the code, redeploy, re-test
- Commit changes and open a pull request
okteto up is never part of autonomous workflows. It's interactive and requires a human terminal. See Command rules.
Agent authentication
For autonomous workflows triggered by CI or webhooks, the agent needs to authenticate with Okteto without a human logging in interactively. Use a Personal Access Token and set the Okteto context before running any commands:
okteto context use https://okteto.example.com --token $OKTETO_TOKEN
Store the token as a secret in your CI system (e.g., a GitHub Actions secret or GitLab CI variable). The agent then has the same CLI access as the token's owner.
Workflow example: ticket to PR
A CI pipeline or webhook triggers the agent with a ticket:
Add a
/healthendpoint to the API service that returns database connectivity status and uptime.
The agent deploys the environment, captures the live URLs, then starts coding:
okteto deploy --wait
okteto endpoints
After making the code changes, the agent redeploys and validates:
# Rebuild and redeploy with the updated code
okteto deploy --wait
# Run tests
okteto test integration
# Smoke-test the new endpoint
curl -s https://api-myns.okteto.example.com/health
# Check logs for errors
okteto logs api --since 5m
If the tests or smoke tests fail, the agent reads the error, fixes the code, redeploys, and re-tests. Once everything passes:
git add src/api/health.ts src/api/routes.ts && git commit -m "Add /health endpoint with db status"
gh pr create --title "Add health endpoint" --body "..."
The deploy-test loop
The core pattern in autonomous mode:
okteto deploy --waitbuilds any changed images and rolls out the updated servicesokteto test <name>runs validation against the live environment
The agent repeats this loop until all tests pass. Each iteration gives real feedback from a running environment, which is what lets the agent self-correct without human intervention.
If you need to rebuild a single service without redeploying the whole environment, okteto build <service> does that. But for most workflows, okteto deploy --wait handles both building and deploying in one step.
The full list of commands agents may and may not run is in Command rules. For flag details on any command, see the CLI Reference.
Next steps
- Collaborative Workflows — stay in the loop and iterate with the agent
- Best Practices — command rules and common pitfalls