Customizing agents
Most “bad agent output” is actually bad input structure. This guide shows how to get reliable results without turning the workflow into a science project.
Browse agents1) Make the input shape stable
Prefer structured inputs over long free-form prompts.
{
"task": "Extract fields",
"source": "customer_email",
"text": "...",
"fields": ["company", "budget", "timeline"],
"output_format": "json"
}
2) Add constraints (what NOT to do)
Good constraints are short and enforceable:
- Don’t invent facts.
- If information is missing, return
null. - Keep answers under N sentences.
3) Use examples sparingly (but correctly)
A single good example can outperform long instructions.
- Example input
- Example output
- 1–2 “edge case” examples
4) Evaluate before you automate
Create a small test set:
- 10 normal cases
- 5 edge cases
- 5 adversarial cases (ambiguous, messy, missing info)
Checklist
- Build a 20-case test set
- Define what “pass” means
- Retest after any major change
5) Handle safety and privacy
- Don’t send secrets in prompts
- Minimize PII where possible
- Log outcomes, not raw customer data