Technical
Directing AI Agents: The Art of Intent Over Instructions
Most people fail with AI agents because they give instructions instead of intent. 'Write a function that takes a string and returns a boolean' is an instruction. 'Validate email addresses so we do not send newsletters to invalid ones' is intent. The difference determines the quality of everything the agent produces.
Instructions vs Intent
Instructions tell the agent HOW to do something. Intent tells the agent WHAT problem to solve and WHY it matters. When you share intent, the agent can make better decisions about implementation because it understands the goal.
Instruction: 'Write a regex that matches email addresses'
Intent: 'Validate subscriber emails before we add them to our newsletter list'
The instruction produces a regex.
The intent produces:
- Pydantic EmailStr validation (more robust than regex)
- A 422 response for invalid emails with a clear error message
- Duplicate email detection
- Maybe a suggestion for common typos (gmial.com -> gmail.com)The Three Levels of Direction
Level 1: Micromanagement (least effective). 'Create a file called validators.py. Add a function called validate_email. Import the re module. Write a regex pattern that matches RFC 5322 email format.'
Level 2: Task delegation (good for experienced users). 'Add email validation to the subscriber creation endpoint. Use Pydantic's built-in email validation. Return helpful error messages.'
Level 3: Intent sharing (best for production work). 'Subscribers are entering invalid emails, which causes our newsletter sends to bounce. High bounce rates risk getting our SES account suspended. Fix this at the API level so bad emails never reach the database.'
Why Intent Works Better
When you share intent, the agent can:
- Choose the right tool for the job (Pydantic vs regex vs a validation library)
- Handle edge cases you did not think of (empty strings, whitespace, Unicode)
- Add related improvements (error messages, logging, monitoring)
- Ask clarifying questions when the intent is ambiguous
Practical Examples
| Task | Instruction Approach | Intent Approach | |------|---------------------|----------------| | Error handling | 'Add try/except to this function' | 'This endpoint crashes on bad input. Make it return helpful errors instead.' | | Testing | 'Write a unit test for create_post' | 'I need confidence that post creation works with valid data and rejects invalid data gracefully' | | Refactoring | 'Move this code to a new file' | 'This 500-line file is hard to navigate. Organize it so each concern has its own module.' |
The Skill Behind Intent
Sharing intent requires understanding the problem deeply enough to explain WHY, not just WHAT. This is why domain expertise matters more than ever in the AI era. A developer who understands the business problem gives better intent. Better intent produces better agent output. Better output means faster shipping with fewer bugs.
Practice by rewriting your next prompt as an intent statement instead of an instruction set. Explain the problem, not the solution. See what changes in the agent's output.
For more on effective AI collaboration, see Anthropic's prompting documentation.
RELATED READING
The Consulting Shift I Am Making In Year Two
After a year of writing and building, my consulting practice is changing shape. Shorter engagements. Sharper outcomes.
ReadThe Frontend Shift: Shipping Less JavaScript In Year Two
A year ago I reached for Next.js for everything. This year I often reach for nothing.
ReadThe Serverless Lesson I Would Write On A Sticky Note
After a year of shipping serverless projects, one rule explains most of the wins and all of the losses.
Read