Writing an AI Feature Spec, with a Worked Example

Updated · 5 min read
mediumPython 3.13airequirementsspecificationsproduct-managementevaluation

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 feature spec template, filled in for Campus Helper

The Lines That Matter Most

LineWhy it matters for AI
What it doesn't doAI will try to answer anything; the spec sets the boundaries, such as no fee waivers
Examples with ideal outputsThey show the tone, format and sources you expect, and seed the evaluation set
Success metrics and thresholdsTurn "good enough" into numbers, such as 90% correct
Evaluation planHow 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 budgetEvery answer costs money
Risks and mitigationsHallucination, privacy, bias, abuse; see "Managing AI Product Risks"
Launch and monitoringHow 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:

  1. Name six lines of an AI feature spec.
  2. Why is the "doesn't do" line important?
  3. What makes a success metric useful?

Quick check: AI feature specs

4 questions
1Which spec line sets the boundaries of an AI feature?
2Which success metric is useful?
3Why include example inputs with ideal outputs?
4What should Campus Helper do when the documents don't cover a question?

Key Takeaways

Quick reference

Spec lineOne example
Doesn't doNo fee waivers
Metric90% correct on 50 questions
Errors"Not in my documents; contact the office"
CostUnder 1 cent per answer

Was this tutorial helpful?

Lesson 65 of 186