Writing an AI Feature Spec, with a Worked Example
What does an engineer need to know before building an AI feature? "Make Campus Helper answer fee questions" isn't enough. Answer from what? In which languages? How good is good enough? What happens when it doesn't know? Without those answers, every engineer builds a different feature.
This lesson walks through the AI feature spec, line by line, using Campus Helper's fee questions as a worked example.
The Worked Example
The Lines That Matter Most
| Line | Why it matters for AI |
|---|---|
| What it doesn't do | AI will try to answer anything; the spec sets the boundaries, such as no fee waivers |
| Examples with ideal outputs | They show the tone, format and sources you expect, and seed the evaluation set |
| Success metrics and thresholds | Turn "good enough" into numbers, such as 90% correct |
| Evaluation plan | How quality is measured, before launch and after every change |
| Errors and "I don't know" | The behavior that protects users when the AI can't answer |
| Cost per use and budget | Every answer costs money |
| Risks and mitigations | Hallucination, privacy, bias, abuse; see "Managing AI Product Risks" |
| Launch and monitoring | How it reaches users safely, and how you'll know it's still working |
The "doesn't do" line is often the most important: it stops Campus Helper giving confident advice about one family's finances, which only the office should handle.
Common Mistakes
Specifying only the happy path. Include unclear, off-topic and unanswerable questions.
Leaving quality as "accurate". Set a measurable threshold on a named evaluation set.
Forgetting cost. A feature can work perfectly and still be too expensive.
Interview Corner
What should an AI feature specification include?
The problem and users, what the AI does and doesn't do, example inputs with ideal outputs, success metrics and thresholds, an evaluation plan, error and "I don't know" behavior, data and privacy rules, cost per use, risks and mitigations, and the launch and monitoring plan.
Why specify what an AI feature does not do?
Because a model will attempt almost any request. Clear boundaries prevent harmful or out-of-scope answers and tell engineers what to block or hand off.
Practice
Exercise: write the Campus Helper spec yourself. Using the template, write a spec for Campus Helper's admission deadlines feature. Include users, three examples with ideal outputs, success metrics with thresholds, an evaluation plan, a launch experiment and three risks with mitigations. Ask a friend to find any line they couldn't test.
Check your understanding:
- Name six lines of an AI feature spec.
- Why is the "doesn't do" line important?
- What makes a success metric useful?
Key Takeaways
Quick reference
| Spec line | One example |
|---|---|
| Doesn't do | No fee waivers |
| Metric | 90% correct on 50 questions |
| Errors | "Not in my documents; contact the office" |
| Cost | Under 1 cent per answer |
Was this tutorial helpful?