Autonomous Closed-Loop Agent Workflows with Signadot & Codex
- Baseline environment: Signadot account, Signadot CLI v1.4.0+, and HotROD baseline (cluster, operator, app) completed via Rapid Local Debugging with Signadot & Cursor or Closed-Loop Microservices Validation with Claude Code & Signadot.
- Local connect:
signadot local connectis running and healthy before Codex; see Local development. - Toolchain: Go 1.21+,
grpcurl, andjq. - Node.js with
npx: Used to install Agent Skills (npx skills add …). - Codex: Codex CLI installed and signed in with ChatGPT.
Overview
Testing local microservice changes against a shared Kubernetes cluster often involves a mess of kubectl port-forward commands, brittle mocks, or waiting for CI/CD pipelines just to verify a one-line change.
In this tutorial, we will establish an autonomous closed-loop workflow using Signadot and Codex (the OpenAI CLI coding agent) with two complementary integrations: Signadot MCP, which lets the agent discover clusters, workloads, and sandboxes through the Signadot control plane, and the signadot-validate skill, which drives a repeatable validation loop against real cluster dependencies. You give Codex an objective and a concrete exit condition (the verifier script, scripts/verify-route-seconds.sh) and ask it to keep iterating until that script exits successfully. Beyond generating code, Codex validates its own work against real cluster dependencies, iterating until a concrete test script passes. It will create or reuse a sandbox, run the route service locally, fix either the verification script or the route service code as needed, and retry until the test passes, all without human intervention.
Read more in the Agent Skills guide.
Step 1: Setup Codex MCP
Bridge Codex to the Signadot CLI so the AI agent can control Signadot via natural language in your terminal.
Install Codex
If you haven't already installed Codex:
Install the signadot-validate skill
From any directory, install the skill into Codex globally so it is available in any repository you open with Codex:
Verify the skill in Codex
Restart Codex (or open a new session). Run /skills and select List skills to confirm signadot-validate appears.
You should see signadot-validate in the list. Codex will load it automatically when it is relevant to the task.
Add Signadot MCP Server
Configure Codex to use the Signadot MCP server:
This command:
- Adds the
signadotMCP server to Codex's global configuration - Points to the
signadot mcpcommand
Verify MCP Connection
Verify the Signadot MCP server is registered:
Launch Codex
Start Codex for the first time:
First-time authentication flow:
The CLI opens your browser for ChatGPT authentication and consent.
Return to your terminal to see the login confirmation:
Press Enter to continue into Codex.
You'll see the main Codex prompt:
To confirm the Signadot MCP tools are available, run /mcp inside Codex:
You should see the full list of Signadot tools including create_sandbox, list_clusters, list_sandboxes, get_sandbox, and resolve_workload_port among others.
Enable Full Access
Codex runs in a restricted mode by default. Full Access is needed so the agent can call signadot and read configuration outside the repo directory without repeatedly asking for confirmation. Before starting the autonomous workflow, switch Codex to Full Access mode for this session.
Inside Codex, run:
Select Full Access:
Then verify Codex can reach local tooling:
If these checks fail, revisit Full Access before proceeding.
For detailed setup and CLI reference, see the Codex CLI documentation.
Step 2: The Autonomous Workflow
Ensure your prerequisites are still healthy before starting this workflow, especially that signadot local connect is running in the background.
We will now use Codex to drive the full write-run-validate-iterate loop via natural language in the terminal.
Navigate to the HotROD Repository
Launch Codex in the repo:
When prompted, trust the workspace:
The Objective
Our goal is to have Codex modify the route verification flow and prove the change works through a real Signadot sandbox. You add scripts/verify-route-seconds.sh in your clone; that script defines the success criteria.
Codex will:
- Create a local-dev sandbox called
local-route-devfor thehotrod/routeDeployment (or reuse it if it already exists). - Start the route service locally using the sandbox environment.
- Run the test script against the sandbox routing key.
- Inspect failures, apply a fix (to the verification script or the route service code), and retry until the test passes.
Add the Test Script
Create the following script in your HotROD clone. Upstream HotROD does not ship this file. Codex reads and runs it and treats it as the source of truth for "done".
The verifier will fail on the first run: it expects an etaUnit field that is not returned by the FindRoute response. Codex should diagnose the mismatch and fix the script.
You can commit this script if you like; Codex will read it to understand the success criteria.
Prompt 1: Context and Cleanup
We want a clean slate to avoid state conflicts from previous sessions, and we want Codex to understand the success criteria before it starts running anything.
Check my Signadot setup, clean up any old sandboxes, and read
scripts/verify-route-seconds.sh so you understand the success criteria.Codex will use the Signadot MCP tools to verify authentication, list your cluster, inspect any existing sandboxes, and read the verifier script.
You should see Codex confirm your cluster name, the state of any existing sandboxes, and that it has read and understood the verifier's success criteria.