Using mirrord with AI Agents
Configure AI coding agents to test code changes against your cluster using mirrord
How it works
Generating the setup with a meta-prompt
Generate AGENTS.md with mirrord integration for this repository.
Discovery Phase:
1. Scan repository structure to identify services (main.go, app.py, server.js, etc.)
2. Detect programming languages and frameworks
3. Look for Kubernetes manifests or conventions to understand deployment structure
4. Identify potential Kubernetes targets for each service (do NOT assume correctness)
5. Present discovered services and suspected targets in a table, including:
- Any existing mirrord configuration files (show path and target)
- Confidence level for each suspected target
STOP — Ask ONE question at a time. WAIT for my answer before continuing.
Question 1:
"Which services should be configured for AI-driven testing?"
Show the discovered services and WAIT FOR MY ANSWER.
If a service has existing config, note: "(has config - will ask to keep/replace)"
For each selected service, ask the following questions ONE AT A TIME.
WAIT for my answer before proceeding to the next question.
Question 2:
"For service <name>: What Kubernetes target should be used?"
Based on discovery, here are possible targets for this service:
- <candidate target 1> (target type, namespace, confidence)
- <candidate target 2> (target type, namespace, confidence)
Please select one of the above OR provide a different target.
Provide:
- Target type: deployment or pod
- Target name
- Namespace
DO NOT assume a default.
WAIT FOR MY ANSWER.
Question 3:
"For service <name>: How should testing success be verified when running with mirrord?"
Choose one:
- HTTP behavior (I will provide details such as domains/paths..)
- Logs (I will provide success message)
- Side effects (I will describe what to check)
- No automated verification
WAIT FOR MY ANSWER.
Question 4 (if needed, based on verification method):
Ask for verification coordinates only if required.
- Domains, paths, and headers may be supplied by me
- OR explicitly marked as environment variables
- Do NOT guess or hard-code remote URLs
WAIT FOR MY ANSWER.
Question 5:
"For service <name>: Which mirrord network mode should be used?"
- steal (intercept traffic)
- mirror (observe traffic)
WAIT FOR MY ANSWER.
Question 6:
"For service <name>: Any special requirements?"
- Filesystem access
- Environment variables
- Traffic filtering
WAIT FOR MY ANSWER.
IMPORTANT:
- Ask ONE question at a time
- WAIT for my answer before continuing
- DO NOT assume defaults
- DO NOT generate files yet
Generation Phase (ONLY after all required answers are provided):
For each configured service, generate:
1. `.mirrord/mirrord-<service>.json`
- Use the confirmed target type, target name, and namespace
- Configure the selected network mode
- Apply traffic filtering ONLY if I explicitly provided it
- Use only fields supported by the installed mirrord version
- Avoid embedding secrets or sensitive values
2. `scripts/mirrord-<service>.sh` helper script
- Perform pre-flight checks (mirrord installed, kubectl access, target exists)
- Execute mirrord safely
- Do NOT echo sensitive values to output
- Include a --stop flag to kill running mirrord session
3. `AGENTS.md`
- Start with a prominent ATTENTION block
- Use strong imperative language (MUST / NEVER / ALWAYS)
- Define mirrord as the required testing runtime
- Describe verification behavior, not guessed URLs or credentials
- Reference helper scripts instead of inline commands where possible
- Include a service overview table
- Add a troubleshooting section
Validation:
- Verify mirrord is installed (`mirrord --version`)
- Check kubectl access (`kubectl config current-context`)
- Validate each configured target exists in the specified namespace
- Ensure helper scripts are executable
Report Back:
- Services discovered
- Services selected for configuration
- Confirmed target and namespace per service
- Verification method per service
- Files created (paths only)
- Any remaining manual inputs or values requiring reviewDemo
What gets generated
AGENTS.md
AGENTS.md.mirrord/mirrord-<service>.json
.mirrord/mirrord-<service>.jsonscripts/mirrord-<service>.sh
scripts/mirrord-<service>.shTesting with the generated setup
Compatibility
Keeping it updated
Last updated
Was this helpful?

